Skip to content

Commit

Permalink
Update Node packages (#1894)
Browse files Browse the repository at this point in the history
Updating TypeScript, esbuild, eslint, and prettier to the latest
versions.

Note that since v9 eslint has a different config file format (and also
had some new rules to flag redundant suppressions and catch variables).
  • Loading branch information
billti authored Aug 27, 2024
1 parent b3f137a commit 4d6e26a
Show file tree
Hide file tree
Showing 18 changed files with 416 additions and 499 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.cjs

This file was deleted.

35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
{
ignores: [
"target/",
"playground/public/",
"npm/qsharp/dist/",
"npm/qsharp/lib/",
"npm/qsharp/src/*.generated.ts",
"jupyterlab/lib/",
"jupyterlab/qsharp-jupyterlab/labextension/",
"vscode/out/",
"vscode/test/out/",
"widgets/src/qsharp_widgets/static/",
],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
);
3 changes: 1 addition & 2 deletions npm/qsharp/src/workers/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export function createProxyInternal<
if (curr) return;

while ((curr = queue.shift())) {
// eslint-disable-line no-cond-assign
if (curr.cancellationToken?.isCancellationRequested) {
curr.reject("cancelled");
continue;
Expand Down Expand Up @@ -475,7 +474,7 @@ export function initService<
// Only structured cloneable objects can be sent in worker messages.
// Test if this is the case.
structuredClone(args);
} catch (e) {
} catch {
// Uncloneable object.
// Use String(args) instead of ${args} to handle all possible values
// without throwing. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion
Expand Down
2 changes: 1 addition & 1 deletion npm/qsharp/src/workers/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function createWorker<
if (isMainThread)
throw "Worker script should be loaded in a Worker thread only";

const port = parentPort!; // eslint-disable-line @typescript-eslint/no-non-null-assertion
const port = parentPort!;

const postMessage = port.postMessage.bind(port);

Expand Down
5 changes: 2 additions & 3 deletions npm/qsharp/ux/histogram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ export function Histogram(props: {
function toggleInfo() {
if (!gInfo.current) return;

gInfo.current.style.display === "inline"
? (gInfo.current.style.display = "none")
: (gInfo.current.style.display = "inline");
gInfo.current.style.display =
gInfo.current.style.display === "inline" ? "none" : "inline";
}

// Each menu item has a width of 32px and a height of 10px
Expand Down
Loading

0 comments on commit 4d6e26a

Please sign in to comment.