From b0072ad97866ef98f0a3f85398592c74687d1e3f Mon Sep 17 00:00:00 2001 From: AlCalzone Date: Wed, 25 Sep 2024 15:04:00 +0200 Subject: [PATCH] chore: upgrade to ESLint v9, typescript-eslint v8 (#6987) --- .eslintignore | 7 - .eslintrc.js | 206 ------ .vscode/settings.json | 56 +- ...-unused-imports-npm-4.1.4-a7d7c7cdf3.patch | 24 + eslint.config.mjs | 209 ++++++ package.json | 10 +- packages/cc/package.json | 2 +- packages/cc/src/cc/DeviceResetLocallyCC.ts | 2 +- packages/cc/src/cc/Security2CC.ts | 22 +- packages/cc/src/cc/ZWaveProtocolCC.ts | 4 +- packages/cc/src/lib/Values.ts | 4 +- packages/cc/src/lib/utils.ts | 4 +- packages/config/config/.eslintrc.js | 12 - packages/config/config/eslint.config.mjs | 47 ++ packages/config/package.json | 4 +- packages/config/src/ConfigManager.test.ts | 2 +- packages/config/src/ConfigManager.ts | 2 +- .../config/src/devices/ConditionalItem.ts | 2 +- .../config/src/devices/ParamInformation.ts | 4 +- packages/config/src/index.ts | 1 + packages/core/core.api.md | 18 +- packages/core/package.json | 2 +- packages/core/src/index.ts | 1 + packages/core/src/index_safe.ts | 1 + packages/core/src/security/Manager.test.ts | 2 +- packages/core/src/security/crypto.ts | 2 +- packages/core/src/util/decorators.ts | 40 +- packages/core/src/util/misc.ts | 2 +- packages/eslint-plugin/package.json | 12 +- .../eslint-plugin/src/configs/configFiles.ts | 20 - packages/eslint-plugin/src/index.ts | 9 +- .../eslint-plugin/src/rules/auto-unsigned.ts | 11 +- .../src/rules/ccapi-validate-args.ts | 5 +- .../src/rules/consistent-cc-classes.ts | 2 +- .../rules/consistent-config-string-case.ts | 15 +- ...consistent-device-config-property-order.ts | 22 +- .../src/rules/consistent-param-units.ts | 13 +- .../src/rules/no-debug-in-tests.ts | 4 +- .../src/rules/no-forbidden-imports.ts | 3 +- .../src/rules/no-internal-cc-types.ts | 3 +- .../src/rules/no-misspelled-names.ts | 11 +- .../src/rules/no-surrounding-whitespace.ts | 11 +- .../src/rules/no-unnecessary-min-max-value.ts | 11 +- .../src/rules/no-useless-description.ts | 13 +- .../src/rules/no-value-in-option-label.ts | 13 +- .../src/rules/prefer-defaultvalue.ts | 11 +- packages/eslint-plugin/src/utils.ts | 71 +- .../src/utils/titleAndSentenceCase.ts | 2 +- packages/flash/package.json | 2 +- packages/host/package.json | 2 +- packages/host/src/index.ts | 1 + packages/host/src/index_safe.ts | 1 + packages/maintenance/package.json | 2 +- packages/maintenance/src/implementedCCs.ts | 3 +- packages/nvmedit/package.json | 2 +- packages/nvmedit/src/cli.ts | 2 +- packages/nvmedit/src/lib/nvm3/adapter.ts | 6 +- .../nvmedit/src/lib/nvm3/files/NVMFile.ts | 1 + packages/serial/package.json | 2 +- packages/serial/src/index.ts | 1 + .../serial/src/message/ZnifferMessages.ts | 3 +- packages/shared/package.json | 2 +- packages/shared/shared.api.md | 4 +- packages/shared/src/EventEmitter.test.ts | 1 + packages/shared/src/index.ts | 1 + packages/shared/src/index_safe.ts | 1 + packages/shared/src/types.ts | 9 +- packages/shared/src/utils.ts | 3 +- packages/testing/package.json | 2 +- packages/testing/src/index.ts | 1 + packages/transformers/package.json | 2 +- packages/zwave-js/package.json | 2 +- .../zwave-js/src/lib/controller/Controller.ts | 13 +- .../lib/controller/MockControllerBehaviors.ts | 2 +- packages/zwave-js/src/lib/controller/utils.ts | 26 +- packages/zwave-js/src/lib/driver/Driver.ts | 7 +- .../src/lib/driver/MessageGenerators.ts | 11 +- .../zwave-js/src/lib/driver/NetworkCache.ts | 26 +- .../driver/SerialAPICommandMachine.test.ts | 18 +- .../src/lib/driver/SerialAPICommandMachine.ts | 18 +- .../src/lib/driver/Statistics.test.ts | 1 + .../src/lib/driver/TransportServiceMachine.ts | 14 +- .../zwave-js/src/lib/driver/UpdateConfig.ts | 6 +- packages/zwave-js/src/lib/node/Node.ts | 18 +- .../zwave-js/src/lib/node/NodeReadyMachine.ts | 8 +- .../src/lib/node/NodeStatusMachine.ts | 12 +- packages/zwave-js/src/lib/node/_Types.ts | 12 +- .../lib/test/node/Node.interviewOrder.test.ts | 1 + .../src/lib/zniffer/CCParsingContext.ts | 6 +- packages/zwave-js/src/lib/zniffer/MPDU.ts | 24 +- turbo.json | 12 +- yarn.lock | 689 +++++++++--------- 92 files changed, 1019 insertions(+), 915 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 .yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch create mode 100644 eslint.config.mjs delete mode 100644 packages/config/config/.eslintrc.js create mode 100644 packages/config/config/eslint.config.mjs delete mode 100644 packages/eslint-plugin/src/configs/configFiles.ts diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index fe16634a0217..000000000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -build/ -node_modules/ -**/node_modules/ - -**/ava.config.cjs -maintenance/esbuild-register.js -.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index d045f6f66a92..000000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,206 +0,0 @@ -/* - Note to future self: - - If ESLint is ever extremely slow again, check if there are .js and/or .map files in the source directories - and delete them: - - ```bash - find . -type f -name "*.map" | grep ./packages | grep /src/ | xargs -n1 rm - find . -type f -name "*.js" | grep ./packages | grep /src/ | xargs -n1 rm - ``` - - Running `TIMING=1 DEBUG=eslint:cli-engine yarn run lint:ts` helps detect the problem -*/ - -module.exports = { - root: true, - parser: "@typescript-eslint/parser", // Specifies the ESLint parser - parserOptions: { - ecmaVersion: 2023, // Allows for the parsing of modern ECMAScript features - sourceType: "module", // Allows for the use of imports - project: "./tsconfig.all.json", - tsconfigRootDir: __dirname, - }, - extends: [ - // Use the recommended rules from the @typescript-eslint/eslint-plugin - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - ], - plugins: [ - "deprecation", - "unused-imports", - "unicorn", - "@zwave-js", - ], - reportUnusedDisableDirectives: true, - rules: { - // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - { - functions: false, - typedefs: false, - classes: false, - }, - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - argsIgnorePattern: "^_", - }, - ], - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! - "@typescript-eslint/no-inferrable-types": [ - "error", - { - ignoreProperties: true, - ignoreParameters: true, - }, - ], - "@typescript-eslint/ban-ts-comment": [ - "error", - { - "ts-expect-error": false, - "ts-ignore": true, - "ts-nocheck": true, - "ts-check": false, - }, - ], - "@typescript-eslint/restrict-template-expressions": [ - "error", - { - allowNumber: true, - allowBoolean: true, - // This is necessary to log errors - // TODO: Consider switching to false when we may annotate catch clauses - allowAny: true, - allowNullish: true, - }, - ], - "@typescript-eslint/no-misused-promises": [ - "error", - { - checksVoidReturn: false, - }, - ], - - // Make sure type imports are used where necessary - "@typescript-eslint/consistent-type-imports": [ - "error", - { - fixStyle: "inline-type-imports", - disallowTypeAnnotations: false, - }, - ], - "@typescript-eslint/consistent-type-exports": "error", - - // We can turn this on from time to time but in general these rules - // make our lives harder instead of easier - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-enum-comparison": "off", - "@typescript-eslint/no-unsafe-declaration-merging": "off", - - // Although this rule makes sense, it takes about a second to execute (and we don't need it) - "@typescript-eslint/no-implied-eval": "off", - - "@typescript-eslint/explicit-module-boundary-types": [ - "warn", - { allowArgumentsExplicitlyTypedAsAny: true }, - ], - "@typescript-eslint/no-this-alias": "off", - - // Prefer simple property access and declaration without quotes - "dot-notation": "off", - "@typescript-eslint/dot-notation": [ - "error", - { - allowPrivateClassPropertyAccess: true, - allowProtectedClassPropertyAccess: true, - }, - ], - "quote-props": ["error", "as-needed"], - "deprecation/deprecation": "error", - "unused-imports/no-unused-imports-ts": "error", - "unused-imports/no-unused-imports": "error", - - "unicorn/prefer-array-find": ["error", { checkFromLast: true }], - "unicorn/prefer-array-flat-map": "error", - "unicorn/prefer-array-flat": "error", - "unicorn/prefer-array-index-of": "error", - "unicorn/prefer-array-some": "error", - "unicorn/prefer-at": "error", - "unicorn/prefer-includes": "error", - "unicorn/prefer-logical-operator-over-ternary": "error", - "unicorn/prefer-modern-math-apis": "error", - "unicorn/prefer-negative-index": "error", - "unicorn/prefer-node-protocol": "error", - "unicorn/prefer-regexp-test": "error", - "unicorn/prefer-string-slice": "error", - "unicorn/prefer-string-starts-ends-with": "error", - "unicorn/prefer-string-replace-all": "error", - }, - overrides: [ - { - files: ["*.test.ts", "*.test.ava.ts"], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-member-return": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-floating-promises": "off", - "@typescript-eslint/require-await": "off", - "@typescript-eslint/unbound-method": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/dot-notation": "off", - - "@zwave-js/no-debug-in-tests": "error", - }, - }, - { - files: ["*.js"], - rules: { - "@typescript-eslint/*": "off", - }, - }, - { - files: ["packages/cc/src/**/*CC.ts"], - rules: { - "@zwave-js/ccapi-validate-args": "error", - "@zwave-js/no-internal-cc-types": "error", - }, - }, - { - files: ["packages/cc/src/**"], - rules: { - "@zwave-js/consistent-cc-classes": "error", - }, - }, - { - files: ["packages/**/*.ts"], - rules: { - "@zwave-js/no-forbidden-imports": "error", - }, - }, - { - files: ["packages/config/config/devices/**/*.json"], - parser: "jsonc-eslint-parser", - rules: { - "@zwave-js/consistent-device-configs": "error", - }, - }, - ], -}; diff --git a/.vscode/settings.json b/.vscode/settings.json index 7891d2ea8c57..13d5ce08769d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -44,40 +44,40 @@ "jsonc" ], "files.exclude": { - "node_modules/": true, - "coverage/": true, + "node_modules/": false, + "coverage/": false, ".*": false, - "**/node_modules/": true, - ".nyc_output": true, - "**/coverage/": true, - "**/*.map": true, - "**/zwave-js-*.tgz": true, - "build": true, - "*.d.ts": true, - "*.map": true, - "**/build": true, - "**/*.tsbuildinfo": true, - "packages/zwave-js/**/fingerprint.txt": true, - "node_modules/zwave-js/**/fingerprint.txt": true, - ".husky/_/**/*": true, - "packages/config/config/devices/index.json": true, - "packages/*/package-lock.json": true, - ".yarn/*": true, + "**/node_modules/": false, + ".nyc_output": false, + "**/coverage/": false, + "**/*.map": false, + "**/zwave-js-*.tgz": false, + "build": false, + "*.d.ts": false, + "*.map": false, + "**/build": false, + "**/*.tsbuildinfo": false, + "packages/zwave-js/**/fingerprint.txt": false, + "node_modules/zwave-js/**/fingerprint.txt": false, + ".husky/_/**/*": false, + "packages/config/config/devices/index.json": false, + "packages/*/package-lock.json": false, + ".yarn/*": false, ".yarn/patches": false, ".yarn/releases": false, ".yarn/plugins": false, ".yarn/sdks": false, ".yarn/versions": false, - "**/.pnp.*": true, - "**/*.test.js": true, - "packages/*/cache": true, - "**/.tmp": true, - "**/.tmpoh/": true, - "**/.tmpozw/": true, - "**/.tmpzwa/": true, - "**/.secrets": true, - "**/.test-payloads": true, - "(!test)/cache": true + "**/.pnp.*": false, + "**/*.test.js": false, + "packages/*/cache": false, + "**/.tmp": false, + "**/.tmpoh/": false, + "**/.tmpozw/": false, + "**/.tmpzwa/": false, + "**/.secrets": false, + "**/.test-payloads": false, + "(!test)/cache": false }, "files.associations": { "**/config/**/*.json": "jsonc", diff --git a/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch b/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch new file mode 100644 index 000000000000..24c7c9485c04 --- /dev/null +++ b/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch @@ -0,0 +1,24 @@ +diff --git a/dist/index.js b/dist/index.js +index 924f1d410edf7ad3a217b9542d0455ee0954846e..92113759cd21a17b937c6b18369644a01802a9ae 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -7,6 +7,7 @@ var commaFilter = { filter: (token) => token.value === "," }; + var includeCommentsFilter = { includeComments: true }; + function makePredicate(isImport, addFixer) { + return (problem, context) => { ++ if (!problem.node && !problem.loc) return false; + const sourceCode = context.sourceCode || context.getSourceCode(); + const { parent } = _nullishCoalesce(problem.node, () => ( // typescript-eslint >= 7.8 sets a range instead of a node + sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(problem.loc.start)))); +diff --git a/dist/index.mjs b/dist/index.mjs +index c9d421a8620f17748b9eef51d1480c2ba4a1b541..0752516e7adce3de842127f1a5e06bb0314e73e7 100644 +--- a/dist/index.mjs ++++ b/dist/index.mjs +@@ -3,6 +3,7 @@ var commaFilter = { filter: (token) => token.value === "," }; + var includeCommentsFilter = { includeComments: true }; + function makePredicate(isImport, addFixer) { + return (problem, context) => { ++ if (!problem.node && !problem.loc) return false; + const sourceCode = context.sourceCode || context.getSourceCode(); + const { parent } = problem.node ?? // typescript-eslint >= 7.8 sets a range instead of a node + sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(problem.loc.start)); diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000000..5bd34809479e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,209 @@ +/* + Note to future self: + + If ESLint is ever extremely slow again, check if there are .js and/or .map files in the source directories + and delete them: + + ```bash + find . -type f -name "*.map" | grep ./packages | grep /src/ | xargs -n1 rm + find . -type f -name "*.js" | grep ./packages | grep /src/ | xargs -n1 rm + ``` + + Running `TIMING=1 DEBUG=eslint:cli-engine yarn run lint:ts` helps detect the problem +*/ + +// @ts-check + +import zjs from "@zwave-js/eslint-plugin"; +import unicorn from "eslint-plugin-unicorn"; +import unusedImports from "eslint-plugin-unused-imports"; +import tseslint from "typescript-eslint"; + +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; +const __dirname = dirname(fileURLToPath(import.meta.url)); + +export default tseslint.config( + ...tseslint.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + { + languageOptions: { + parserOptions: { + project: "tsconfig.all.json", + tsconfigRootDir: __dirname, + }, + }, + linterOptions: { + reportUnusedDisableDirectives: true, + }, + plugins: { + "unused-imports": unusedImports, + unicorn, + "@zwave-js": zjs, + }, + rules: { + // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs + "@typescript-eslint/no-parameter-properties": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-use-before-define": [ + "error", + { + functions: false, + typedefs: false, + classes: false, + }, + ], + "@typescript-eslint/no-unused-vars": [ + "error", + { + ignoreRestSiblings: true, + argsIgnorePattern: "^_", + }, + ], + "@typescript-eslint/no-object-literal-type-assertion": "off", + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! + "@typescript-eslint/no-inferrable-types": [ + "error", + { + ignoreProperties: true, + ignoreParameters: true, + }, + ], + "@typescript-eslint/ban-ts-comment": [ + "error", + { + "ts-expect-error": false, + "ts-ignore": true, + "ts-nocheck": true, + "ts-check": false, + }, + ], + "@typescript-eslint/restrict-template-expressions": [ + "error", + { + allowNumber: true, + allowBoolean: true, + // This is necessary to log errors + // TODO: Consider switching to false when we may annotate catch clauses + allowAny: true, + allowNullish: true, + }, + ], + "@typescript-eslint/no-misused-promises": [ + "error", + { + checksVoidReturn: false, + }, + ], + + // Make sure type imports are used where necessary + "@typescript-eslint/consistent-type-imports": [ + "error", + { + fixStyle: "inline-type-imports", + disallowTypeAnnotations: false, + }, + ], + "@typescript-eslint/consistent-type-exports": "error", + + // We can turn this on from time to time but in general these rules + // make our lives harder instead of easier + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-enum-comparison": "off", + "@typescript-eslint/no-unsafe-declaration-merging": "off", + + // Although this rule makes sense, it takes about a second to execute (and we don't need it) + "@typescript-eslint/no-implied-eval": "off", + + "@typescript-eslint/explicit-module-boundary-types": [ + "warn", + { allowArgumentsExplicitlyTypedAsAny: true }, + ], + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/no-deprecated": "error", + + // Prefer simple property access and declaration without quotes + "dot-notation": "off", + "@typescript-eslint/dot-notation": [ + "error", + { + allowPrivateClassPropertyAccess: true, + allowProtectedClassPropertyAccess: true, + }, + ], + "quote-props": ["error", "as-needed"], + + "unused-imports/no-unused-imports": "error", + + "unicorn/prefer-array-find": ["error", { checkFromLast: true }], + "unicorn/prefer-array-flat-map": "error", + "unicorn/prefer-array-flat": "error", + "unicorn/prefer-array-index-of": "error", + "unicorn/prefer-array-some": "error", + "unicorn/prefer-at": "error", + "unicorn/prefer-includes": "error", + "unicorn/prefer-logical-operator-over-ternary": "error", + "unicorn/prefer-modern-math-apis": "error", + "unicorn/prefer-negative-index": "error", + "unicorn/prefer-node-protocol": "error", + "unicorn/prefer-regexp-test": "error", + "unicorn/prefer-string-slice": "error", + "unicorn/prefer-string-starts-ends-with": "error", + "unicorn/prefer-string-replace-all": "error", + }, + }, + // Disable unnecessarily strict rules for test files + { + files: ["**/*.test.ts"], + rules: { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-member-return": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-floating-promises": "off", + "@typescript-eslint/require-await": "off", + "@typescript-eslint/unbound-method": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/dot-notation": "off", + + "@zwave-js/no-debug-in-tests": "error", + }, + }, + // Disable all TS-related rules for JS files + { + files: ["**/*.js"], + rules: { + "@typescript-eslint/*": "off", + }, + }, + // Enable rules from the local plugin for relevant files + { + files: ["packages/cc/src/**/*CC.ts"], + rules: { + "@zwave-js/ccapi-validate-args": "error", + "@zwave-js/no-internal-cc-types": "error", + }, + }, + { + files: ["packages/cc/src/**"], + rules: { + "@zwave-js/consistent-cc-classes": "error", + }, + }, + { + files: ["packages/**/*.ts"], + rules: { + "@zwave-js/no-forbidden-imports": "error", + }, + }, +); diff --git a/package.json b/package.json index 4ab9875ba542..41d03413b8d6 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,6 @@ "@types/semver": "^7.5.8", "@types/source-map-support": "^0.5.10", "@types/xml2js": "^0.4.14", - "@typescript-eslint/eslint-plugin": "^7.13.0", - "@typescript-eslint/parser": "^7.13.0", "@zwave-js/cc": "workspace:*", "@zwave-js/config": "workspace:*", "@zwave-js/core": "workspace:*", @@ -72,10 +70,9 @@ "dprint": "^0.47.2", "esbuild": "0.21.5", "esbuild-register": "^3.5.0", - "eslint": "^8.57.0", - "eslint-plugin-deprecation": "^2.0.0", - "eslint-plugin-unicorn": "^52.0.0", - "eslint-plugin-unused-imports": "^3.2.0", + "eslint": "^9.11.1", + "eslint-plugin-unicorn": "^55.0.0", + "eslint-plugin-unused-imports": "patch:eslint-plugin-unused-imports@npm%3A4.1.4#~/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch", "execa": "^5.1.1", "fs-extra": "^11.2.0", "husky": "^9.1.5", @@ -89,6 +86,7 @@ "ts-patch": "3.2.1", "turbo": "1.13.4", "typescript": "5.5.3", + "typescript-eslint": "^8.7.0", "xml2js": "^0.6.2", "zwave-js": "workspace:*" }, diff --git a/packages/cc/package.json b/packages/cc/package.json index a8f917ba41f2..af0fba1c5216 100644 --- a/packages/cc/package.json +++ b/packages/cc/package.json @@ -59,7 +59,7 @@ "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", "ts": "node -r esbuild-register --conditions=@@dev", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/cc/src/cc/DeviceResetLocallyCC.ts b/packages/cc/src/cc/DeviceResetLocallyCC.ts index a34516fac8c9..8a028fa9e3c7 100644 --- a/packages/cc/src/cc/DeviceResetLocallyCC.ts +++ b/packages/cc/src/cc/DeviceResetLocallyCC.ts @@ -57,7 +57,7 @@ export class DeviceResetLocallyCCAPI extends CCAPI { // We don't want failures causing us to treat the node as asleep or dead changeNodeStatusOnMissingACK: false, }); - } catch (e) { + } catch { // Don't care } } diff --git a/packages/cc/src/cc/Security2CC.ts b/packages/cc/src/cc/Security2CC.ts index 854b22f71c19..f8b460c4097f 100644 --- a/packages/cc/src/cc/Security2CC.ts +++ b/packages/cc/src/cc/Security2CC.ts @@ -1002,11 +1002,11 @@ function testCCResponseForMessageEncapsulation( } function failNoSPAN(): never { - throw validatePayload.fail(ZWaveErrorCodes.Security2CC_NoSPAN); + validatePayload.fail(ZWaveErrorCodes.Security2CC_NoSPAN); } function failNoMPAN(): never { - throw validatePayload.fail(ZWaveErrorCodes.Security2CC_NoMPAN); + validatePayload.fail(ZWaveErrorCodes.Security2CC_NoMPAN); } // @publicAPI @@ -1134,7 +1134,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { || options.frameType === "broadcast" ) { if (multicastGroupId == undefined) { - throw validatePayload.fail( + validatePayload.fail( "Multicast frames without MGRP extension", ); } @@ -1158,7 +1158,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { } else { this.securityManager.nextNonce(sendingNodeId); } - throw validatePayload.fail( + validatePayload.fail( "Invalid S2 extension", ); } @@ -1217,7 +1217,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { ctx.groupId, { type: MPANState.OutOfSync }, ); - throw failNoMPAN(); + failNoMPAN(); } decrypt = () => @@ -1236,11 +1236,11 @@ export class Security2CCMessageEncapsulation extends Security2CC { // If we are not able to establish an SPAN yet, fail the decryption if (spanState.type === SPANState.None) { - throw failNoSPAN(); + failNoSPAN(); } else if (spanState.type === SPANState.RemoteEI) { // TODO: The specs are not clear how to handle this case // For now, do the same as if we didn't have any EI - throw failNoSPAN(); + failNoSPAN(); } decrypt = () => @@ -1296,11 +1296,11 @@ export class Security2CCMessageEncapsulation extends Security2CC { ctx.groupId, { type: MPANState.OutOfSync }, ); - throw validatePayload.fail( + validatePayload.fail( ZWaveErrorCodes.Security2CC_CannotDecodeMulticast, ); } else { - throw validatePayload.fail( + validatePayload.fail( ZWaveErrorCodes.Security2CC_CannotDecode, ); } @@ -1320,7 +1320,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { // Before we can continue, check if the command must be discarded if (mustDiscardCommand) { - throw validatePayload.fail("Invalid extension"); + validatePayload.fail("Invalid extension"); } // If the MPAN extension was received, store the MPAN @@ -1782,7 +1782,7 @@ export class Security2CCMessageEncapsulation extends Security2CC { // We've sent the other our receiver's EI and received its sender's EI, // meaning we can now establish an SPAN const senderEI = this.getSenderEI(); - if (!senderEI) throw failNoSPAN(); + if (!senderEI) failNoSPAN(); const receiverEI = spanState.receiverEI; // How we do this depends on whether we know the security class of the other node diff --git a/packages/cc/src/cc/ZWaveProtocolCC.ts b/packages/cc/src/cc/ZWaveProtocolCC.ts index dc697ae572c2..12d48da99957 100644 --- a/packages/cc/src/cc/ZWaveProtocolCC.ts +++ b/packages/cc/src/cc/ZWaveProtocolCC.ts @@ -207,7 +207,7 @@ export class ZWaveProtocolCCFindNodesInRange extends ZWaveProtocolCC { this.wakeUpTime = parseWakeUpTime(rest[0]); this.dataRate = rest[1] & 0b111; } else { - throw validatePayload.fail("Invalid payload length"); + validatePayload.fail("Invalid payload length"); } } else if (rest.length >= 1) { this.wakeUpTime = parseWakeUpTime(rest[0]); @@ -1001,7 +1001,7 @@ export class ZWaveProtocolCCNOPPower extends ZWaveProtocolCC { ].indexOf(this.payload[0]); if (this.powerDampening === -1) this.powerDampening = 0; } else { - throw validatePayload.fail("Invalid payload length!"); + validatePayload.fail("Invalid payload length!"); } } else { if (options.powerDampening < 0 || options.powerDampening > 14) { diff --git a/packages/cc/src/lib/Values.ts b/packages/cc/src/lib/Values.ts index 9b38ca8cd2fe..857eb4ad9073 100644 --- a/packages/cc/src/lib/Values.ts +++ b/packages/cc/src/lib/Values.ts @@ -399,7 +399,7 @@ export const V = { property: TProp, is: PartialCCValuePredicate, meta?: TMeta, - options?: TOptions | undefined, + options?: TOptions, ): { [K in TName]: { (...args: InferArgs<[TProp, TMeta]>): { @@ -434,7 +434,7 @@ export const V = { propertyKey: TKey, is: PartialCCValuePredicate, meta?: TMeta, - options?: TOptions | undefined, + options?: TOptions, ): { [K in TName]: { (...args: InferArgs<[TProp, TKey, TMeta]>): { diff --git a/packages/cc/src/lib/utils.ts b/packages/cc/src/lib/utils.ts index a95baddef20f..3ed1b4ada4a6 100644 --- a/packages/cc/src/lib/utils.ts +++ b/packages/cc/src/lib/utils.ts @@ -70,11 +70,11 @@ export function getAssociations( // Eliminate potential duplicates ...assocs.filter( (a1) => - normalAssociations.findIndex( + !normalAssociations.some( (a2) => a1.nodeId === a2.nodeId && a1.endpoint === a2.endpoint, - ) === -1, + ), ), ]); } else { diff --git a/packages/config/config/.eslintrc.js b/packages/config/config/.eslintrc.js deleted file mode 100644 index 38b0b3138cbb..000000000000 --- a/packages/config/config/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Custom ESLint rules for device config files - */ - -module.exports = { - root: true, - parser: "jsonc-eslint-parser", - plugins: [ - "@zwave-js", - ], - extends: "plugin:@zwave-js/config-files" -}; diff --git a/packages/config/config/eslint.config.mjs b/packages/config/config/eslint.config.mjs new file mode 100644 index 000000000000..3129255e7053 --- /dev/null +++ b/packages/config/config/eslint.config.mjs @@ -0,0 +1,47 @@ +/* + Note to future self: + + If ESLint is ever extremely slow again, check if there are .js and/or .map files in the source directories + and delete them: + + ```bash + find . -type f -name "*.map" | grep ./packages | grep /src/ | xargs -n1 rm + find . -type f -name "*.js" | grep ./packages | grep /src/ | xargs -n1 rm + ``` + + Running `TIMING=1 DEBUG=eslint:cli-engine yarn run lint:ts` helps detect the problem +*/ + +// @ts-check + +import zjs from "@zwave-js/eslint-plugin"; +import jsonc from "jsonc-eslint-parser"; +import { dirname, join, relative } from "node:path"; +import { fileURLToPath } from "node:url"; + +// Figure out the files glob depending on where ESLint is executed from +const __dirname = dirname(fileURLToPath(import.meta.url)); +const rel = relative(process.cwd(), __dirname); +const glob = join(rel, "devices/**/*.json"); + +export default { + files: [glob], + plugins: { + "@zwave-js": zjs, + }, + languageOptions: { + parser: jsonc, + }, + rules: { + "@zwave-js/auto-unsigned": "error", + "@zwave-js/consistent-config-string-case": "error", + "@zwave-js/consistent-device-config-property-order": "error", + "@zwave-js/consistent-param-units": "error", + "@zwave-js/no-misspelled-names": "error", + "@zwave-js/no-surrounding-whitespace": "error", + "@zwave-js/no-unnecessary-min-max-value": "error", + "@zwave-js/no-useless-description": "error", + "@zwave-js/no-value-in-option-label": "error", + "@zwave-js/prefer-defaultvalue": "error", + }, +}; diff --git a/packages/config/package.json b/packages/config/package.json index b1209a07013d..09d6abb796f5 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -48,9 +48,9 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:zwave": "yarn ts maintenance/lintConfigFiles.ts && eslint --cache --cache-location .eslintcache/config --ext .json \"config/devices/**/*.json\"", + "lint:zwave": "yarn ts maintenance/lintConfigFiles.ts && eslint --cache --cache-location .eslintcache/config -c config/eslint.config.mjs", "ts": "node -r esbuild-register --conditions=@@dev", - "lint:ts": "eslint --cache --cache-location .eslintcache/ts --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache --cache-location .eslintcache/ts \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/config/src/ConfigManager.test.ts b/packages/config/src/ConfigManager.test.ts index 84199edc843d..5cee553b93b3 100644 --- a/packages/config/src/ConfigManager.test.ts +++ b/packages/config/src/ConfigManager.test.ts @@ -16,7 +16,7 @@ interface TestContext { const test = ava as TestFn; -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const ownVersion = require("../package.json").version; test.before(async (t) => { diff --git a/packages/config/src/ConfigManager.ts b/packages/config/src/ConfigManager.ts index 6042073cdab1..023e6afd0a56 100644 --- a/packages/config/src/ConfigManager.ts +++ b/packages/config/src/ConfigManager.ts @@ -43,7 +43,7 @@ export class ConfigManager { ); this.deviceConfigPriorityDir = options.deviceConfigPriorityDir; this._configVersion = - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports require("@zwave-js/config/package.json").version; } diff --git a/packages/config/src/devices/ConditionalItem.ts b/packages/config/src/devices/ConditionalItem.ts index 5462138b39a5..dc4ad601e535 100644 --- a/packages/config/src/devices/ConditionalItem.ts +++ b/packages/config/src/devices/ConditionalItem.ts @@ -38,7 +38,7 @@ export function conditionApplies( try { return !!evaluate(self.condition, deviceId); - } catch (e) { + } catch { throw new ZWaveError( `Invalid condition "${self.condition}"!`, ZWaveErrorCodes.Config_Invalid, diff --git a/packages/config/src/devices/ParamInformation.ts b/packages/config/src/devices/ParamInformation.ts index 2737c9372fa5..7d26dc676d08 100644 --- a/packages/config/src/devices/ParamInformation.ts +++ b/packages/config/src/devices/ParamInformation.ts @@ -232,7 +232,7 @@ Parameter #${parameterNumber}: options is malformed!`, if (ret.allowManualEntry === false && ret.options.length > 0) { ret.minValue = Math.min(...ret.options.map((o) => o.value)); } else { - throw throwInvalidConfig( + throwInvalidConfig( "devices", `packages/config/config/devices/${this.parent.filename}: Parameter #${this.parameterNumber} is missing required property "minValue"!`, @@ -243,7 +243,7 @@ Parameter #${this.parameterNumber} is missing required property "minValue"!`, if (ret.allowManualEntry === false && ret.options.length > 0) { ret.maxValue = Math.max(...ret.options.map((o) => o.value)); } else { - throw throwInvalidConfig( + throwInvalidConfig( "devices", `packages/config/config/devices/${this.parent.filename}: Parameter #${this.parameterNumber} is missing required property "maxValue"!`, diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 42b755dee6ee..5e79f82c4f3c 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export * from "./ConfigManager"; export * from "./Logger_safe"; export * from "./Manufacturers"; diff --git a/packages/core/core.api.md b/packages/core/core.api.md index c601343cf2ac..9d40ade80ce2 100644 --- a/packages/core/core.api.md +++ b/packages/core/core.api.md @@ -633,12 +633,12 @@ export function createLogMessagePrinter(shortTimestamps: boolean): Format; // Warning: (ae-missing-release-tag) "createReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export function createReflectionDecorator = Constructor>({ name, valueFromArgs, constructorLookupKey, }: CreateReflectionDecoratorOptions): ReflectionDecorator; +export function createReflectionDecorator = Constructor>({ name, valueFromArgs, constructorLookupKey, }: CreateReflectionDecoratorOptions): ReflectionDecorator; // Warning: (ae-missing-release-tag) "CreateReflectionDecoratorOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export interface CreateReflectionDecoratorOptions = Constructor> { +export interface CreateReflectionDecoratorOptions = Constructor> { constructorLookupKey?: false | ((target: TConstructor, ...args: TArgs) => string); name: string; valueFromArgs: (...args: TArgs) => TValue; @@ -647,7 +647,7 @@ export interface CreateReflectionDecoratorOptions = Constructor>({ superName, subName, }: CreateReflectionDecoratorPairOptions): ReflectionDecoratorPair; +export function createReflectionDecoratorPair = Constructor>({ superName, subName, }: CreateReflectionDecoratorPairOptions): ReflectionDecoratorPair; // Warning: (ae-missing-release-tag) "CreateReflectionDecoratorPairOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -660,7 +660,7 @@ export interface CreateReflectionDecoratorPairOptions { // Warning: (ae-missing-release-tag) "createSimpleReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export function createSimpleReflectionDecorator = Constructor>({ name, }: CreateSimpleReflectionDecoratorOptions): SimpleReflectionDecorator; +export function createSimpleReflectionDecorator = Constructor>({ name, }: CreateSimpleReflectionDecoratorOptions): SimpleReflectionDecorator; // Warning: (ae-missing-release-tag) "CreateSimpleReflectionDecoratorOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -672,7 +672,7 @@ export interface CreateSimpleReflectionDecoratorOptions { // Warning: (ae-missing-release-tag) "createValuelessReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public -export function createValuelessReflectionDecorator({ name, }: CreateValuelessReflectionDecoratorOptions): ValuelessReflectionDecorator; +export function createValuelessReflectionDecorator({ name, }: CreateValuelessReflectionDecoratorOptions): ValuelessReflectionDecorator; // Warning: (ae-missing-release-tag) "CreateValuelessReflectionDecoratorOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -2822,7 +2822,7 @@ export type QRProvisioningInformation = { // Warning: (ae-missing-release-tag) "ReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export interface ReflectionDecorator = Constructor> { +export interface ReflectionDecorator = Constructor> { decorator: (...args: TArgs) => TypedClassDecorator; lookupConstructorByKey: (key: string) => TConstructor | undefined; lookupConstructorByValue: (value: TValue) => TConstructor | undefined; @@ -2833,7 +2833,7 @@ export interface ReflectionDecorator = Constructor> { +export interface ReflectionDecoratorPair = Constructor> { lookupSubConstructor: (...args: [...TSuperArgs, ...TSubArgs]) => TConstructor | undefined; lookupSubValue: (target: TBase) => TSubArgs[0] | undefined; lookupSubValueStatic: (constr: Function) => TSubArgs[0] | undefined; @@ -3259,7 +3259,7 @@ export interface SetValueOptions { // Warning: (ae-missing-release-tag) "SimpleReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export interface SimpleReflectionDecorator = Constructor> { +export interface SimpleReflectionDecorator = Constructor> { decorator: (...args: TArgs) => TypedClassDecorator; lookupConstructor: (...args: TArgs) => TConstructor | undefined; lookupValue: (target: TBase) => TArgs[0] | undefined; @@ -3654,7 +3654,7 @@ export function valueIdToString(valueID: ValueID): string; // Warning: (ae-missing-release-tag) "ValuelessReflectionDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export interface ValuelessReflectionDecorator { +export interface ValuelessReflectionDecorator { decorator: () => TypedClassDecorator; isDecorated: (target: TBase) => boolean; isDecoratedStatic: (constr: Function) => boolean; diff --git a/packages/core/package.json b/packages/core/package.json index 32d2a025921b..b94afb4a1b10 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,7 +51,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 0bc3b4d6875d..6afee8722c97 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export * from "./abstractions/ICommandClass"; export * from "./abstractions/IZWaveEndpoint"; export * from "./abstractions/IZWaveNode"; diff --git a/packages/core/src/index_safe.ts b/packages/core/src/index_safe.ts index 1a846539f8a6..c241edf8958f 100644 --- a/packages/core/src/index_safe.ts +++ b/packages/core/src/index_safe.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ /* @forbiddenImports external */ export * from "./abstractions/ICommandClass"; diff --git a/packages/core/src/security/Manager.test.ts b/packages/core/src/security/Manager.test.ts index 1c314c8f390f..f376635e20be 100644 --- a/packages/core/src/security/Manager.test.ts +++ b/packages/core/src/security/Manager.test.ts @@ -76,7 +76,7 @@ test("generateNonce() -> should ensure that no collisions happen", (t) => { .returns(buf2); sinon.replace(crypto, "randomBytes", fakeRandomBytes); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const SM: typeof SecurityManager = require("./Manager").SecurityManager; const man = new SM(options); diff --git a/packages/core/src/security/crypto.ts b/packages/core/src/security/crypto.ts index c9df18dee227..d03bb98852ba 100644 --- a/packages/core/src/security/crypto.ts +++ b/packages/core/src/security/crypto.ts @@ -344,7 +344,7 @@ export function decryptAES128CCM( try { decipher.final(); authOK = true; - } catch (e) { + } catch { /* nothing to do */ } return { plaintext, authOK }; diff --git a/packages/core/src/util/decorators.ts b/packages/core/src/util/decorators.ts index b26b31620b6e..c4a56cb9bb40 100644 --- a/packages/core/src/util/decorators.ts +++ b/packages/core/src/util/decorators.ts @@ -1,11 +1,11 @@ +/* eslint-disable @typescript-eslint/no-unsafe-function-type */ import type { TypedClassDecorator } from "@zwave-js/shared"; import "reflect-metadata"; type Constructor = new (...args: any[]) => T; export interface ReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TArgs extends any[], TValue, TConstructor extends Constructor = Constructor, @@ -17,7 +17,6 @@ export interface ReflectionDecorator< /** Looks up the value which was assigned to the target class by the decorator, using a class instance */ lookupValue: (target: TBase) => TValue | undefined; /** Looks up the value which was assigned to the target class by the decorator, using the class itself */ - // eslint-disable-next-line @typescript-eslint/ban-types lookupValueStatic: (constr: Function) => TValue | undefined; /** Looks up the class constructor for a given value. This can only be used if the value does not need to be transformed using `constructorLookupKey`. */ lookupConstructorByValue: (value: TValue) => TConstructor | undefined; @@ -26,8 +25,7 @@ export interface ReflectionDecorator< } export interface CreateReflectionDecoratorOptions< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TArgs extends any[], TValue, TConstructor extends Constructor = Constructor, @@ -47,8 +45,7 @@ export interface CreateReflectionDecoratorOptions< /** Creates a reflection decorator and corresponding methods for reverse lookup of values and constructors */ export function createReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TArgs extends any[], TValue, TConstructor extends Constructor = Constructor, @@ -147,8 +144,7 @@ export function createReflectionDecorator< } export interface SimpleReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TArgs extends [any], TConstructor extends Constructor = Constructor, > { @@ -161,7 +157,6 @@ export interface SimpleReflectionDecorator< lookupValue: (target: TBase) => TArgs[0] | undefined; /** Looks up the value which was assigned to the target class by the decorator, using the class itself */ - // eslint-disable-next-line @typescript-eslint/ban-types lookupValueStatic: (constr: Function) => TArgs[0] | undefined; /** Looks up the super class constructor for a given value. */ @@ -177,8 +172,7 @@ export interface CreateSimpleReflectionDecoratorOptions { * Like {@link createReflectionDecorator}, but for single-value decorators. This has the advantage that the returned functions can be reused easier with named args. */ export function createSimpleReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TArgs extends [any], TConstructor extends Constructor = Constructor, >({ @@ -209,8 +203,7 @@ export function createSimpleReflectionDecorator< } export interface ValuelessReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, > { /** The decorator which is used to decorate the super class */ decorator: () => TypedClassDecorator; @@ -219,7 +212,6 @@ export interface ValuelessReflectionDecorator< isDecorated: (target: TBase) => boolean; /** Checks if the target class was decorated by this decorator, using the class itself */ - // eslint-disable-next-line @typescript-eslint/ban-types isDecoratedStatic: (constr: Function) => boolean; } @@ -232,8 +224,7 @@ export interface CreateValuelessReflectionDecoratorOptions { * Like {@link createReflectionDecorator}, but for valueless decorators. */ export function createValuelessReflectionDecorator< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, >({ name, }: CreateValuelessReflectionDecoratorOptions): ValuelessReflectionDecorator< @@ -247,7 +238,6 @@ export function createValuelessReflectionDecorator< const ret: ValuelessReflectionDecorator = { decorator: decorator.decorator, isDecorated: (target: TBase) => !!decorator.lookupValue(target), - // eslint-disable-next-line @typescript-eslint/ban-types isDecoratedStatic: (constr: Function) => !!decorator.lookupValueStatic(constr), }; @@ -256,8 +246,7 @@ export function createValuelessReflectionDecorator< } export interface ReflectionDecoratorPair< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TSuperArgs extends [any], TSubArgs extends [any], TConstructor extends Constructor = Constructor, @@ -278,10 +267,8 @@ export interface ReflectionDecoratorPair< lookupSubValue: (target: TBase) => TSubArgs[0] | undefined; /** Looks up the value which was assigned to the target super class by the decorator, using the class itself */ - // eslint-disable-next-line @typescript-eslint/ban-types lookupSuperValueStatic: (constr: Function) => TSuperArgs[0] | undefined; /** Looks up the value which was assigned to the target sub class by the decorator, using the class itself */ - // eslint-disable-next-line @typescript-eslint/ban-types lookupSubValueStatic: (constr: Function) => TSubArgs[0] | undefined; /** Looks up the super class constructor for a given value. */ @@ -304,8 +291,7 @@ export interface CreateReflectionDecoratorPairOptions { * This pair is meant to decorate a super class and several of its subclasses */ export function createReflectionDecoratorPair< - // eslint-disable-next-line @typescript-eslint/ban-types - TBase extends Object, + TBase extends object, TSuperArgs extends [any], TSubArgs extends [any], TConstructor extends Constructor = Constructor, @@ -370,8 +356,7 @@ export function createReflectionDecoratorPair< } // export interface PropertyReflectionDecorator< -// // eslint-disable-next-line @typescript-eslint/ban-types -// TTarget extends Object, +// // TTarget extends object, // TArgs extends any[], // TValue, // > { @@ -393,8 +378,7 @@ export function createReflectionDecoratorPair< // /** Creates a reflection decorator for a class property and the corresponding method for reverse lookup of defined values */ // export function createPropertyReflectionDecorator< -// // eslint-disable-next-line @typescript-eslint/ban-types -// TTarget extends Object, +// // TTarget extends object, // TArgs extends any[], // TValue, // >({ diff --git a/packages/core/src/util/misc.ts b/packages/core/src/util/misc.ts index 48712026f0db..a369fe9ef3de 100644 --- a/packages/core/src/util/misc.ts +++ b/packages/core/src/util/misc.ts @@ -48,7 +48,7 @@ function validatePayloadInternal( } // Export and augment the validatePayload method with a reason -export const validatePayload = validatePayloadInternal.bind( +export const validatePayload: ValidatePayload = validatePayloadInternal.bind( undefined, undefined, ) as ValidatePayload; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 03205b2a5904..82518f34a319 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -4,7 +4,9 @@ "description": "zwave-js: custom ESLint rules", "private": true, "keywords": [], + "type": "module", "main": "build/index.js", + "module": "build/index.js", "files": [ "build/**/*.js" ], @@ -31,14 +33,16 @@ "build": "tsc -b tsconfig.build.json --pretty", "bootstrap": "yarn build", "clean": "del-cli build/ \"*.tsbuildinfo\"", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" }, "devDependencies": { - "@types/eslint": "^8.56.7", - "@typescript-eslint/utils": "^7.13.0", + "@types/eslint": "^9.6.1", + "@typescript-eslint/utils": "^8.7.0", "@zwave-js/core": "workspace:*", - "eslint": "^8.57.0", + "eslint": "^9.11.1", + "eslint-compat-utils": "^0.5.1", + "eslint-plugin-jsonc": "^2.16.0", "typescript": "5.5.3" } } diff --git a/packages/eslint-plugin/src/configs/configFiles.ts b/packages/eslint-plugin/src/configs/configFiles.ts deleted file mode 100644 index d9aa048a5960..000000000000 --- a/packages/eslint-plugin/src/configs/configFiles.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { type ESLint } from "eslint"; - -export const configFiles: ESLint.ConfigData = { - parser: "jsonc-eslint-parser", - plugins: [ - "@zwave-js", - ], - rules: { - "@zwave-js/auto-unsigned": "error", - "@zwave-js/consistent-config-string-case": "error", - "@zwave-js/consistent-device-config-property-order": "error", - "@zwave-js/consistent-param-units": "error", - "@zwave-js/no-misspelled-names": "error", - "@zwave-js/no-surrounding-whitespace": "error", - "@zwave-js/no-unnecessary-min-max-value": "error", - "@zwave-js/no-useless-description": "error", - "@zwave-js/no-value-in-option-label": "error", - "@zwave-js/prefer-defaultvalue": "error", - }, -}; diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index 1a4bf1c4634f..394bea336b54 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -6,6 +6,7 @@ import { consistentDeviceConfigPropertyOrder } from "./rules/consistent-device-c import { consistentParamUnits } from "./rules/consistent-param-units.js"; import { noDebugInTests } from "./rules/no-debug-in-tests.js"; import { noForbiddenImports } from "./rules/no-forbidden-imports.js"; +import { noInternalCCTypes } from "./rules/no-internal-cc-types.js"; import { noMisspelledNames } from "./rules/no-misspelled-names.js"; import { noSurroundingWhitespace } from "./rules/no-surrounding-whitespace.js"; import { noUnnecessaryMinMaxValue } from "./rules/no-unnecessary-min-max-value.js"; @@ -13,10 +14,7 @@ import { noUselessDescription } from "./rules/no-useless-description.js"; import { noValueInOptionLabel } from "./rules/no-value-in-option-label.js"; import { preferDefaultValue } from "./rules/prefer-defaultvalue.js"; -import { configFiles as configFilesConfig } from "./configs/configFiles.js"; -import { noInternalCCTypes } from "./rules/no-internal-cc-types.js"; - -module.exports = { +export default { rules: { "auto-unsigned": autoUnsigned, "ccapi-validate-args": ccAPIValidateArgs, @@ -35,7 +33,4 @@ module.exports = { "prefer-defaultvalue": preferDefaultValue, "no-internal-cc-types": noInternalCCTypes, }, - configs: { - "config-files": configFilesConfig, - }, }; diff --git a/packages/eslint-plugin/src/rules/auto-unsigned.ts b/packages/eslint-plugin/src/rules/auto-unsigned.ts index 689b35932d41..d186497d1a3b 100644 --- a/packages/eslint-plugin/src/rules/auto-unsigned.ts +++ b/packages/eslint-plugin/src/rules/auto-unsigned.ts @@ -9,13 +9,13 @@ import { insertBeforeJSONProperty, paramInfoPropertyOrder, removeJSONProperty, -} from "../utils"; +} from "../utils.js"; export const autoUnsigned: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } function suggestUnsigned( parent: AST.JSONObjectExpression, @@ -256,13 +256,14 @@ export const autoUnsigned: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Ensures that "unsigned = true" is used when necessary and omitted when not.`, }, fixable: "code", hasSuggestions: true, - schema: [], + schema: false, messages: { "invalid-value-size": "Value size {{valueSize}} is invalid!", "incompatible-size": diff --git a/packages/eslint-plugin/src/rules/ccapi-validate-args.ts b/packages/eslint-plugin/src/rules/ccapi-validate-args.ts index e3a9e0414891..3e37935947f6 100644 --- a/packages/eslint-plugin/src/rules/ccapi-validate-args.ts +++ b/packages/eslint-plugin/src/rules/ccapi-validate-args.ts @@ -4,14 +4,13 @@ import { ESLintUtils, } from "@typescript-eslint/utils"; import { - type Rule, findDecoratorContainingCCId, getCCNameFromDecorator, -} from "../utils"; +} from "../utils.js"; const isFixMode = process.argv.some((arg) => arg.startsWith("--fix")); -export const ccAPIValidateArgs: Rule = ESLintUtils.RuleCreator.withoutDocs({ +export const ccAPIValidateArgs = ESLintUtils.RuleCreator.withoutDocs({ create(context) { let currentAPIClassCCName: string | undefined; let validateArgsImport: string | undefined; diff --git a/packages/eslint-plugin/src/rules/consistent-cc-classes.ts b/packages/eslint-plugin/src/rules/consistent-cc-classes.ts index e4b889b73f70..2db8230635ae 100644 --- a/packages/eslint-plugin/src/rules/consistent-cc-classes.ts +++ b/packages/eslint-plugin/src/rules/consistent-cc-classes.ts @@ -11,7 +11,7 @@ import { findDecoratorContainingCCId, getCCIdFromDecorator, getCCIdFromExpression, -} from "../utils"; +} from "../utils.js"; const apiBaseClasses = new Set(["CCAPI", "PhysicalCCAPI"]); diff --git a/packages/eslint-plugin/src/rules/consistent-config-string-case.ts b/packages/eslint-plugin/src/rules/consistent-config-string-case.ts index 6cce4f82faae..bc0064199fee 100644 --- a/packages/eslint-plugin/src/rules/consistent-config-string-case.ts +++ b/packages/eslint-plugin/src/rules/consistent-config-string-case.ts @@ -1,20 +1,20 @@ import { type AST } from "jsonc-eslint-parser"; -import { CONFIG_OPTION, CONFIG_PARAM, ROOT } from "../jsonSelectors"; +import { CONFIG_OPTION, CONFIG_PARAM, ROOT } from "../jsonSelectors.js"; import { type JSONCRule, insertAfterJSONProperty, insertBeforeJSONProperty, -} from "../utils"; -import { toSentenceCase, toTitleCase } from "../utils/titleAndSentenceCase"; +} from "../utils.js"; +import { toSentenceCase, toTitleCase } from "../utils/titleAndSentenceCase.js"; // TODO: Avoid Enable/Disable in param labels // remove Z-Wave and all its variants export const consistentConfigStringCase: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Enforce title case for device descriptions @@ -143,13 +143,14 @@ export const consistentConfigStringCase: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Ensures that the casing of labels in configuration files follows the style guide`, }, fixable: "code", hasSuggestions: true, - schema: [], + schema: false, messages: { "must-be-title-case": "{{what}} must be in Title Case", "must-be-sentence-case": "{{what}} must be in Sentence case", diff --git a/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts b/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts index e712034e4400..b36f21d0ba0f 100644 --- a/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts +++ b/packages/eslint-plugin/src/rules/consistent-device-config-property-order.ts @@ -1,12 +1,12 @@ import { type AST as ESLintAST } from "eslint"; import type { AST } from "jsonc-eslint-parser"; -import { type JSONCRule, paramInfoPropertyOrder } from "../utils"; +import { type JSONCRule, paramInfoPropertyOrder } from "../utils.js"; export const consistentDeviceConfigPropertyOrder: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Ensure consistent ordering of properties in configuration parameters "JSONProperty[key.value='paramInformation'] > JSONArrayExpression > JSONObjectExpression"( @@ -29,9 +29,14 @@ export const consistentDeviceConfigPropertyOrder: JSONCRule.RuleModule = { if (isSomePropertyOutOfOrder) { const propsWithComments = properties.map(([index, p]) => { - const comments = context.sourceCode.getComments( - p as any, - ); + const comments = { + leading: context.sourceCode.getCommentsBefore( + p as any, + ), + trailing: context.sourceCode.getCommentsAfter( + p as any, + ), + }; return { index, property: p, @@ -153,12 +158,13 @@ export const consistentDeviceConfigPropertyOrder: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: "Ensures consistent ordering of properties in configuration parameter definitions", }, fixable: "code", - schema: [], + schema: false, messages: { "parameter-ordering": `For consistency, config param properties should follow the order ${ diff --git a/packages/eslint-plugin/src/rules/consistent-param-units.ts b/packages/eslint-plugin/src/rules/consistent-param-units.ts index 4cc95add12ee..821b42bcc8db 100644 --- a/packages/eslint-plugin/src/rules/consistent-param-units.ts +++ b/packages/eslint-plugin/src/rules/consistent-param-units.ts @@ -1,6 +1,6 @@ import type { AST } from "jsonc-eslint-parser"; -import { CONFIG_PARAM } from "../jsonSelectors"; -import { type JSONCRule } from "../utils"; +import { CONFIG_PARAM } from "../jsonSelectors.js"; +import { type JSONCRule } from "../utils.js"; interface FixableUnit { wrong: string[]; @@ -34,9 +34,9 @@ fixableUnits.forEach(({ correct }) => export const consistentParamUnits: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Ensure consistent ordering of properties in configuration parameters [`${CONFIG_PARAM} > JSONProperty[key.value='unit']`]( @@ -82,12 +82,13 @@ export const consistentParamUnits: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: "Ensures that no forbidden units are used in config parameters.", }, fixable: "code", - schema: [], + schema: false, messages: { "forbidden-unit": `The unit "{{unit}}" is not allowed. Use "{{correct}}" instead.`, diff --git a/packages/eslint-plugin/src/rules/no-debug-in-tests.ts b/packages/eslint-plugin/src/rules/no-debug-in-tests.ts index 3079cdd2d23b..ea0b7578fc20 100644 --- a/packages/eslint-plugin/src/rules/no-debug-in-tests.ts +++ b/packages/eslint-plugin/src/rules/no-debug-in-tests.ts @@ -1,6 +1,6 @@ import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils"; import path from "node:path"; -import { type Rule, repoRoot } from "../utils.js"; +import { repoRoot } from "../utils.js"; const isFixMode = process.argv.some((arg) => arg.startsWith("--fix")); @@ -20,7 +20,7 @@ const integrationTestExportNames = new Set([ "integrationTest", ]); -export const noDebugInTests: Rule = ESLintUtils.RuleCreator.withoutDocs({ +export const noDebugInTests = ESLintUtils.RuleCreator.withoutDocs({ create(context) { const integrationTestMethodNames = new Set(); diff --git a/packages/eslint-plugin/src/rules/no-forbidden-imports.ts b/packages/eslint-plugin/src/rules/no-forbidden-imports.ts index b5d659edd169..36c64dab8144 100644 --- a/packages/eslint-plugin/src/rules/no-forbidden-imports.ts +++ b/packages/eslint-plugin/src/rules/no-forbidden-imports.ts @@ -2,7 +2,6 @@ import { ESLintUtils, type TSESTree } from "@typescript-eslint/utils"; import fs from "node:fs"; import path from "node:path"; import ts from "typescript"; -import { type Rule } from "../utils"; // Whitelist some imports that are known not to import forbidden modules const whitelistedImports = [ @@ -186,7 +185,7 @@ function resolveSourceFileFromDefinition( const forbiddenImportsRegex = /^@forbiddenImports (?.*?)$/; -export const noForbiddenImports: Rule = ESLintUtils.RuleCreator.withoutDocs({ +export const noForbiddenImports = ESLintUtils.RuleCreator.withoutDocs({ create(context) { // And only those with at least one /* @forbiddenImports ... */ comment const comments = context.sourceCode.getAllComments() diff --git a/packages/eslint-plugin/src/rules/no-internal-cc-types.ts b/packages/eslint-plugin/src/rules/no-internal-cc-types.ts index f11840c74799..0a148b853903 100644 --- a/packages/eslint-plugin/src/rules/no-internal-cc-types.ts +++ b/packages/eslint-plugin/src/rules/no-internal-cc-types.ts @@ -4,11 +4,10 @@ import { ESLintUtils, type TSESTree, } from "@typescript-eslint/utils"; -import { type Rule } from "../utils"; // const isFixMode = process.argv.some((arg) => arg.startsWith("--fix")); -export const noInternalCCTypes: Rule = ESLintUtils.RuleCreator.withoutDocs({ +export const noInternalCCTypes = ESLintUtils.RuleCreator.withoutDocs({ create(context) { const localTypeNodes = new Map< string, diff --git a/packages/eslint-plugin/src/rules/no-misspelled-names.ts b/packages/eslint-plugin/src/rules/no-misspelled-names.ts index 8446e3f98861..fd4846a53ea8 100644 --- a/packages/eslint-plugin/src/rules/no-misspelled-names.ts +++ b/packages/eslint-plugin/src/rules/no-misspelled-names.ts @@ -1,5 +1,5 @@ import { type AST } from "jsonc-eslint-parser"; -import { type JSONCRule } from "../utils"; +import { type JSONCRule } from "../utils.js"; interface CommonError { pattern: string | RegExp; @@ -25,9 +25,9 @@ function fixCommonErrors(str: string): string { export const noMisspelledNames: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Fix some common misspellings in labels and descriptions @@ -54,12 +54,13 @@ export const noMisspelledNames: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Prevents some common misspellings in labels and descriptions`, }, fixable: "code", - schema: [], + schema: false, messages: { "change-to-fixed": `Change to "{{fixed}}"`, }, diff --git a/packages/eslint-plugin/src/rules/no-surrounding-whitespace.ts b/packages/eslint-plugin/src/rules/no-surrounding-whitespace.ts index 802212dd2455..dcb24a26cbac 100644 --- a/packages/eslint-plugin/src/rules/no-surrounding-whitespace.ts +++ b/packages/eslint-plugin/src/rules/no-surrounding-whitespace.ts @@ -1,5 +1,5 @@ import { type AST } from "jsonc-eslint-parser"; -import { type JSONCRule } from "../utils"; +import { type JSONCRule } from "../utils.js"; function isSurroundedByWhitespace(str: string) { return /^\s/.test(str) || /\s$/.test(str); @@ -7,9 +7,9 @@ function isSurroundedByWhitespace(str: string) { export const noSurroundingWhitespace: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Disallow surrounding whitespace @@ -30,12 +30,13 @@ export const noSurroundingWhitespace: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Prevents strings in configuration files to be surrounded by whitespace`, }, fixable: "code", - schema: [], + schema: false, messages: { "no-surrounding-whitespace": "Leading and trailing whitespace is not allowed", diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-min-max-value.ts b/packages/eslint-plugin/src/rules/no-unnecessary-min-max-value.ts index 4d373e54031d..37203a74831a 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-min-max-value.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-min-max-value.ts @@ -1,11 +1,11 @@ import type { AST } from "jsonc-eslint-parser"; -import { type JSONCRule, removeJSONProperty } from "../utils"; +import { type JSONCRule, removeJSONProperty } from "../utils.js"; export const noUnnecessaryMinMaxValue: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Avoid unnecessary min/max value in parameters with predefined options "JSONProperty[key.value='paramInformation'] > JSONArrayExpression > JSONObjectExpression"( @@ -61,11 +61,12 @@ export const noUnnecessaryMinMaxValue: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: "Ensures that min/maxValue are not used unnecessarily", }, fixable: "code", - schema: [], + schema: false, messages: { "no-min-value": `For parameters with "allowManualEntry = false" and predefined options, "minValue" is unnecessary and should not be specified.`, diff --git a/packages/eslint-plugin/src/rules/no-useless-description.ts b/packages/eslint-plugin/src/rules/no-useless-description.ts index 813dad5004bd..75e8012d175e 100644 --- a/packages/eslint-plugin/src/rules/no-useless-description.ts +++ b/packages/eslint-plugin/src/rules/no-useless-description.ts @@ -1,12 +1,12 @@ import { type AST } from "jsonc-eslint-parser"; -import { CONFIG_PARAM } from "../jsonSelectors"; -import { type JSONCRule, removeJSONProperty } from "../utils"; +import { CONFIG_PARAM } from "../jsonSelectors.js"; +import { type JSONCRule, removeJSONProperty } from "../utils.js"; export const noUselessDescription: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Disallow "empty" param descriptions @@ -39,11 +39,12 @@ export const noUselessDescription: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Disallows "empty" and useless descriptions`, }, fixable: "code", - schema: [], + schema: false, messages: { "no-useless-description": "The description {{what}} is not allowed", }, diff --git a/packages/eslint-plugin/src/rules/no-value-in-option-label.ts b/packages/eslint-plugin/src/rules/no-value-in-option-label.ts index 53f5732b2dbe..d5e084ff8d30 100644 --- a/packages/eslint-plugin/src/rules/no-value-in-option-label.ts +++ b/packages/eslint-plugin/src/rules/no-value-in-option-label.ts @@ -1,6 +1,6 @@ import { type AST } from "jsonc-eslint-parser"; -import { CONFIG_OPTION } from "../jsonSelectors"; -import { type JSONCRule, getJSONNumber } from "../utils"; +import { CONFIG_OPTION } from "../jsonSelectors.js"; +import { type JSONCRule, getJSONNumber } from "../utils.js"; const startsWithNumber = /^\d(?![\/-])/; // allow - and / as the next chars const isNumberWithUnit = /^\d+(\.\d+)?\s?[°\w%µ]+/; @@ -8,9 +8,9 @@ const isOnlyNumeric = /^\d+(\.\d+)?$/; export const noValueInOptionLabel: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Disallow options labels that start with their value @@ -43,11 +43,12 @@ export const noValueInOptionLabel: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Prevents option labels which start with their value`, }, fixable: "code", - schema: [], + schema: false, messages: { "no-numeric-option": "Option labels must not start with their value. Use the 'value' property instead.", diff --git a/packages/eslint-plugin/src/rules/prefer-defaultvalue.ts b/packages/eslint-plugin/src/rules/prefer-defaultvalue.ts index 5cd29d6d35a8..3f9ae9dd1723 100644 --- a/packages/eslint-plugin/src/rules/prefer-defaultvalue.ts +++ b/packages/eslint-plugin/src/rules/prefer-defaultvalue.ts @@ -1,11 +1,11 @@ import { type AST } from "jsonc-eslint-parser"; -import { type JSONCRule } from "../utils"; +import { type JSONCRule } from "../utils.js"; export const preferDefaultValue: JSONCRule.RuleModule = { create(context) { - if (!context.parserServices.isJSON) { - return {}; - } + // if (!context.parserServices.isJSON) { + // return {}; + // } return { // Disallow "(default)" in labels and descriptions @@ -41,12 +41,13 @@ export const preferDefaultValue: JSONCRule.RuleModule = { }; }, meta: { + // @ts-expect-error Something is off about the rule types docs: { description: `Ensures that the defaultValue property is used instead of mentioning in text that an option/value is the default`, }, fixable: "code", - schema: [], + schema: false, messages: { "no-default": "Do not use '(default)' in labels or descriptions. Use the 'defaultValue' property instead.", diff --git a/packages/eslint-plugin/src/utils.ts b/packages/eslint-plugin/src/utils.ts index 144892335ee2..199774fd83f3 100644 --- a/packages/eslint-plugin/src/utils.ts +++ b/packages/eslint-plugin/src/utils.ts @@ -5,9 +5,14 @@ import { } from "@typescript-eslint/utils"; import { CommandClasses } from "@zwave-js/core"; import { type Rule as ESLintRule } from "eslint"; -import { type AST as JSONC_AST } from "jsonc-eslint-parser"; +import { type AST as JSONC_AST, type RuleListener } from "jsonc-eslint-parser"; import path from "node:path"; +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + export type ReportFixGenerator = ( fixer: ESLintRule.RuleFixer, ) => Generator; @@ -106,13 +111,67 @@ export namespace JSONCRule { // Special ESLint rule type for JSONC files // AST viewer at https://ota-meshi.github.io/jsonc-eslint-parser/ - export interface RuleListener { - [key: string]: ((node: never) => void) | undefined; - } export interface RuleModule { + meta: RuleMetaData; + jsoncDefineRule: PartialRuleModule; create(context: ESLintRule.RuleContext): RuleListener; - meta?: ESLintRule.RuleMetaData | undefined; - schema?: ESLintRule.RuleMetaData["schema"]; + } + + export interface RuleMetaData { + docs: { + description: string; + recommended: ("json" | "jsonc" | "json5")[] | null; + url: string; + ruleId: string; + ruleName: string; + default?: "error" | "warn"; + extensionRule: + | boolean + | string + | { + plugin: string; + url: string; + }; + layout: boolean; + }; + messages: { [messageId: string]: string }; + fixable?: "code" | "whitespace"; + hasSuggestions?: boolean; + schema: false /*| JSONSchema4 | JSONSchema4[]*/; + deprecated?: boolean; + replacedBy?: []; + type: "problem" | "suggestion" | "layout"; + } + + export interface PartialRuleModule { + meta: PartialRuleMetaData; + create( + context: ESLintRule.RuleContext, + params: { customBlock: boolean }, + ): RuleListener; + } + + export interface PartialRuleMetaData { + docs: { + description: string; + recommended: ("json" | "jsonc" | "json5")[] | null; + default?: "error" | "warn"; + extensionRule: + | boolean + | string + | { + plugin: string; + url: string; + }; + layout: boolean; + }; + messages: { [messageId: string]: string }; + fixable?: "code" | "whitespace"; + hasSuggestions?: boolean; + schema: false; /* | JSONSchema4 | JSONSchema4[]*/ + deprecated?: boolean; + replacedBy?: []; + type: "problem" | "suggestion" | "layout"; } } diff --git a/packages/eslint-plugin/src/utils/titleAndSentenceCase.ts b/packages/eslint-plugin/src/utils/titleAndSentenceCase.ts index badfcf4ecf94..321249f4d3b0 100644 --- a/packages/eslint-plugin/src/utils/titleAndSentenceCase.ts +++ b/packages/eslint-plugin/src/utils/titleAndSentenceCase.ts @@ -5,7 +5,7 @@ import { isHyphenatedWord, joinWords, splitIntoWords, -} from "./wordsAndNames"; +} from "./wordsAndNames.js"; const titleCaseExceptions = [ "with", diff --git a/packages/flash/package.json b/packages/flash/package.json index b394b6eac4b9..e77655c8da79 100644 --- a/packages/flash/package.json +++ b/packages/flash/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" }, "devDependencies": { diff --git a/packages/host/package.json b/packages/host/package.json index 5d87d4586793..053252984d94 100644 --- a/packages/host/package.json +++ b/packages/host/package.json @@ -46,7 +46,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" }, "dependencies": { diff --git a/packages/host/src/index.ts b/packages/host/src/index.ts index 8b9a9d5d4fe9..c4a7340a2742 100644 --- a/packages/host/src/index.ts +++ b/packages/host/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export * from "./FileSystem"; export * from "./ZWaveHost"; export * from "./ZWaveHostOptions"; diff --git a/packages/host/src/index_safe.ts b/packages/host/src/index_safe.ts index 7cc47ce565a2..a08ef095ba6a 100644 --- a/packages/host/src/index_safe.ts +++ b/packages/host/src/index_safe.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ /* @forbiddenImports external */ export * from "./FileSystem"; diff --git a/packages/maintenance/package.json b/packages/maintenance/package.json index c96f02f1149d..06b2e0cd6ed6 100644 --- a/packages/maintenance/package.json +++ b/packages/maintenance/package.json @@ -32,7 +32,7 @@ "ts": "node -r esbuild-register --conditions=@@dev", "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" }, "devDependencies": { diff --git a/packages/maintenance/src/implementedCCs.ts b/packages/maintenance/src/implementedCCs.ts index 7118206b99c4..5094c518aa06 100644 --- a/packages/maintenance/src/implementedCCs.ts +++ b/packages/maintenance/src/implementedCCs.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ -require("reflect-metadata"); +import "reflect-metadata"; + import { CommandClasses } from "@zwave-js/core"; import { num2hex } from "@zwave-js/shared"; import * as c from "ansi-colors"; diff --git a/packages/nvmedit/package.json b/packages/nvmedit/package.json index 8c45912b4ad8..8693a31f9f5e 100644 --- a/packages/nvmedit/package.json +++ b/packages/nvmedit/package.json @@ -57,7 +57,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/nvmedit/src/cli.ts b/packages/nvmedit/src/cli.ts index 40319719390c..1993368df88c 100644 --- a/packages/nvmedit/src/cli.ts +++ b/packages/nvmedit/src/cli.ts @@ -51,7 +51,7 @@ void yargs } catch (e) { try { json = await nvm500ToJSON(buffer); - } catch (ee) { + } catch { console.error(e); process.exit(1); } diff --git a/packages/nvmedit/src/lib/nvm3/adapter.ts b/packages/nvmedit/src/lib/nvm3/adapter.ts index ed5e6a13da04..de0fcd1ca9f1 100644 --- a/packages/nvmedit/src/lib/nvm3/adapter.ts +++ b/packages/nvmedit/src/lib/nvm3/adapter.ts @@ -576,18 +576,18 @@ export class NVM3Adapter implements NVMAdapter { property: ControllerNVMProperty, value: any, ): Promise { - const failFileMissing = (): never => { + function failFileMissing(): never { throw new ZWaveError( "Cannot set property in NVM for non-existing file", ZWaveErrorCodes.NVM_ObjectNotFound, ); - }; + } const expectFile = async ( fileId: number, ): Promise => { const file = await this._getFile(fileId); - if (!file) throw failFileMissing(); + if (!file) failFileMissing(); return file; }; diff --git a/packages/nvmedit/src/lib/nvm3/files/NVMFile.ts b/packages/nvmedit/src/lib/nvm3/files/NVMFile.ts index 4717bf6792b4..22f979579d8a 100644 --- a/packages/nvmedit/src/lib/nvm3/files/NVMFile.ts +++ b/packages/nvmedit/src/lib/nvm3/files/NVMFile.ts @@ -19,6 +19,7 @@ export function gotDeserializationOptions( return "data" in options && Buffer.isBuffer(options.data); } +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface NVMFileCreationOptions extends NVMFileBaseOptions {} export type NVMFileOptions = diff --git a/packages/serial/package.json b/packages/serial/package.json index cda29a77e55f..8dcd0b3997e4 100644 --- a/packages/serial/package.json +++ b/packages/serial/package.json @@ -51,7 +51,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/serial/src/index.ts b/packages/serial/src/index.ts index 51ba8203cb75..5c20a1baac3e 100644 --- a/packages/serial/src/index.ts +++ b/packages/serial/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export { SerialLogger } from "./Logger"; export type { SerialLogContext } from "./Logger_safe"; export * from "./MessageHeaders"; diff --git a/packages/serial/src/message/ZnifferMessages.ts b/packages/serial/src/message/ZnifferMessages.ts index fcbe6883613d..dddd22e70d9d 100644 --- a/packages/serial/src/message/ZnifferMessages.ts +++ b/packages/serial/src/message/ZnifferMessages.ts @@ -37,6 +37,7 @@ function gotDeserializationOptions( return options != undefined && Buffer.isBuffer(options.data); } +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface ZnifferMessageBaseOptions { // Intentionally empty } @@ -245,7 +246,7 @@ export class ZnifferDataMessage extends ZnifferMessage this.checksumOK = true; this.payload = Buffer.alloc(0); } else { - throw validatePayload.fail( + validatePayload.fail( `Unsupported frame type ${ getEnumMemberName(ZnifferFrameType, this.frameType) }`, diff --git a/packages/shared/package.json b/packages/shared/package.json index 21b8be39a7c1..64e91bf72f1e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -50,7 +50,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/shared/shared.api.md b/packages/shared/shared.api.md index 2dc12964a8d3..66a79a717c68 100644 --- a/packages/shared/shared.api.md +++ b/packages/shared/shared.api.md @@ -319,7 +319,7 @@ export class TimedExpectation implements Pro // Warning: (ae-missing-release-tag) "TypedClassDecorator" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export type TypedClassDecorator = T>(apiClass: TConstructor) => TConstructor | void; +export type TypedClassDecorator = T>(apiClass: TConstructor) => TConstructor | void; // Warning: (ae-missing-release-tag) "TypedEventEmitter" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // Warning: (ae-missing-release-tag) "TypedEventEmitter" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -363,7 +363,7 @@ export class TypedEventEmitter = (target: T, propertyKey: string | symbol) => void; +export type TypedPropertyDecorator = (target: T, propertyKey: string | symbol) => void; // Warning: (ae-missing-release-tag) "UnionToIntersection" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/packages/shared/src/EventEmitter.test.ts b/packages/shared/src/EventEmitter.test.ts index fe222846911d..306bce593fa3 100644 --- a/packages/shared/src/EventEmitter.test.ts +++ b/packages/shared/src/EventEmitter.test.ts @@ -17,6 +17,7 @@ interface TestEvents { baseProp2 = "base"; } + // eslint-disable-next-line @typescript-eslint/no-empty-object-type interface Test extends TypedEventEmitter {} @Mixin([EventEmitter]) diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 075724d30069..e9fc00d7f3f1 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export * from "./AsyncQueue"; export * from "./EventEmitter"; export { ObjectKeyMap } from "./ObjectKeyMap"; diff --git a/packages/shared/src/index_safe.ts b/packages/shared/src/index_safe.ts index 8dd0f0ae40d9..adc6b2d3d7c0 100644 --- a/packages/shared/src/index_safe.ts +++ b/packages/shared/src/index_safe.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ /* @forbiddenImports external */ export { ObjectKeyMap } from "./ObjectKeyMap"; diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts index 1e84ab4fd215..4960a8cb7806 100644 --- a/packages/shared/src/types.ts +++ b/packages/shared/src/types.ts @@ -7,19 +7,16 @@ export type DeepPartial = { [P in keyof T]+?: DeepPartial }; export type JSONObject = Record; -// eslint-disable-next-line @typescript-eslint/ban-types -export type Constructor = new (...args: any[]) => T; +export type Constructor = new (...args: any[]) => T; -// eslint-disable-next-line @typescript-eslint/ban-types -export type TypedClassDecorator = < +export type TypedClassDecorator = < T extends TTarget, TConstructor extends new (...args: any[]) => T, >( apiClass: TConstructor, ) => TConstructor | void; -// eslint-disable-next-line @typescript-eslint/ban-types -export type TypedPropertyDecorator = < +export type TypedPropertyDecorator = < T extends TTarget, >( target: T, diff --git a/packages/shared/src/utils.ts b/packages/shared/src/utils.ts index 5e74283632a2..b0a0a9aff3cf 100644 --- a/packages/shared/src/utils.ts +++ b/packages/shared/src/utils.ts @@ -2,8 +2,7 @@ import { isArray, isObject } from "alcalzone-shared/typeguards"; import { num2hex } from "./strings"; /** Object.keys, but with `(keyof T)[]` as the return type */ -// eslint-disable-next-line @typescript-eslint/ban-types -export function keysOf(obj: T): (keyof T)[] { +export function keysOf(obj: T): (keyof T)[] { return Object.keys(obj) as unknown as (keyof T)[]; } diff --git a/packages/testing/package.json b/packages/testing/package.json index 2a7a99b83935..24b3e403aa30 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -41,7 +41,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix" }, "dependencies": { diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index ce4a0fafc610..db131d8c61e4 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/consistent-type-exports */ export * from "./CCSpecificCapabilities"; export * from "./MockController"; export { getDefaultSupportedFunctionTypes } from "./MockControllerCapabilities"; diff --git a/packages/transformers/package.json b/packages/transformers/package.json index 4d79ddb9bc3b..f01e0275d95c 100644 --- a/packages/transformers/package.json +++ b/packages/transformers/package.json @@ -33,7 +33,7 @@ "clean": "del-cli build/ \"*.tsbuildinfo\"", "bootstrap": "yarn build", "pretest": "del-cli \"test/fixtures/*.js\" && tsc -p tsconfig.test.json && cpy \"test/build/test/fixtures/*.js\" test/fixtures && del-cli test/build", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/zwave-js/package.json b/packages/zwave-js/package.json index 34efbaae7547..9b896c0eb516 100644 --- a/packages/zwave-js/package.json +++ b/packages/zwave-js/package.json @@ -88,7 +88,7 @@ "build": "tsc -b tsconfig.build.json --pretty", "clean": "del-cli build/ \"*.tsbuildinfo\"", "extract-api": "yarn api-extractor run", - "lint:ts": "eslint --cache --ext .ts \"src/**/*.ts\"", + "lint:ts": "eslint --cache \"src/**/*.ts\"", "lint:ts:fix": "yarn run lint:ts --fix", "test:ts": "ava", "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run" diff --git a/packages/zwave-js/src/lib/controller/Controller.ts b/packages/zwave-js/src/lib/controller/Controller.ts index 1edda6e99901..0f905ab69dc3 100644 --- a/packages/zwave-js/src/lib/controller/Controller.ts +++ b/packages/zwave-js/src/lib/controller/Controller.ts @@ -475,6 +475,7 @@ interface ControllerEventCallbacks export type ControllerEvents = Extract; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface ZWaveController extends ControllerStatisticsHost {} @Mixin([ControllerStatisticsHost]) @@ -5167,7 +5168,7 @@ ${associatedNodes.join(", ")}`, // Remember that this route has been assigned if (i !== priorityRouteIndex) assignedRoutes[i] = route; - } catch (e) { + } catch { this.driver.controllerLog.logNode(nodeId, { message: `Assigning custom SUC return route #${i} failed`, direction: "outbound", @@ -5190,7 +5191,7 @@ ${associatedNodes.join(", ")}`, ); try { await this.driver.sendZWaveProtocolCC(cc); - } catch (e) { + } catch { this.driver.controllerLog.logNode(nodeId, { message: `Marking custom SUC return route as priority failed`, @@ -5472,7 +5473,7 @@ ${associatedNodes.join(", ")}`, // Remember that this route has been assigned if (i !== priorityRouteIndex) assignedRoutes[i] = route; - } catch (e) { + } catch { this.driver.controllerLog.logNode(nodeId, { message: `Assigning custom return route #${i} failed`, direction: "outbound", @@ -5495,7 +5496,7 @@ ${associatedNodes.join(", ")}`, ); try { await this.driver.sendZWaveProtocolCC(cc); - } catch (e) { + } catch { this.driver.controllerLog.logNode(nodeId, { message: `Marking custom return route as priority failed`, direction: "outbound", @@ -8502,7 +8503,7 @@ ${associatedNodes.join(", ")}`, (c) => c.type === BootloaderChunkType.FlowControl, 1000, ); - } catch (e) { + } catch { this.driver.controllerLog.print( "OTW update failed: The bootloader did not acknowledge the start of transfer.", "error", @@ -8613,7 +8614,7 @@ ${associatedNodes.join(", ")}`, 1000, ), ]); - } catch (e) { + } catch { this.driver.controllerLog.print( "OTW update failed: The bootloader did not acknowledge the end of transfer.", "error", diff --git a/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts b/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts index 9f4fa93d8754..3c5eb2a7f90a 100644 --- a/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts +++ b/packages/zwave-js/src/lib/controller/MockControllerBehaviors.ts @@ -524,7 +524,7 @@ const handleRequestNodeInfo: MockControllerBehavior = { nodeId: nodeInfo.nodeId as number, }, }); - } catch (e) { + } catch { cb = new ApplicationUpdateRequestNodeInfoRequestFailed(host); } controller.state.set( diff --git a/packages/zwave-js/src/lib/controller/utils.ts b/packages/zwave-js/src/lib/controller/utils.ts index 3d8837ba5fc9..22d59a27f907 100644 --- a/packages/zwave-js/src/lib/controller/utils.ts +++ b/packages/zwave-js/src/lib/controller/utils.ts @@ -17,18 +17,18 @@ import { export function assertProvisioningEntry( arg: any, ): asserts arg is PlannedProvisioningEntry { - const fail = (why: string) => { + function fail(why: string): never { throw new ZWaveError( `Invalid provisioning entry: ${why}`, ZWaveErrorCodes.Argument_Invalid, ); - }; + } - if (!isObject(arg)) throw fail("not an object"); + if (!isObject(arg)) fail("not an object"); - if (typeof arg.dsk !== "string") throw fail("dsk must be a string"); + if (typeof arg.dsk !== "string") fail("dsk must be a string"); else if (!isValidDSK(arg.dsk)) { - throw fail("dsk does not have the correct format"); + fail("dsk does not have the correct format"); } if ( @@ -36,29 +36,29 @@ export function assertProvisioningEntry( && (typeof arg.status !== "number" || !(arg.status in ProvisioningEntryStatus)) ) { - throw fail("status is not a ProvisioningEntryStatus"); + fail("status is not a ProvisioningEntryStatus"); } if (!isArray(arg.securityClasses)) { - throw fail("securityClasses must be an array"); + fail("securityClasses must be an array"); } else if ( !arg.securityClasses.every( (sc: any) => typeof sc === "number" && sc in SecurityClass, ) ) { - throw fail("securityClasses contains invalid entries"); + fail("securityClasses contains invalid entries"); } if (arg.requestedSecurityClasses != undefined) { if (!isArray(arg.requestedSecurityClasses)) { - throw fail("requestedSecurityClasses must be an array"); + fail("requestedSecurityClasses must be an array"); } else if ( !arg.requestedSecurityClasses.every( (sc: any) => typeof sc === "number" && sc in SecurityClass, ) ) { { - throw fail("requestedSecurityClasses contains invalid entries"); + fail("requestedSecurityClasses contains invalid entries"); } } } @@ -67,18 +67,18 @@ export function assertProvisioningEntry( arg.protocol != undefined && (typeof arg.protocol !== "number" || !(arg.protocol in Protocols)) ) { - throw fail("protocol is not a valid"); + fail("protocol is not a valid"); } if (arg.supportedProtocols != undefined) { if (!isArray(arg.supportedProtocols)) { - throw fail("supportedProtocols must be an array"); + fail("supportedProtocols must be an array"); } else if ( !arg.supportedProtocols.every( (p: any) => typeof p === "number" && p in Protocols, ) ) { - throw fail("supportedProtocols contains invalid entries"); + fail("supportedProtocols contains invalid entries"); } } } diff --git a/packages/zwave-js/src/lib/driver/Driver.ts b/packages/zwave-js/src/lib/driver/Driver.ts index 4f53cbe0012f..7c6124857b0e 100644 --- a/packages/zwave-js/src/lib/driver/Driver.ts +++ b/packages/zwave-js/src/lib/driver/Driver.ts @@ -253,7 +253,8 @@ import type { import { discoverRemoteSerialPorts } from "./mDNSDiscovery"; const packageJsonPath = require.resolve("zwave-js/package.json"); -// eslint-disable-next-line @typescript-eslint/no-var-requires + +// eslint-disable-next-line @typescript-eslint/no-require-imports const packageJson = require(packageJsonPath); const libraryRootDir = path.dirname(packageJsonPath); export const libVersion: string = packageJson.version; @@ -1218,7 +1219,7 @@ export class Driver extends TypedEventEmitter try { await this.openSerialport(); } catch (e) { - spOpenPromise.reject(e); + spOpenPromise.reject(e as Error); void this.destroy(); return; } @@ -5543,7 +5544,7 @@ ${handlers.length} left`, ); result.resolve(ret); } catch (e) { - result.reject(e); + result.reject(e as Error); } finally { this._currentSerialAPICommandPromise = undefined; } diff --git a/packages/zwave-js/src/lib/driver/MessageGenerators.ts b/packages/zwave-js/src/lib/driver/MessageGenerators.ts index 0841ac7b3628..cff635c21168 100644 --- a/packages/zwave-js/src/lib/driver/MessageGenerators.ts +++ b/packages/zwave-js/src/lib/driver/MessageGenerators.ts @@ -103,7 +103,7 @@ export async function waitForNodeUpdate( timeoutMs, (received) => maybePartialNodeUpdate(msg, received), ); - } catch (e) { + } catch { throw new ZWaveError( `Timed out while waiting for a response from the node`, ZWaveErrorCodes.Controller_NodeTimeout, @@ -136,17 +136,17 @@ export const simpleMessageGenerator: MessageGeneratorImplementation = if (isSendData(msg) && driver.exceedsMaxPayloadLength(msg)) { // We use explorer frames by default, but this reduces the maximum payload length by 2 bytes compared to AUTO_ROUTE // Try disabling explorer frames for this message and see if it fits now. - const fail = () => { + function fail(): never { throw new ZWaveError( "Cannot send this message because it would exceed the maximum payload length!", ZWaveErrorCodes.Controller_MessageTooLarge, ); - }; + } if (msg.transmitOptions & TransmitOptions.Explore) { msg.transmitOptions &= ~TransmitOptions.Explore; if (driver.exceedsMaxPayloadLength(msg)) { // Still too large - throw fail(); + fail(); } driver.controllerLog.logNode(msg.getNodeId()!, { message: @@ -154,7 +154,7 @@ export const simpleMessageGenerator: MessageGeneratorImplementation = level: "warn", }); } else { - throw fail(); + fail(); } } @@ -183,6 +183,7 @@ export const simpleMessageGenerator: MessageGeneratorImplementation = // We now need to throw because the callback was passed through so we could inspect it. if (isTransmitReport(result) && !result.isOK()) { // Throw the message in order to short-circuit all possible generators + // eslint-disable-next-line @typescript-eslint/only-throw-error throw result; } diff --git a/packages/zwave-js/src/lib/driver/NetworkCache.ts b/packages/zwave-js/src/lib/driver/NetworkCache.ts index cce505aab205..8e1de262c92e 100644 --- a/packages/zwave-js/src/lib/driver/NetworkCache.ts +++ b/packages/zwave-js/src/lib/driver/NetworkCache.ts @@ -378,7 +378,7 @@ export function deserializeNetworkCacheValue( ); } - function fail() { + function fail(): never { throw new ZWaveError( `Failed to deserialize property "${key}"`, ZWaveErrorCodes.Driver_InvalidCache, @@ -389,12 +389,12 @@ export function deserializeNetworkCacheValue( case "interviewStage": { value = tryParseInterviewStage(value); if (value) return value; - throw fail(); + fail(); } case "deviceClass": { value = tryParseDeviceClass(value); if (value) return value; - throw fail(); + fail(); } case "isListening": case "isRouting": @@ -411,14 +411,14 @@ export function deserializeNetworkCacheValue( case false: return false; } - throw fail(); + fail(); } case "dsk": { if (typeof value === "string") { return dskFromString(value); } - throw fail(); + fail(); } case "supportsSecurity": @@ -435,7 +435,7 @@ export function deserializeNetworkCacheValue( case "nodeType": { value = tryParseNodeType(value); if (value) return value; - throw fail(); + fail(); } case "supportedDataRates": { @@ -445,19 +445,19 @@ export function deserializeNetworkCacheValue( ) { return value; } - throw fail(); + fail(); } case "lastSeen": { value = tryParseDate(value); if (value) return value; - throw fail(); + fail(); } case "deviceConfigHash": { value = tryParseBuffer(value); if (value) return value; - throw fail(); + fail(); } } @@ -465,23 +465,23 @@ export function deserializeNetworkCacheValue( if (key.startsWith("controller.associations.")) { value = tryParseAssociationAddress(value); if (value) return value; - throw fail(); + fail(); } else if (key.startsWith("controller.securityKeys.")) { value = tryParseBuffer(value); if (value) return value; - throw fail(); + fail(); } switch (key) { case cacheKeys.controller.provisioningList: { value = tryParseProvisioningList(value); if (value) return value; - throw fail(); + fail(); } case cacheKeys.controller.privateKey: { value = tryParseBuffer(value); if (value) return value; - throw fail(); + fail(); } } diff --git a/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.test.ts b/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.test.ts index 7f107ccca566..73a1ca3d9c77 100644 --- a/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.test.ts +++ b/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.test.ts @@ -33,22 +33,20 @@ interface AvaTestContext { const test = ava as TestFn; -/* eslint-disable @typescript-eslint/ban-types */ interface TestMachineStateSchema { states: { - init: {}; - sending: {}; - waitForACK: {}; - waitForResponse: {}; - waitForCallback: {}; + init: object; + sending: object; + waitForACK: object; + waitForResponse: object; + waitForCallback: object; // FIXME: This is relevant for SendData, but we're not using SendData messages in this test // waitForCallbackAfterTimeout: {}; - unsolicited: {}; - success: {}; - failure: {}; + unsolicited: object; + success: object; + failure: object; }; } -/* eslint-enable @typescript-eslint/ban-types */ interface TestMachineContext { resp: boolean; diff --git a/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.ts b/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.ts index fca75ef65221..04ea7db84021 100644 --- a/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.ts +++ b/packages/zwave-js/src/lib/driver/SerialAPICommandMachine.ts @@ -16,20 +16,18 @@ import { import { isSendData } from "../serialapi/transport/SendDataShared"; import type { ZWaveOptions } from "./ZWaveOptions"; -/* eslint-disable @typescript-eslint/ban-types */ export interface SerialAPICommandStateSchema { states: { - sending: {}; - waitForACK: {}; - waitForResponse: {}; - waitForCallback: {}; - retry: {}; - retryWait: {}; - failure: {}; - success: {}; + sending: object; + waitForACK: object; + waitForResponse: object; + waitForCallback: object; + retry: object; + retryWait: object; + failure: object; + success: object; }; } -/* eslint-enable @typescript-eslint/ban-types */ export type SerialAPICommandError = | "send failure" diff --git a/packages/zwave-js/src/lib/driver/Statistics.test.ts b/packages/zwave-js/src/lib/driver/Statistics.test.ts index f745f87ad4f2..e2a1a62d9428 100644 --- a/packages/zwave-js/src/lib/driver/Statistics.test.ts +++ b/packages/zwave-js/src/lib/driver/Statistics.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-object-type */ import { Mixin } from "@zwave-js/shared"; import test from "ava"; import EventEmitter from "node:events"; diff --git a/packages/zwave-js/src/lib/driver/TransportServiceMachine.ts b/packages/zwave-js/src/lib/driver/TransportServiceMachine.ts index 9d83e3c4484e..6cdaa478a0b6 100644 --- a/packages/zwave-js/src/lib/driver/TransportServiceMachine.ts +++ b/packages/zwave-js/src/lib/driver/TransportServiceMachine.ts @@ -10,18 +10,16 @@ import { This state machine handles the receipt of Transport Service encapsulated commands from a node */ -/* eslint-disable @typescript-eslint/ban-types */ export interface TransportServiceRXStateSchema { states: { - waitingForSegment: {}; - segmentTimeout: {}; - waitingForRequestedSegment: {}; - segmentsComplete: {}; - success: {}; - failure: {}; + waitingForSegment: object; + segmentTimeout: object; + waitingForRequestedSegment: object; + segmentsComplete: object; + success: object; + failure: object; }; } -/* eslint-enable @typescript-eslint/ban-types */ export interface TransportServiceRXContext { receivedBytes: boolean[]; diff --git a/packages/zwave-js/src/lib/driver/UpdateConfig.ts b/packages/zwave-js/src/lib/driver/UpdateConfig.ts index 82c4634944ca..5389cc47e396 100644 --- a/packages/zwave-js/src/lib/driver/UpdateConfig.ts +++ b/packages/zwave-js/src/lib/driver/UpdateConfig.ts @@ -24,7 +24,7 @@ export async function checkForConfigUpdates( registry = await got .get("https://registry.npmjs.org/@zwave-js/config") .json(); - } catch (e) { + } catch { throw new ZWaveError( `Could not check for config updates: Failed to download package information!`, ZWaveErrorCodes.Config_Update_RegistryError, @@ -177,7 +177,7 @@ export async function installConfigUpdateInDocker( // do nothing }, }); - } catch (e) { + } catch { throw new ZWaveError( `Config update failed: Another installation is already in progress!`, ZWaveErrorCodes.Config_Update_InstallFailed, @@ -267,7 +267,7 @@ export async function installConfigUpdateInDocker( await fs.remove(configModuleDir); await fs.rename(extractedDir, configModuleDir); } - } catch (e) { + } catch { await freeLock(); throw new ZWaveError( `Config update failed: Could not extract tarball`, diff --git a/packages/zwave-js/src/lib/node/Node.ts b/packages/zwave-js/src/lib/node/Node.ts index 01129dfbf3cc..59b04a3e0363 100644 --- a/packages/zwave-js/src/lib/node/Node.ts +++ b/packages/zwave-js/src/lib/node/Node.ts @@ -2440,7 +2440,7 @@ protocol version: ${this.protocolVersion}`; rootInterviewOrderAfterEndpoints = topologicalSort( rootInterviewGraphAfterEndpoints, ); - } catch (e) { + } catch { // This interview cannot be done throw new ZWaveError( "The CC interview cannot be completed because there are circular dependencies between CCs!", @@ -2717,7 +2717,7 @@ protocol version: ${this.protocolVersion}`; endpointInterviewOrder = topologicalSort( endpointInterviewGraph, ); - } catch (e) { + } catch { // This interview cannot be done throw new ZWaveError( "The CC interview cannot be completed because there are circular dependencies between CCs!", @@ -5537,7 +5537,7 @@ protocol version: ${this.protocolVersion}`; & ~EncapsulationFlags.Supervision, }); await api.reportTimezone(timezone); - } catch (e) { + } catch { // ignore } } @@ -7801,7 +7801,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } // That's everything return response; - } catch (e) {} + } catch {} } if ( @@ -7820,7 +7820,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } satisfies DateAndTime, ); } - } catch (e) {} + } catch {} } if ( @@ -7839,7 +7839,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } satisfies DateAndTime, ); } - } catch (e) {} + } catch {} } if ( @@ -7858,7 +7858,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } satisfies DateAndTime, ); } - } catch (e) {} + } catch {} } if ( @@ -7876,7 +7876,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } satisfies DateAndTime, ); } - } catch (e) {} + } catch {} } if ( @@ -7896,7 +7896,7 @@ ${formatRouteHealthCheckSummary(this.id, otherNode.id, summary)}`, } satisfies DateAndTime, ); } - } catch (e) {} + } catch {} } return response; diff --git a/packages/zwave-js/src/lib/node/NodeReadyMachine.ts b/packages/zwave-js/src/lib/node/NodeReadyMachine.ts index c1d4e6a781f5..ded9e47896b2 100644 --- a/packages/zwave-js/src/lib/node/NodeReadyMachine.ts +++ b/packages/zwave-js/src/lib/node/NodeReadyMachine.ts @@ -5,15 +5,13 @@ import { assign, } from "xstate"; -/* eslint-disable @typescript-eslint/ban-types */ export interface NodeReadyStateSchema { states: { - notReady: {}; - readyIfNotDead: {}; - ready: {}; + notReady: object; + readyIfNotDead: object; + ready: object; }; } -/* eslint-enable @typescript-eslint/ban-types */ export interface NodeReadyContext { isMaybeDead: boolean; diff --git a/packages/zwave-js/src/lib/node/NodeStatusMachine.ts b/packages/zwave-js/src/lib/node/NodeStatusMachine.ts index 4867b560abb6..9bca75019308 100644 --- a/packages/zwave-js/src/lib/node/NodeStatusMachine.ts +++ b/packages/zwave-js/src/lib/node/NodeStatusMachine.ts @@ -2,19 +2,17 @@ import { type InterpreterFrom, Machine, type StateMachine } from "xstate"; import type { ZWaveNode } from "./Node"; import { NodeStatus } from "./_Types"; -/* eslint-disable @typescript-eslint/ban-types */ export interface NodeStatusStateSchema { states: { - unknown: {}; + unknown: object; // non-sleeping nodes are either dead or alive - dead: {}; - alive: {}; + dead: object; + alive: object; // sleeping nodes are asleep or awake - asleep: {}; - awake: {}; + asleep: object; + awake: object; }; } -/* eslint-enable @typescript-eslint/ban-types */ const statusDict = { unknown: NodeStatus.Unknown, diff --git a/packages/zwave-js/src/lib/node/_Types.ts b/packages/zwave-js/src/lib/node/_Types.ts index 5e3279a8a540..bb8b974c5477 100644 --- a/packages/zwave-js/src/lib/node/_Types.ts +++ b/packages/zwave-js/src/lib/node/_Types.ts @@ -43,14 +43,10 @@ export type NodeInterviewFailedEventArgs = errorMessage: string; isFinal: boolean; } - & ( - | { - attempt: number; - maxAttempts: number; - } - // eslint-disable-next-line @typescript-eslint/ban-types - | {} - ); + & AllOrNone<{ + attempt: number; + maxAttempts: number; + }>; export type ZWaveNodeValueAddedArgs = ValueAddedArgs & TranslatedValueID; export type ZWaveNodeValueUpdatedArgs = diff --git a/packages/zwave-js/src/lib/test/node/Node.interviewOrder.test.ts b/packages/zwave-js/src/lib/test/node/Node.interviewOrder.test.ts index 1b8984d1bf28..046495c42fd8 100644 --- a/packages/zwave-js/src/lib/test/node/Node.interviewOrder.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.interviewOrder.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import { getCCConstructor } from "@zwave-js/cc"; import { CommandClasses, diff --git a/packages/zwave-js/src/lib/zniffer/CCParsingContext.ts b/packages/zwave-js/src/lib/zniffer/CCParsingContext.ts index e74e529c91b3..0e9cd65853bf 100644 --- a/packages/zwave-js/src/lib/zniffer/CCParsingContext.ts +++ b/packages/zwave-js/src/lib/zniffer/CCParsingContext.ts @@ -22,7 +22,7 @@ export class ZnifferCCParsingContext implements ZWaveHost { getSafeCCVersion( cc: CommandClasses, nodeId: number, - endpointIndex?: number | undefined, + endpointIndex?: number, ): number { // We don't know any versions of the node. Try parsing with the highest version we support return getImplementedVersion(cc); @@ -31,7 +31,7 @@ export class ZnifferCCParsingContext implements ZWaveHost { getSupportedCCVersion( cc: CommandClasses, nodeId: number, - endpointIndex?: number | undefined, + endpointIndex?: number, ): number { // We don't know any versions of the node. Try parsing with the highest version we support return getImplementedVersion(cc); @@ -40,7 +40,7 @@ export class ZnifferCCParsingContext implements ZWaveHost { isCCSecure( cc: CommandClasses, nodeId: number, - endpointIndex?: number | undefined, + endpointIndex?: number, ): boolean { // Don't care when parsing return false; diff --git a/packages/zwave-js/src/lib/zniffer/MPDU.ts b/packages/zwave-js/src/lib/zniffer/MPDU.ts index 931318453830..29f36d7c07d6 100644 --- a/packages/zwave-js/src/lib/zniffer/MPDU.ts +++ b/packages/zwave-js/src/lib/zniffer/MPDU.ts @@ -128,7 +128,7 @@ export function parseMPDU( case 3: return LongRangeMPDU.from(frame); default: - throw validatePayload.fail( + validatePayload.fail( `Unsupported channel ${frame.channel}. MPDU payload: ${ buffer2hex(frame.payload) }`, @@ -142,7 +142,7 @@ export class LongRangeMPDU implements MPDU { this.frameInfo = options.frameInfo; if (options.frameInfo.channel !== 3) { - throw validatePayload.fail( + validatePayload.fail( `Unsupported channel ${options.frameInfo.channel} for LongRangeMPDU`, ); } @@ -179,7 +179,7 @@ export class LongRangeMPDU implements MPDU { ? SinglecastLongRangeMPDU : undefined; if (!Constructor) { - throw validatePayload.fail( + validatePayload.fail( `Unsupported Long Range MPDU header type ${this.headerType}`, ); } else if ( @@ -330,12 +330,12 @@ export class ZWaveMPDU implements MPDU { break; } case 3: { - throw validatePayload.fail( + validatePayload.fail( `Channel 3 (ZWLR) must be parsed as a LongRangeMPDU!`, ); } default: { - throw validatePayload.fail( + validatePayload.fail( `Unsupported channel ${options.frameInfo.channel}. MPDU payload: ${ buffer2hex(data) }`, @@ -357,7 +357,7 @@ export class ZWaveMPDU implements MPDU { ? ExplorerZWaveMPDU : undefined; if (!Constructor) { - throw validatePayload.fail( + validatePayload.fail( `Unsupported MPDU header type ${this.headerType}`, ); } else if ( @@ -645,7 +645,7 @@ export class ExplorerZWaveMPDU extends ZWaveMPDU { : undefined; if (!Constructor) { - throw validatePayload.fail( + validatePayload.fail( `Unsupported Explorer MPDU command ${this.command}`, ); } else if ( @@ -813,7 +813,7 @@ export function parseBeamFrame( }); } default: - throw validatePayload.fail( + validatePayload.fail( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `Unsupported channel configuration ${channelConfig}. MPDU payload: ${ buffer2hex(frame.payload) @@ -834,12 +834,12 @@ export class ZWaveBeamStart { // OK break; case "4": { - throw validatePayload.fail( + validatePayload.fail( `Channel configuration 4 (ZWLR) must be parsed as a LongRangeMPDU!`, ); } default: { - throw validatePayload.fail( + validatePayload.fail( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `Unsupported channel configuration ${channelConfig}. MPDU payload: ${ buffer2hex(data) @@ -891,12 +891,12 @@ export class LongRangeBeamStart { // OK break; case "4": { - throw validatePayload.fail( + validatePayload.fail( `Channel configuration 4 (ZWLR) must be parsed as a LongRangeMPDU!`, ); } default: { - throw validatePayload.fail( + validatePayload.fail( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `Unsupported channel configuration ${channelConfig}. MPDU payload: ${ buffer2hex(data) diff --git a/turbo.json b/turbo.json index 35c956b1bc40..29982dc8b36e 100644 --- a/turbo.json +++ b/turbo.json @@ -50,8 +50,7 @@ ":!:build/", "**/*.{ts,json}", // The style based linting tasks depend on the corresponding configuration in the repo root - "../../.eslintrc.js", - "../../.eslintignore", + "../../eslint.config.mjs", "../../tsconfig.all.json" ] }, @@ -62,8 +61,7 @@ ":!:build/", "**/*.{ts,json}", // The style based linting tasks depend on the corresponding configuration in the repo root - "../../.eslintrc.js", - "../../.eslintignore", + "../../eslint.config.mjs", "../../tsconfig.all.json" ], "outputs": ["**/*.{ts,json}"] @@ -74,7 +72,11 @@ // Dummy task to enable running all lint:zwave tasks }, "@zwave-js/config#lint:zwave": { - "inputs": ["**/*.ts", "config/**/*.json"] + "inputs": [ + "**/*.ts", + "config/**/*.json", + "config/eslint.config.mjs" + ] }, "extract-api": { diff --git a/yarn.lock b/yarn.lock index 53496aa37ab1..874b06e1640e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -236,10 +236,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-validator-identifier@npm:7.22.20" - checksum: 10/df882d2675101df2d507b95b195ca2f86a3ef28cb711c84f37e79ca23178e13b9f0d8b522774211f51e40168bf5142be4c1c9776a150cddb61a0d5bf3e95750b +"@babel/helper-validator-identifier@npm:^7.24.5": + version: 7.24.7 + resolution: "@babel/helper-validator-identifier@npm:7.24.7" + checksum: 10/86875063f57361471b531dbc2ea10bbf5406e12b06d249b03827d361db4cad2388c6f00936bcd9dc86479f7e2c69ea21412c2228d4b3672588b754b70a449d4b languageName: node linkType: hard @@ -777,34 +777,68 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.6.1": - version: 4.8.0 - resolution: "@eslint-community/regexpp@npm:4.8.0" - checksum: 10/bca98aff5fd4236ef6030e91bd323e57b8d42705d4ddcdd56041e3c1ff7f4d9eb4a3f1fffcbf0e0400cba0703ea9e496f521ae0ad65f269024d07c56edfa5e08 +"@eslint-community/regexpp@npm:^4.11.0": + version: 4.11.1 + resolution: "@eslint-community/regexpp@npm:4.11.1" + checksum: 10/934b6d3588c7f16b18d41efec4fdb89616c440b7e3256b8cb92cfd31ae12908600f2b986d6c1e61a84cbc10256b1dd3448cd1eec79904bd67ac365d0f1aba2e2 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.4": - version: 2.1.4 - resolution: "@eslint/eslintrc@npm:2.1.4" +"@eslint/config-array@npm:^0.18.0": + version: 0.18.0 + resolution: "@eslint/config-array@npm:0.18.0" + dependencies: + "@eslint/object-schema": "npm:^2.1.4" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10/60ccad1eb4806710b085cd739568ec7afd289ee5af6ca0383f0876f9fe375559ef525f7b3f86bdb3f961493de952f2cf3ab4aa4a6ccaef0ae3cd688267cabcb3 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.6.0": + version: 0.6.0 + resolution: "@eslint/core@npm:0.6.0" + checksum: 10/ec5cce168c8773fbd60c5a505563c6cf24398b3e1fa352929878d63129e0dd5b134d3232be2f2c49e8124a965d03359b38962aa0dcf7dfaf50746059d2a2f798 + languageName: node + linkType: hard + +"@eslint/eslintrc@npm:^3.1.0": + version: 3.1.0 + resolution: "@eslint/eslintrc@npm:3.1.0" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" - espree: "npm:^9.6.0" - globals: "npm:^13.19.0" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.2.1" js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 10/7a3b14f4b40fc1a22624c3f84d9f467a3d9ea1ca6e9a372116cb92507e485260359465b58e25bcb6c9981b155416b98c9973ad9b796053fd7b3f776a6946bce8 + checksum: 10/02bf892d1397e1029209dea685e9f4f87baf643315df2a632b5f121ec7e8548a3b34f428a007234fa82772218fa8a3ac2d10328637b9ce63b7f8344035b74db3 languageName: node linkType: hard -"@eslint/js@npm:8.57.0": - version: 8.57.0 - resolution: "@eslint/js@npm:8.57.0" - checksum: 10/3c501ce8a997cf6cbbaf4ed358af5492875e3550c19b9621413b82caa9ae5382c584b0efa79835639e6e0ddaa568caf3499318e5bdab68643ef4199dce5eb0a0 +"@eslint/js@npm:9.11.1": + version: 9.11.1 + resolution: "@eslint/js@npm:9.11.1" + checksum: 10/77b9c744bdf24e2ca1f99f671139767d6c31cb10d732cf22a85ef28f1f95f2a621cf204f572fd9fee67da6193ff2597a5d236cef3b557b07624230b622612339 + languageName: node + linkType: hard + +"@eslint/object-schema@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/object-schema@npm:2.1.4" + checksum: 10/221e8d9f281c605948cd6e030874aacce83fe097f8f9c1964787037bccf08e82b7aa9eff1850a30fffac43f1d76555727ec22a2af479d91e268e89d1e035131e + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.0": + version: 0.2.0 + resolution: "@eslint/plugin-kit@npm:0.2.0" + dependencies: + levn: "npm:^0.4.1" + checksum: 10/ebb363174397341dea47dc35fc206e24328083e4f0fa1c539687dbb7f94bef77e43faa12867d032e6eea5ac980ea8fbb6b1d844186e422d327c04088041b99f3 languageName: node linkType: hard @@ -829,17 +863,6 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.14": - version: 0.11.14 - resolution: "@humanwhocodes/config-array@npm:0.11.14" - dependencies: - "@humanwhocodes/object-schema": "npm:^2.0.2" - debug: "npm:^4.3.1" - minimatch: "npm:^3.0.5" - checksum: 10/3ffb24ecdfab64014a230e127118d50a1a04d11080cbb748bc21629393d100850496456bbcb4e8c438957fe0934430d731042f1264d6a167b62d32fc2863580a - languageName: node - linkType: hard - "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -847,10 +870,10 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.2": - version: 2.0.3 - resolution: "@humanwhocodes/object-schema@npm:2.0.3" - checksum: 10/05bb99ed06c16408a45a833f03a732f59bf6184795d4efadd33238ff8699190a8c871ad1121241bb6501589a9598dc83bf25b99dcbcf41e155cdf36e35e937a3 +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.0 + resolution: "@humanwhocodes/retry@npm:0.3.0" + checksum: 10/e574bab58680867414e225c9002e9a97eb396f85871c180fbb1a9bcdf9ded4b4de0b327f7d0c43b775873362b7c92956d4b322e8bc4b90be56077524341f04b2 languageName: node linkType: hard @@ -1418,13 +1441,13 @@ __metadata: languageName: node linkType: hard -"@types/eslint@npm:^8.56.7": - version: 8.56.7 - resolution: "@types/eslint@npm:8.56.7" +"@types/eslint@npm:^9.6.1": + version: 9.6.1 + resolution: "@types/eslint@npm:9.6.1" dependencies: "@types/estree": "npm:*" "@types/json-schema": "npm:*" - checksum: 10/4c90f30a19bc5a01b27afc4f7e3efa28d191b7c9505fd4f6373d1dcdf8e93b939628d92ae730c3ef77bf2a094622296bb307cbecbad7cb6b43ef31dd722f6944 + checksum: 10/719fcd255760168a43d0e306ef87548e1e15bffe361d5f4022b0f266575637acc0ecb85604ac97879ee8ae83c6a6d0613b0ed31d0209ddf22a0fe6d608fc56fe languageName: node linkType: hard @@ -1435,6 +1458,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10/9d35d475095199c23e05b431bcdd1f6fec7380612aed068b14b2a08aa70494de8a9026765a5a91b1073f636fb0368f6d8973f518a31391d519e20c59388ed88d + languageName: node + linkType: hard + "@types/fs-extra@npm:^11.0.4": version: 11.0.4 resolution: "@types/fs-extra@npm:11.0.4" @@ -1480,10 +1510,10 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.12": - version: 7.0.12 - resolution: "@types/json-schema@npm:7.0.12" - checksum: 10/7a72ba9cb7d2b45d7bb032e063c9eeb1ce4102d62551761e84c91f99f8273ba5aaffd34be835869456ec7c40761b4389009d9e777c0020a7227ca0f5e3238e94 +"@types/json-schema@npm:^7.0.15": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 10/1a3c3e06236e4c4aab89499c428d585527ce50c24fe8259e8b3926d3df4cfbbbcf306cfc73ddfb66cbafc973116efd15967020b0f738f63e09e64c7d260519e7 languageName: node linkType: hard @@ -1570,13 +1600,6 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.5.0": - version: 7.5.1 - resolution: "@types/semver@npm:7.5.1" - checksum: 10/8e19822a2f6282785f4787b3640a205161a65f85de3d2159c5077002adb6e90b2f80bb7c8324ffdb9643061763e1672747f04b0ef3e9ac4179de0dce20ad641d - languageName: node - linkType: hard - "@types/semver@npm:^7.5.8": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" @@ -1648,125 +1671,87 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/eslint-plugin@npm:7.13.0" +"@typescript-eslint/eslint-plugin@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.7.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/type-utils": "npm:7.13.0" - "@typescript-eslint/utils": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/type-utils": "npm:8.7.0" + "@typescript-eslint/utils": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" ts-api-utils: "npm:^1.3.0" peerDependencies: - "@typescript-eslint/parser": ^7.0.0 - eslint: ^8.56.0 + "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/93c3a0d8871d8351187503152a6c5199714eb62c96991e0d3e0caaee6881839dee4ad55e5de5d1a4389ae12ed10d3a845603de1f2f581337f782f19113022a65 + checksum: 10/5bc774b1da4e1cd19c5ffd731c655c53035fd81ff06a95c2f2c54ab62c401879f886da3e1a1235505341e8172b2841c6edc78b4565a261105ab32d83bf5b8ab1 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/parser@npm:7.13.0" +"@typescript-eslint/parser@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/parser@npm:8.7.0" dependencies: - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/typescript-estree": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" debug: "npm:^4.3.4" peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/ad930d9138c3caa9e0ac2d887798318b5b06df5aa1ecc50c2d8cd912e00cf13eb007256bfb4c11709f0191fc180614a15f84c0f0f03a50f035b0b8af0eb9409c - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/scope-manager@npm:6.21.0" - dependencies: - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/visitor-keys": "npm:6.21.0" - checksum: 10/fe91ac52ca8e09356a71dc1a2f2c326480f3cccfec6b2b6d9154c1a90651ab8ea270b07c67df5678956c3bbf0bbe7113ab68f68f21b20912ea528b1214197395 + checksum: 10/896ac60f8426f9e5c23198c89555f6f88f7957c5b16bb7b966dac45c5f5e7076c1a050bcee2e0eddff88055b9c0d7bdfaef9c64889e3bdf3356d20356b0daa04 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/scope-manager@npm:7.13.0" +"@typescript-eslint/scope-manager@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/scope-manager@npm:8.7.0" dependencies: - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" - checksum: 10/2b258a06c5e747c80423b07855f052f327a4d5b0a0cf3a46221ef298653139d3b01ac1534fc0db6609fd962ba45ec87a0e12f8d3778183440923bcf4687832a5 + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" + checksum: 10/6a6aae28437f6cd78f82dd1359658593fcc8f6d0da966b4d128b14db3a307b6094d22515a79c222055a31bf9b73b73799acf18fbf48c0da16e8f408fcc10464c languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/type-utils@npm:7.13.0" +"@typescript-eslint/type-utils@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/type-utils@npm:8.7.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:7.13.0" - "@typescript-eslint/utils": "npm:7.13.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" + "@typescript-eslint/utils": "npm:8.7.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" - peerDependencies: - eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/f51ccb3c59963db82a504b02c8d15bc518137c176b8d39891f7bcb7b4b02ca0fa918a3754781f198f592f1047dc24c49086430bbef857d877d085e14d33f7a6c + checksum: 10/dba4520dd3dce35b765640f9633100bd29d2092478cb467e89bde51dc23fb19f7395e87f4486b898315aab081263003cbc78f03f0f40079602713aafc2f2a6a5 languageName: node linkType: hard -"@typescript-eslint/types@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/types@npm:6.21.0" - checksum: 10/e26da86d6f36ca5b6ef6322619f8ec55aabcd7d43c840c977ae13ae2c964c3091fc92eb33730d8be08927c9de38466c5323e78bfb270a9ff1d3611fe821046c5 +"@typescript-eslint/types@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/types@npm:8.7.0" + checksum: 10/9adbe4efdcb00735af5144a161d6bb2f79a952a9701820920ad33adba02032d65d5b601087e953c2918f7efa548abbcd9289f83ec6299f66941d7c585886792e languageName: node linkType: hard -"@typescript-eslint/types@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/types@npm:7.13.0" - checksum: 10/5adc39c569217ed7d09853385313f1fcf2c05385e5e0144740238e346afbc0dec576c1eb46f779368736b080e6f9f368483fff3378b0bf7e6b275f27a904f04d - languageName: node - linkType: hard - -"@typescript-eslint/typescript-estree@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" +"@typescript-eslint/typescript-estree@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.7.0" dependencies: - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/visitor-keys": "npm:6.21.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/visitor-keys": "npm:8.7.0" debug: "npm:^4.3.4" - globby: "npm:^11.1.0" - is-glob: "npm:^4.0.3" - minimatch: "npm:9.0.3" - semver: "npm:^7.5.4" - ts-api-utils: "npm:^1.0.1" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/b32fa35fca2a229e0f5f06793e5359ff9269f63e9705e858df95d55ca2cd7fdb5b3e75b284095a992c48c5fc46a1431a1a4b6747ede2dd08929dc1cbacc589b8 - languageName: node - linkType: hard - -"@typescript-eslint/typescript-estree@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/typescript-estree@npm:7.13.0" - dependencies: - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" - debug: "npm:^4.3.4" - globby: "npm:^11.1.0" + fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" minimatch: "npm:^9.0.4" semver: "npm:^7.6.0" @@ -1774,65 +1759,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/d4cc68e8aa9902c5efa820582b05bfb6c1567e21e7743250778613a045f0b6bb05128f7cfc090368ab808ad91be6193b678569ca803f917b2958c3752bc4810b - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:7.13.0, @typescript-eslint/utils@npm:^7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/utils@npm:7.13.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/typescript-estree": "npm:7.13.0" - peerDependencies: - eslint: ^8.56.0 - checksum: 10/c87bbb90c958ed4617f88767890af2a797adcf28060e85809a9cad2ce4ed55b5db685d3a8d062dbbf89d2a49e85759e2a9deb92ee1946a95d5de6cbd14ea42f4 + checksum: 10/c4f7e3c18c8382b72800681c37c87726b02a96cf6831be37d2d2f9c26267016a9dd7af4e08184b96376a9aebdc5c344c6c378c86821c374fe10a9e45aca1b33d languageName: node linkType: hard -"@typescript-eslint/utils@npm:^6.0.0": - version: 6.21.0 - resolution: "@typescript-eslint/utils@npm:6.21.0" +"@typescript-eslint/utils@npm:8.7.0, @typescript-eslint/utils@npm:^8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/utils@npm:8.7.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@types/json-schema": "npm:^7.0.12" - "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.21.0" - "@typescript-eslint/types": "npm:6.21.0" - "@typescript-eslint/typescript-estree": "npm:6.21.0" - semver: "npm:^7.5.4" + "@typescript-eslint/scope-manager": "npm:8.7.0" + "@typescript-eslint/types": "npm:8.7.0" + "@typescript-eslint/typescript-estree": "npm:8.7.0" peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - checksum: 10/b404a2c55a425a79d054346ae123087d30c7ecf7ed7abcf680c47bf70c1de4fabadc63434f3f460b2fa63df76bc9e4a0b9fa2383bb8a9fcd62733fb5c4e4f3e3 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:6.21.0": - version: 6.21.0 - resolution: "@typescript-eslint/visitor-keys@npm:6.21.0" - dependencies: - "@typescript-eslint/types": "npm:6.21.0" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10/30422cdc1e2ffad203df40351a031254b272f9c6f2b7e02e9bfa39e3fc2c7b1c6130333b0057412968deda17a3a68a578a78929a8139c6acef44d9d841dc72e1 + eslint: ^8.57.0 || ^9.0.0 + checksum: 10/81674503fb5ea32ff5de8f1a29fecbcfa947025e7609e861ac8e32cd13326fc050c4fa5044e1a877f05e7e1264c42b9c72a7fd09c4a41d0ac2cf1c49259abf03 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/visitor-keys@npm:7.13.0" +"@typescript-eslint/visitor-keys@npm:8.7.0": + version: 8.7.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.7.0" dependencies: - "@typescript-eslint/types": "npm:7.13.0" + "@typescript-eslint/types": "npm:8.7.0" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10/5568dd435f22337c034da8c2dacd5be23b966c5978d25d96fca1358c59289861dfc4c39f2943c7790e947f75843d60035ad56c1f2c106f0e7d9ecf1ff6646065 - languageName: node - linkType: hard - -"@ungap/structured-clone@npm:^1.2.0": - version: 1.2.0 - resolution: "@ungap/structured-clone@npm:1.2.0" - checksum: 10/c6fe89a505e513a7592e1438280db1c075764793a2397877ff1351721fe8792a966a5359769e30242b3cd023f2efb9e63ca2ca88019d73b564488cc20e3eab12 + checksum: 10/189ea297ff4da53aea92f31de57aed164550c51ac7cf663007c997c4f0f75a82097e35568e3a0fbcced290cb4c12ab7d3afd99e93eb37c930d7f6d6bbfd6ed98 languageName: node linkType: hard @@ -1975,10 +1926,12 @@ __metadata: version: 0.0.0-use.local resolution: "@zwave-js/eslint-plugin@workspace:packages/eslint-plugin" dependencies: - "@types/eslint": "npm:^8.56.7" - "@typescript-eslint/utils": "npm:^7.13.0" + "@types/eslint": "npm:^9.6.1" + "@typescript-eslint/utils": "npm:^8.7.0" "@zwave-js/core": "workspace:*" - eslint: "npm:^8.57.0" + eslint: "npm:^9.11.1" + eslint-compat-utils: "npm:^0.5.1" + eslint-plugin-jsonc: "npm:^2.16.0" typescript: "npm:5.5.3" languageName: unknown linkType: soft @@ -2113,8 +2066,6 @@ __metadata: "@types/semver": "npm:^7.5.8" "@types/source-map-support": "npm:^0.5.10" "@types/xml2js": "npm:^0.4.14" - "@typescript-eslint/eslint-plugin": "npm:^7.13.0" - "@typescript-eslint/parser": "npm:^7.13.0" "@zwave-js/cc": "workspace:*" "@zwave-js/config": "workspace:*" "@zwave-js/core": "workspace:*" @@ -2137,10 +2088,9 @@ __metadata: dprint: "npm:^0.47.2" esbuild: "npm:0.21.5" esbuild-register: "npm:^3.5.0" - eslint: "npm:^8.57.0" - eslint-plugin-deprecation: "npm:^2.0.0" - eslint-plugin-unicorn: "npm:^52.0.0" - eslint-plugin-unused-imports: "npm:^3.2.0" + eslint: "npm:^9.11.1" + eslint-plugin-unicorn: "npm:^55.0.0" + eslint-plugin-unused-imports: "patch:eslint-plugin-unused-imports@npm%3A4.1.4#~/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch" execa: "npm:^5.1.1" fs-extra: "npm:^11.2.0" husky: "npm:^9.1.5" @@ -2154,6 +2104,7 @@ __metadata: ts-patch: "npm:3.2.1" turbo: "npm:1.13.4" typescript: "npm:5.5.3" + typescript-eslint: "npm:^8.7.0" xml2js: "npm:^0.6.2" zwave-js: "workspace:*" languageName: unknown @@ -2295,6 +2246,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.12.0": + version: 8.12.1 + resolution: "acorn@npm:8.12.1" + bin: + acorn: bin/acorn + checksum: 10/d08c2d122bba32d0861e0aa840b2ee25946c286d5dc5990abca991baf8cdbfbe199b05aacb221b979411a2fea36f83e26b5ac4f6b4e0ce49038c62316c1848f0 + languageName: node + linkType: hard + "acorn@npm:^8.5.0, acorn@npm:^8.9.0": version: 8.10.0 resolution: "acorn@npm:8.10.0" @@ -2845,17 +2805,17 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.23.0": - version: 4.23.0 - resolution: "browserslist@npm:4.23.0" +"browserslist@npm:^4.23.3": + version: 4.23.3 + resolution: "browserslist@npm:4.23.3" dependencies: - caniuse-lite: "npm:^1.0.30001587" - electron-to-chromium: "npm:^1.4.668" - node-releases: "npm:^2.0.14" - update-browserslist-db: "npm:^1.0.13" + caniuse-lite: "npm:^1.0.30001646" + electron-to-chromium: "npm:^1.5.4" + node-releases: "npm:^2.0.18" + update-browserslist-db: "npm:^1.1.0" bin: browserslist: cli.js - checksum: 10/496c3862df74565dd942b4ae65f502c575cbeba1fa4a3894dad7aa3b16130dc3033bc502d8848147f7b625154a284708253d9598bcdbef5a1e34cf11dc7bad8e + checksum: 10/e266d18c6c6c5becf9a1a7aa264477677b9796387972e8fce34854bb33dc1666194dc28389780e5dc6566e68a95e87ece2ce222e1c4ca93c2b75b61dfebd5f1c languageName: node linkType: hard @@ -2995,10 +2955,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001587": - version: 1.0.30001605 - resolution: "caniuse-lite@npm:1.0.30001605" - checksum: 10/c5671465d7301ecea515698e6b680f20933d1c5351c0381b6ef1a14bf911b3f1f8b7633eedc10339268036f0a63d703bc8d36071412f89495b48630f01a21fe5 +"caniuse-lite@npm:^1.0.30001646": + version: 1.0.30001660 + resolution: "caniuse-lite@npm:1.0.30001660" + checksum: 10/5d83f0b7e2075b7e31f114f739155dc6c21b0afe8cb61180f625a4903b0ccd3d7591a5f81c930f14efddfa57040203ba0890850b8a3738f6c7f17c7dd83b9de8 languageName: node linkType: hard @@ -3525,12 +3485,12 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.34.0": - version: 3.36.1 - resolution: "core-js-compat@npm:3.36.1" +"core-js-compat@npm:^3.37.0": + version: 3.38.1 + resolution: "core-js-compat@npm:3.38.1" dependencies: - browserslist: "npm:^4.23.0" - checksum: 10/d86b46805de7f5ba3675ed21532ecc64b6c1f123be7286b9efa7941ec087cd8d2446cb555f03a407dbbbeb6e881d1baf92eaffb7f051b11d9103f39c8731fa62 + browserslist: "npm:^4.23.3" + checksum: 10/4e2f219354fd268895f79486461a12df96f24ed307321482fe2a43529c5a64e7c16bcba654980ba217d603444f5141d43a79058aeac77511085f065c5da72207 languageName: node linkType: hard @@ -3918,15 +3878,6 @@ __metadata: languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: "npm:^2.0.2" - checksum: 10/b4b28f1df5c563f7d876e7461254a4597b8cabe915abe94d7c5d1633fed263fcf9a85e8d3836591fc2d040108e822b0d32758e5ec1fe31c590dc7e08086e3e48 - languageName: node - linkType: hard - "dot-prop@npm:^5.1.0": version: 5.3.0 resolution: "dot-prop@npm:5.3.0" @@ -3971,10 +3922,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.668": - version: 1.4.727 - resolution: "electron-to-chromium@npm:1.4.727" - checksum: 10/c97e8e630b07eee98a3d0c2e670f4acf4854db50cf675a8eb71e61d4efced0c9dc497b19b6c2a86bd91a8e6f29660dc2a139197c239f018bd0061f24e7241d18 +"electron-to-chromium@npm:^1.5.4": + version: 1.5.24 + resolution: "electron-to-chromium@npm:1.5.24" + checksum: 10/c7c64e4d48667d24515eee76989e62223f618f01cfde4a76f4624cd67f1ccf97f07e2d630027f6986f59b2ff30f35870e3c0c63f2deec5d962364159c21c4513 languageName: node linkType: hard @@ -4145,6 +4096,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.1.2": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 10/9d7169e3965b2f9ae46971afa392f6e5a25545ea30f2e2dd99c9b0a95a3f52b5653681a84f5b2911a413ddad2d7a93d3514165072f349b5ffc59c75a899970d6 + languageName: node + linkType: hard + "escape-string-regexp@npm:5.0.0, escape-string-regexp@npm:^5.0.0": version: 5.0.0 resolution: "escape-string-regexp@npm:5.0.0" @@ -4173,31 +4131,45 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-deprecation@npm:^2.0.0": - version: 2.0.0 - resolution: "eslint-plugin-deprecation@npm:2.0.0" +"eslint-compat-utils@npm:^0.5.0, eslint-compat-utils@npm:^0.5.1": + version: 0.5.1 + resolution: "eslint-compat-utils@npm:0.5.1" dependencies: - "@typescript-eslint/utils": "npm:^6.0.0" - tslib: "npm:^2.3.1" - tsutils: "npm:^3.21.0" + semver: "npm:^7.5.4" peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: ^4.2.4 || ^5.0.0 - checksum: 10/810276afa258155a35c863bb2138ebd2132447c3ed219e360915b0e7b4c6e77e09ae2931583d200b1f23e19040a27ad81c0927538a46392334bb4c3c4a2038b4 + eslint: ">=6.0.0" + checksum: 10/ac65ac1c6107cf19f63f5fc17cea361c9cb1336be7356f23dbb0fac10979974b4622e13e950be43cbf431801f2c07f7dab448573181ccf6edc0b86d5b5304511 languageName: node linkType: hard -"eslint-plugin-unicorn@npm:^52.0.0": - version: 52.0.0 - resolution: "eslint-plugin-unicorn@npm:52.0.0" +"eslint-plugin-jsonc@npm:^2.16.0": + version: 2.16.0 + resolution: "eslint-plugin-jsonc@npm:2.16.0" dependencies: - "@babel/helper-validator-identifier": "npm:^7.22.20" + "@eslint-community/eslint-utils": "npm:^4.2.0" + eslint-compat-utils: "npm:^0.5.0" + espree: "npm:^9.6.1" + graphemer: "npm:^1.4.0" + jsonc-eslint-parser: "npm:^2.0.4" + natural-compare: "npm:^1.4.0" + synckit: "npm:^0.6.0" + peerDependencies: + eslint: ">=6.0.0" + checksum: 10/bec880a4d6f0cd8ba37ae3a6528477d3161b41ca7b885ed43c34bed95d09b30fd1d277bfa9e487164f5a8aad265f3b075a4b479c20811fe0dd18c25b6835cf56 + languageName: node + linkType: hard + +"eslint-plugin-unicorn@npm:^55.0.0": + version: 55.0.0 + resolution: "eslint-plugin-unicorn@npm:55.0.0" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.24.5" "@eslint-community/eslint-utils": "npm:^4.4.0" - "@eslint/eslintrc": "npm:^2.1.4" ci-info: "npm:^4.0.0" clean-regexp: "npm:^1.0.0" - core-js-compat: "npm:^3.34.0" + core-js-compat: "npm:^3.37.0" esquery: "npm:^1.5.0" + globals: "npm:^15.7.0" indent-string: "npm:^4.0.0" is-builtin-module: "npm:^3.2.1" jsesc: "npm:^3.0.2" @@ -4205,43 +4177,47 @@ __metadata: read-pkg-up: "npm:^7.0.1" regexp-tree: "npm:^0.1.27" regjsparser: "npm:^0.10.0" - semver: "npm:^7.5.4" + semver: "npm:^7.6.1" strip-indent: "npm:^3.0.0" peerDependencies: eslint: ">=8.56.0" - checksum: 10/69b8aeee04806b808a534fe5484ad75ee9feec6078aad90651d7ce7216e2bd14980fec5a2e05fd800b874406a54240af66f04ab83023a7f1fe67397b6dc4c032 + checksum: 10/ea2fe55c517e18a8abedee125492ba09b11695fe41a3f42bf7b6789e9c937c89e8692735b07dcd41e25aff849950da2cca76ac6b727996e6bd2a978c8dc2685f languageName: node linkType: hard -"eslint-plugin-unused-imports@npm:^3.2.0": - version: 3.2.0 - resolution: "eslint-plugin-unused-imports@npm:3.2.0" - dependencies: - eslint-rule-composer: "npm:^0.3.0" +"eslint-plugin-unused-imports@npm:4.1.4": + version: 4.1.4 + resolution: "eslint-plugin-unused-imports@npm:4.1.4" peerDependencies: - "@typescript-eslint/eslint-plugin": 6 - 7 - eslint: 8 + "@typescript-eslint/eslint-plugin": ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 + eslint: ^9.0.0 || ^8.0.0 peerDependenciesMeta: "@typescript-eslint/eslint-plugin": optional: true - checksum: 10/05ce3ae4278245caeb25af28aa6832ecd59d664633f31b1dd498798d27cb7f959e2af1b8feeef789a87755541f47b222156c29420f1777d4c5f022e842171ed7 + checksum: 10/8e987028ad925ce1e04c01dcae70adbf44c2878a8b15c4327b33a2861e471d7fe00f6fe213fbd2b936f3fcefc8ccabb0d778aa1d6e0e0387a3dc7fe150cd4ed4 languageName: node linkType: hard -"eslint-rule-composer@npm:^0.3.0": - version: 0.3.0 - resolution: "eslint-rule-composer@npm:0.3.0" - checksum: 10/c751e71243c6750de553ca0f586a71c7e9d43864bcbd0536639f287332e3f1ed3337bb0db07020652fa90937ceb63b6cc14c0f71fb227e8fc20ca44ee67e837f +"eslint-plugin-unused-imports@patch:eslint-plugin-unused-imports@npm%3A4.1.4#~/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch": + version: 4.1.4 + resolution: "eslint-plugin-unused-imports@patch:eslint-plugin-unused-imports@npm%3A4.1.4#~/.yarn/patches/eslint-plugin-unused-imports-npm-4.1.4-a7d7c7cdf3.patch::version=4.1.4&hash=ca53e2" + peerDependencies: + "@typescript-eslint/eslint-plugin": ^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0 + eslint: ^9.0.0 || ^8.0.0 + peerDependenciesMeta: + "@typescript-eslint/eslint-plugin": + optional: true + checksum: 10/4607a8f4350aa713c658aeab1376898888058539877462ef94a1a0aa314140c2d270ea7b5fe9150ef5284e801d616de3a4a7457721bd2fc988ffa77d7a90e174 languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" +"eslint-scope@npm:^8.0.2": + version: 8.0.2 + resolution: "eslint-scope@npm:8.0.2" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10/5c660fb905d5883ad018a6fea2b49f3cb5b1cbf2cd4bd08e98646e9864f9bc2c74c0839bed2d292e90a4a328833accc197c8f0baed89cbe8d605d6f918465491 + checksum: 10/d17c2e1ff4d3a98911414a954531078db912e2747d6da8ea4cafd16d0526e32086c676ce9aeaffb3ca0ff695fc951ac3169d7f08a0b42962db683dff126cc95b languageName: node linkType: hard @@ -4266,73 +4242,84 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.57.0": - version: 8.57.0 - resolution: "eslint@npm:8.57.0" +"eslint-visitor-keys@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-visitor-keys@npm:4.0.0" + checksum: 10/c7617166e6291a15ce2982b5c4b9cdfb6409f5c14562712d12e2584480cdf18609694b21d7dad35b02df0fa2cd037505048ded54d2f405c64f600949564eb334 + languageName: node + linkType: hard + +"eslint@npm:^9.11.1": + version: 9.11.1 + resolution: "eslint@npm:9.11.1" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.6.1" - "@eslint/eslintrc": "npm:^2.1.4" - "@eslint/js": "npm:8.57.0" - "@humanwhocodes/config-array": "npm:^0.11.14" + "@eslint-community/regexpp": "npm:^4.11.0" + "@eslint/config-array": "npm:^0.18.0" + "@eslint/core": "npm:^0.6.0" + "@eslint/eslintrc": "npm:^3.1.0" + "@eslint/js": "npm:9.11.1" + "@eslint/plugin-kit": "npm:^0.2.0" "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.3.0" "@nodelib/fs.walk": "npm:^1.2.8" - "@ungap/structured-clone": "npm:^1.2.0" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" cross-spawn: "npm:^7.0.2" debug: "npm:^4.3.2" - doctrine: "npm:^3.0.0" escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^7.2.2" - eslint-visitor-keys: "npm:^3.4.3" - espree: "npm:^9.6.1" - esquery: "npm:^1.4.2" + eslint-scope: "npm:^8.0.2" + eslint-visitor-keys: "npm:^4.0.0" + espree: "npm:^10.1.0" + esquery: "npm:^1.5.0" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^6.0.1" + file-entry-cache: "npm:^8.0.0" find-up: "npm:^5.0.0" glob-parent: "npm:^6.0.2" - globals: "npm:^13.19.0" - graphemer: "npm:^1.4.0" ignore: "npm:^5.2.0" imurmurhash: "npm:^0.1.4" is-glob: "npm:^4.0.0" is-path-inside: "npm:^3.0.3" - js-yaml: "npm:^4.1.0" json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" lodash.merge: "npm:^4.6.2" minimatch: "npm:^3.1.2" natural-compare: "npm:^1.4.0" optionator: "npm:^0.9.3" strip-ansi: "npm:^6.0.1" text-table: "npm:^0.2.0" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true bin: eslint: bin/eslint.js - checksum: 10/00496e218b23747a7a9817bf58b522276d0dc1f2e546dceb4eea49f9871574088f72f1f069a6b560ef537efa3a75261b8ef70e51ef19033da1cc4c86a755ef15 + checksum: 10/38de03a51044a5f708c93302cff5e860355447d424f1a21fa67f5b2f0541d092d3f3807c0242820d9795553a3f1165db51769e9a042816334d05c86f015fdfef languageName: node linkType: hard -"espree@npm:^9.0.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" +"espree@npm:^10.0.1, espree@npm:^10.1.0": + version: 10.1.0 + resolution: "espree@npm:10.1.0" dependencies: - acorn: "npm:^8.9.0" + acorn: "npm:^8.12.0" acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10/255ab260f0d711a54096bdeda93adff0eadf02a6f9b92f02b323e83a2b7fc258797919437ad331efec3930475feb0142c5ecaaf3cdab4befebd336d47d3f3134 + eslint-visitor-keys: "npm:^4.0.0" + checksum: 10/a673aa39a19a51763d92272f8f3772ae3d4b10624740bb72d5f273b631b43f1a5a32b385c1da6ae6bc10be05a5913bc4679ebd22a09c7b336a745204834806ea languageName: node linkType: hard -"espree@npm:^9.6.0": - version: 9.6.0 - resolution: "espree@npm:9.6.0" +"espree@npm:^9.0.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: acorn: "npm:^8.9.0" acorn-jsx: "npm:^5.3.2" eslint-visitor-keys: "npm:^3.4.1" - checksum: 10/870834c0ab188213ba56fae7003ff9fadbad2b9285dae941840c3d425cedbb2221ad3cffaabd217bc36b96eb80d651c2a2d9b0b1f3b9394b2358b27052c942e2 + checksum: 10/255ab260f0d711a54096bdeda93adff0eadf02a6f9b92f02b323e83a2b7fc258797919437ad331efec3930475feb0142c5ecaaf3cdab4befebd336d47d3f3134 languageName: node linkType: hard @@ -4346,7 +4333,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.2, esquery@npm:^1.5.0": +"esquery@npm:^1.5.0": version: 1.5.0 resolution: "esquery@npm:1.5.0" dependencies: @@ -4573,12 +4560,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" dependencies: - flat-cache: "npm:^3.0.4" - checksum: 10/099bb9d4ab332cb93c48b14807a6918a1da87c45dce91d4b61fd40e6505d56d0697da060cb901c729c90487067d93c9243f5da3dc9c41f0358483bfdebca736b + flat-cache: "npm:^4.0.0" + checksum: 10/afe55c4de4e0d226a23c1eae62a7219aafb390859122608a89fa4df6addf55c7fd3f1a2da6f5b41e7cdff496e4cf28bbd215d53eab5c817afa96d2b40c81bfb0 languageName: node linkType: hard @@ -4684,20 +4671,20 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" dependencies: - flatted: "npm:^3.1.0" - rimraf: "npm:^3.0.2" - checksum: 10/9fe5d0cb97c988e3b25242e71346965fae22757674db3fca14206850af2efa3ca3b04a3ba0eba8d5e20fd8a3be80a2e14b1c2917e70ffe1acb98a8c3327e4c9f + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10/58ce851d9045fffc7871ce2bd718bc485ad7e777bf748c054904b87c351ff1080c2c11da00788d78738bfb51b71e4d5ea12d13b98eb36e3358851ffe495b62dc languageName: node linkType: hard -"flatted@npm:^3.1.0": - version: 3.2.0 - resolution: "flatted@npm:3.2.0" - checksum: 10/5c2547972b46cbf4954fda0beb5635517323d94808979bc26fc2b2f8a6a58d5e818b2e18ba3140b621e3e7940f32e5fef223fa2ec6c3e9ca93a8cc2592d3014f +"flatted@npm:^3.2.9": + version: 3.3.1 + resolution: "flatted@npm:3.3.1" + checksum: 10/7b8376061d5be6e0d3658bbab8bde587647f68797cf6bfeae9dea0e5137d9f27547ab92aaff3512dd9d1299086a6d61be98e9d48a56d17531b634f77faadbc49 languageName: node linkType: hard @@ -5028,12 +5015,17 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.19.0 - resolution: "globals@npm:13.19.0" - dependencies: - type-fest: "npm:^0.20.2" - checksum: 10/f365fc2a4eb21a264d0f2a6355ddf4ee32983e0817ec48a517a56d7d1944124c763e81cae13ae26fa9a7d6c7ab826b2e796f87b022a674336275da0e6249366e +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10/03939c8af95c6df5014b137cac83aa909090c3a3985caef06ee9a5a669790877af8698ab38007e4c0186873adc14c0b13764acc754b16a754c216cc56aa5f021 + languageName: node + linkType: hard + +"globals@npm:^15.7.0": + version: 15.9.0 + resolution: "globals@npm:15.9.0" + checksum: 10/19bca70131c5d3e0d4171deed0f8ae16adda19f18d39b67421056f1eaa160b4433c3ffc8eb69b8b19adebbbdad4834d8a0494c5fe1ae295f0f769a5c0331d794 languageName: node linkType: hard @@ -5044,7 +5036,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.1, globby@npm:^11.1.0": +"globby@npm:^11.0.1": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -5904,7 +5896,7 @@ __metadata: languageName: node linkType: hard -"jsonc-eslint-parser@npm:^2.4.0": +"jsonc-eslint-parser@npm:^2.0.4, jsonc-eslint-parser@npm:^2.4.0": version: 2.4.0 resolution: "jsonc-eslint-parser@npm:2.4.0" dependencies: @@ -5971,6 +5963,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:^4.5.4": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: "npm:3.0.1" + checksum: 10/167eb6ef64cc84b6fa0780ee50c9de456b422a1e18802209234f7c2cf7eae648c7741f32e50d7e24ccb22b24c13154070b01563d642755b156c357431a191e75 + languageName: node + linkType: hard + "kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -6521,16 +6522,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:9.0.3": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10/c81b47d28153e77521877649f4bab48348d10938df9e8147a58111fe00ef89559a2938de9f6632910c4f7bf7bb5cd81191a546167e58d357f0cfb1e18cecc1c5 - languageName: node - linkType: hard - -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -6842,10 +6834,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.14": - version: 2.0.14 - resolution: "node-releases@npm:2.0.14" - checksum: 10/0f7607ec7db5ef1dc616899a5f24ae90c869b6a54c2d4f36ff6d84a282ab9343c7ff3ca3670fe4669171bb1e8a9b3e286e1ef1c131f09a83d70554f855d54f24 +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: 10/241e5fa9556f1c12bafb83c6c3e94f8cf3d8f2f8f904906ecef6e10bcaa1d59aa61212d4651bec70052015fc54bd3fdcdbe7fc0f638a17e6685aa586c076ec4e languageName: node linkType: hard @@ -7347,13 +7339,20 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:1.0.0, picocolors@npm:^1.0.0": +"picocolors@npm:1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" checksum: 10/a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 languageName: node linkType: hard +"picocolors@npm:^1.0.1": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: 10/a2ad60d94d185c30f2a140b19c512547713fb89b920d32cc6cf658fa786d63a37ba7b8451872c3d9fc34883971fb6e5878e07a20b60506e0bb2554dce9169ccb + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.3": version: 2.3.0 resolution: "picomatch@npm:2.3.0" @@ -8071,6 +8070,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.6.1": + version: 7.6.3 + resolution: "semver@npm:7.6.3" + bin: + semver: bin/semver.js + checksum: 10/36b1fbe1a2b6f873559cd57b238f1094a053dbfd997ceeb8757d79d1d2089c56d1321b9f1069ce263dc64cfa922fa1d2ad566b39426fe1ac6c723c1487589e10 + languageName: node + linkType: hard + "semver@npm:^7.6.2": version: 7.6.2 resolution: "semver@npm:7.6.2" @@ -8578,6 +8586,15 @@ __metadata: languageName: node linkType: hard +"synckit@npm:^0.6.0": + version: 0.6.2 + resolution: "synckit@npm:0.6.2" + dependencies: + tslib: "npm:^2.3.1" + checksum: 10/9641f4a4f113b7d6a810c34870947c1f19b7a736b510211c0ea69b05aed530d9aa52cb4942f0988a72514ce9fda61011e913c52fa86c58ebf56901d54c2fe241 + languageName: node + linkType: hard + "tar@npm:^6.0.2, tar@npm:^6.1.0, tar@npm:^6.1.11, tar@npm:^6.1.13": version: 6.2.1 resolution: "tar@npm:6.2.1" @@ -8708,15 +8725,6 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^1.0.1": - version: 1.0.2 - resolution: "ts-api-utils@npm:1.0.2" - peerDependencies: - typescript: ">=4.2.0" - checksum: 10/d095281048ff6423653599f61ce92f6783ba0880d76d081fc7597c5bc672f20079fc4dea9a6ec752ebcb4c90d2baab293ec159270c22e65f49c7abe1078e5d44 - languageName: node - linkType: hard - "ts-api-utils@npm:^1.3.0": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" @@ -8906,13 +8914,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.20.2": - version: 0.20.2 - resolution: "type-fest@npm:0.20.2" - checksum: 10/8907e16284b2d6cfa4f4817e93520121941baba36b39219ea36acfe64c86b9dbc10c9941af450bd60832c8f43464974d51c0957f9858bc66b952b66b6914cbb9 - languageName: node - linkType: hard - "type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" @@ -8941,6 +8942,20 @@ __metadata: languageName: node linkType: hard +"typescript-eslint@npm:^8.7.0": + version: 8.7.0 + resolution: "typescript-eslint@npm:8.7.0" + dependencies: + "@typescript-eslint/eslint-plugin": "npm:8.7.0" + "@typescript-eslint/parser": "npm:8.7.0" + "@typescript-eslint/utils": "npm:8.7.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/03db77621e24727cbc3c89a6ee5c87e6e407eb314da56561845248f07886f291c3533caa99fe22cfa262c02f588cd109c0f13a397769eead4e3c92ca62c39aec + languageName: node + linkType: hard + "typescript@npm:5.4.2": version: 5.4.2 resolution: "typescript@npm:5.4.2" @@ -9050,17 +9065,17 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.13": - version: 1.0.13 - resolution: "update-browserslist-db@npm:1.0.13" +"update-browserslist-db@npm:^1.1.0": + version: 1.1.0 + resolution: "update-browserslist-db@npm:1.1.0" dependencies: - escalade: "npm:^3.1.1" - picocolors: "npm:^1.0.0" + escalade: "npm:^3.1.2" + picocolors: "npm:^1.0.1" peerDependencies: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 10/9074b4ef34d2ed931f27d390aafdd391ee7c45ad83c508e8fed6aaae1eb68f81999a768ed8525c6f88d4001a4fbf1b8c0268f099d0e8e72088ec5945ac796acf + checksum: 10/d70b9efeaf4601aadb1a4f6456a7a5d9118e0063d995866b8e0c5e0cf559482671dab6ce7b079f9536b06758a344fbd83f974b965211e1c6e8d1958540b0c24c languageName: node linkType: hard