From c580f69acc4f2cf32ca1f769d9f6e73480020bbd Mon Sep 17 00:00:00 2001 From: double beep <38133098+double-beep@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:01:03 +0000 Subject: [PATCH] breaking: upgrade to eslint v9 --- .eslintrc.json | 50 -- eslint.config.js | 54 ++ package-lock.json | 737 ++++++++++++++------------ package.json | 14 +- src/cli.ts | 20 +- src/generate.ts | 42 +- src/generators/common/index.ts | 15 +- src/generators/common/monkey.ts | 12 +- src/generators/custom.ts | 4 +- src/generators/greasemonkey/index.ts | 8 +- src/generators/greasemonkey/types.ts | 2 +- src/generators/index.ts | 58 +- src/generators/tampermonkey/index.ts | 10 +- src/generators/tampermonkey/types.ts | 2 +- src/generators/violentmonkey/index.ts | 12 +- src/generators/violentmonkey/types.ts | 2 +- src/index.ts | 2 +- src/linters/index.ts | 21 +- src/utils/author.ts | 4 +- src/utils/filesystem.ts | 6 +- src/utils/name.ts | 6 +- src/utils/package.ts | 17 +- src/utils/scraper.ts | 16 +- src/utils/types.ts | 4 +- src/utils/urls.ts | 4 +- src/utils/validators.ts | 56 +- 26 files changed, 612 insertions(+), 566 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 34238c0..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/eslintrc.json", - "noInlineConfig": true, - "ignorePatterns": "", - "env": { - "browser": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "project": "./tsconfig.json" - }, - "plugins": ["@typescript-eslint"], - "rules": { - "arrow-parens": "error", - "arrow-spacing": "error", - "brace-style": ["error", "1tbs", { "allowSingleLine": true }], - "dot-notation": "error", - "eqeqeq": "error", - "indent": ["error", 4, { "SwitchCase": 1 }], - "keyword-spacing": "error", - "no-alert": "error", - "no-await-in-loop": "off", - "no-implicit-coercion": "off", - "no-loop-func": "error", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-multiple-empty-lines": "error", - "no-trailing-spaces": "error", - "no-useless-return": "off", - "no-var": "error", - "prefer-arrow-callback": "error", - "prefer-const": "error", - "quotes": [2, "double", { "avoidEscape": true }], - "require-await": "error", - "semi": "error", - "space-in-parens": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-misused-promises": [ - "error", - { "checksVoidReturn": false } - ], - "func-call-spacing": "error", - "no-param-reassign": "error", - "no-tabs": "error", - "no-undefined": "error", - "no-unneeded-ternary": "error", - "no-unused-expressions": "error" - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..75e306b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,54 @@ +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; +import stylistic from "@stylistic/eslint-plugin"; +import globals from "globals"; + +export default tseslint.config({ + extends: [ + eslint.configs.recommended, + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + ...tseslint.configs.recommendedTypeChecked, + stylistic.configs.customize({ + quotes: "double", + indent: 4, + semi: true, + }), + { + languageOptions: { + parserOptions: { + project: true, + tsconfigRootDir: import.meta.dirname, + }, + globals: { + ...globals.browser, + StackExchange: "readonly" + }, + }, + }, + ], + rules: { + "eqeqeq": "error", + "no-await-in-loop": "off", + "no-implicit-coercion": "off", + "no-loop-func": "error", + "no-useless-return": "off", + "no-var": "error", + "no-undefined": "error", + "no-unneeded-ternary": "error", + "no-param-reassign": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "require-await": "error", + + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { "checksVoidReturn": false } + ], + "@typescript-eslint/prefer-nullish-coalescing": "off", + + "@stylistic/arrow-parens": "error", + "@stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }], + } +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2bb7422..b68d243 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,25 +19,25 @@ "generate-headers": "dist/cli.js" }, "devDependencies": { + "@eslint/js": "^9.11.1", + "@stylistic/eslint-plugin": "^2.8.0", "@types/chai": "5.0.0", - "@types/eslint": "^8.56.12", + "@types/eslint": "^9.6.1", "@types/mocha": "^10.0.8", - "@types/node": "^22.7.0", + "@types/node": "^22.7.3", "@types/semver": "^7.5.8", "@types/sinon": "^17.0.3", "@types/tampermonkey": "^5.0.3", "@types/validator": "^13.12.2", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", "@userscripters/generate-readme": "^3.0.2", "@userscripters/generate-stackapps": "^1.3.0", "chai": "^5.1.1", - "eslint": "^8.57.1", "mocha": "^10.7.3", "sinon": "^19.0.2", "ts-node": "^10.9.2", - "typescript": "^5.6.2" + "typescript": "^5.6.2", + "typescript-eslint": "^8.7.0" } }, "node_modules/@cspotcode/source-map-support": { @@ -68,6 +68,18 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint-community/regexpp": { "version": "4.11.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", @@ -77,44 +89,38 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "license": "MIT", + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "license": "Apache-2.0", + "peer": true, "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "node_modules/@eslint/config-array/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "node_modules/@eslint/config-array/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -122,45 +128,57 @@ "node": "*" } }, - "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", - "license": "MIT", + "node_modules/@eslint/core": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", + "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "license": "Apache-2.0", + "peer": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", - "license": "Apache-2.0", + "node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "license": "MIT", + "peer": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=10.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -168,11 +186,44 @@ "node": "*" } }, + "node_modules/@eslint/js": { + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.11.1.tgz", + "integrity": "sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==", + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", + "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=12.22" }, @@ -181,12 +232,19 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "license": "BSD-3-Clause" + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", @@ -300,6 +358,26 @@ "dev": true, "license": "(Unlicense OR Apache-2.0)" }, + "node_modules/@stylistic/eslint-plugin": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.8.0.tgz", + "integrity": "sha512-Ufvk7hP+bf+pD35R/QfunF793XlSRIC7USr3/EdgduK9j13i2JjmsM0LUz3/foS+jDYp2fzyWZA9N44CPur0Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^8.4.0", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", @@ -336,9 +414,9 @@ "license": "MIT" }, "node_modules/@types/eslint": { - "version": "8.56.12", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", - "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "license": "MIT", "dependencies": { @@ -350,14 +428,12 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, "license": "MIT" }, "node_modules/@types/mocha": { @@ -368,9 +444,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.0.tgz", - "integrity": "sha512-MOdOibwBs6KW1vfqz2uKMlxq5xAfAZ98SZjO8e3XnAbFnTJtAspqhWk7hrdSAs9/Y14ZWMiy7/MxMUzAOadYEw==", + "version": "22.7.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", + "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", "dev": true, "license": "MIT", "dependencies": { @@ -433,32 +509,32 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.7.0.tgz", + "integrity": "sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.7.0", + "@typescript-eslint/type-utils": "8.7.0", + "@typescript-eslint/utils": "8.7.0", + "@typescript-eslint/visitor-keys": "8.7.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "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": { @@ -467,27 +543,27 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.7.0.tgz", + "integrity": "sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.7.0", + "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/typescript-estree": "8.7.0", + "@typescript-eslint/visitor-keys": "8.7.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -496,17 +572,17 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.7.0.tgz", + "integrity": "sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/visitor-keys": "8.7.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -514,27 +590,24 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.7.0.tgz", + "integrity": "sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.7.0", + "@typescript-eslint/utils": "8.7.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^8.56.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -542,13 +615,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.7.0.tgz", + "integrity": "sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -556,23 +629,23 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.7.0.tgz", + "integrity": "sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/visitor-keys": "8.7.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -585,51 +658,58 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.7.0.tgz", + "integrity": "sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.7.0", + "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/typescript-estree": "8.7.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.7.0.tgz", + "integrity": "sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.7.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "license": "ISC" + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/@userscripters/generate-readme": { "version": "3.0.2", @@ -697,6 +777,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -756,6 +837,19 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -769,16 +863,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -843,6 +927,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -973,7 +1058,8 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/create-require": { "version": "1.1.1", @@ -987,6 +1073,7 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "license": "MIT", + "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1040,7 +1127,8 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/diff": { "version": "5.2.0", @@ -1052,31 +1140,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1105,43 +1168,43 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.11.1.tgz", + "integrity": "sha512-MobhYKIoAO1s1e4VUrgx1l1Sk2JBR/Gqjjgw8+mfgoLE2xwsHur4gdfTxyTgShrhvdVFTaJSgMiQBl1jv/AWxg==", "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.6.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.11.1", + "@eslint/plugin-kit": "^0.2.0", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -1153,10 +1216,18 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-plugin-userscripts": { @@ -1175,28 +1246,29 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1207,6 +1279,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1217,6 +1290,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1233,6 +1307,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1245,6 +1320,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -1253,17 +1329,17 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.12.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1274,6 +1350,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -1286,6 +1363,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -1307,6 +1385,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -1315,7 +1394,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-glob": { "version": "3.3.2", @@ -1351,13 +1431,15 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fastq": { "version": "1.17.1", @@ -1369,15 +1451,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "license": "MIT", + "peer": true, "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -1420,29 +1503,31 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "license": "MIT", + "peer": true, "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -1505,6 +1590,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "license": "ISC", + "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -1526,36 +1612,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, + "peer": true, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1565,6 +1628,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, "license": "MIT" }, "node_modules/has-flag": { @@ -1600,6 +1664,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "license": "MIT", + "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1616,6 +1681,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.8.19" } @@ -1625,6 +1691,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -1635,6 +1702,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, "license": "ISC" }, "node_modules/is-binary-path": { @@ -1695,6 +1763,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -1726,7 +1795,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/js-yaml": { "version": "4.1.0", @@ -1744,19 +1814,22 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/just-extend": { "version": "6.2.0", @@ -1770,6 +1843,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "license": "MIT", + "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -1779,6 +1853,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -1813,7 +1888,8 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/log-symbols": { "version": "4.1.0", @@ -1903,6 +1979,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -2039,6 +2128,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -2049,6 +2139,7 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "license": "MIT", + "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -2096,6 +2187,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "license": "MIT", + "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -2112,44 +2204,26 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } }, "node_modules/path-to-regexp": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.1.0.tgz", - "integrity": "sha512-Bqn3vc8CMHty6zuD+tG23s6v2kwxslHEhTj4eYaVKGIEB+YX/2wd0/rgXLFD9G9id9KCtbVy/3ZgmvZjpa0UdQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", "dev": true, "license": "MIT", "engines": { "node": ">=16" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", @@ -2161,13 +2235,13 @@ } }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -2178,6 +2252,7 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -2187,6 +2262,7 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -2234,6 +2310,19 @@ "node": ">=8.10.0" } }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2248,6 +2337,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "license": "MIT", + "peer": true, "engines": { "node": ">=4" } @@ -2262,65 +2352,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -2392,6 +2423,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "license": "MIT", + "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -2404,6 +2436,7 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -2450,16 +2483,6 @@ "node": ">=8" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2518,7 +2541,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/to-regex-range": { "version": "5.0.1", @@ -2605,6 +2629,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -2622,18 +2647,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { "version": "5.6.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", @@ -2648,6 +2661,30 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.7.0.tgz", + "integrity": "sha512-nEHbEYJyHwsuf7c3V3RS7Saq+1+la3i0ieR3qP0yjqWSzVmh8Drp47uOl9LjbPANac4S7EFSqvcYIKXUUwIfIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.7.0", + "@typescript-eslint/parser": "8.7.0", + "@typescript-eslint/utils": "8.7.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", @@ -2660,6 +2697,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -2685,6 +2723,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "license": "ISC", + "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -2700,6 +2739,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -2732,6 +2772,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, "license": "ISC" }, "node_modules/y18n": { diff --git a/package.json b/package.json index 77e853e..b524f0d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "icon": "", "scripts": { "test": "TS_NODE_PROJECT='./test/tsconfig.json' mocha", - "lint": "eslint src --fix --ext .js,.ts", + "lint": "eslint src", "clean": "rm -rf dist", "prebuild": "npm run lint && npm run clean", "build": "tsc --outDir dist && npm run executable", @@ -42,25 +42,25 @@ }, "homepage": "https://github.com/userscripters/generate-headers#readme", "devDependencies": { + "@eslint/js": "^9.11.1", + "@stylistic/eslint-plugin": "^2.8.0", "@types/chai": "5.0.0", - "@types/eslint": "^8.56.12", + "@types/eslint": "^9.6.1", "@types/mocha": "^10.0.8", - "@types/node": "^22.7.0", + "@types/node": "^22.7.3", "@types/semver": "^7.5.8", "@types/sinon": "^17.0.3", "@types/tampermonkey": "^5.0.3", "@types/validator": "^13.12.2", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", "@userscripters/generate-readme": "^3.0.2", "@userscripters/generate-stackapps": "^1.3.0", "chai": "^5.1.1", - "eslint": "^8.57.1", "mocha": "^10.7.3", "sinon": "^19.0.2", "ts-node": "^10.9.2", - "typescript": "^5.6.2" + "typescript": "^5.6.2", + "typescript-eslint": "^8.7.0" }, "dependencies": { "chalk": "^5.3.0", diff --git a/src/cli.ts b/src/cli.ts index e8aceb2..f4779ba 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -34,7 +34,7 @@ const sharedOpts = { du: { alias: "download-url", description: "URL for the @downloadURL header", - type: "string" + type: "string", }, e: { alias: "eol", @@ -99,7 +99,7 @@ const sharedOpts = { q: { alias: "require", description: "Generates valid @require headers (repeatable)", - type: "array" + type: "array", }, r: { alias: "run", @@ -116,7 +116,7 @@ const sharedOpts = { u: { alias: "update-url", description: "URL for the @updateURL header for Tampermonkey, no-op otherwise", - type: "string" + type: "string", }, w: { alias: "whitelist", @@ -135,7 +135,7 @@ const sharedOpts = { }, } as const; -names.forEach((name) => +names.forEach(name => cli.command( name, `generates ${scase(name)} headers`, @@ -143,7 +143,7 @@ names.forEach((name) => ({ c, ch = [], d, du, e, h, g = [], i, l, lf, m = [], n, nf, q = [], o, p, r = "start", s, pretty, u, w = [], x = [] }) => void generate(name, { collapse: c, - // @ts-expect-error + // @ts-expect-error ignore next line custom: ch, direct: !!d, downloadURL: du, @@ -164,11 +164,11 @@ names.forEach((name) => spaces: s, pretty, updateURL: u, - whitelist: w.map(String) + whitelist: w.map(String), }, - import.meta.url === pathToFileURL(process.argv[1]).href - ) - ) + import.meta.url === pathToFileURL(process.argv[1]).href, + ), + ), ); -cli.demandCommand().help().parse(); +void cli.demandCommand().help().parse(); diff --git a/src/generate.ts b/src/generate.ts index b7b8852..f3f154e 100644 --- a/src/generate.ts +++ b/src/generate.ts @@ -6,7 +6,7 @@ import { generateGreasemonkeyHeaders } from "./generators/greasemonkey/index.js" import type { GrantOptions, HeaderGenerator, - UserScriptManagerName + UserScriptManagerName, } from "./generators/index.js"; import { generateTampermonkeyHeaders } from "./generators/tampermonkey/index.js"; import { generateViolentmonkeyHeaders } from "./generators/violentmonkey/index.js"; @@ -19,7 +19,7 @@ import { validateExcludeHeaders, validateMatchHeaders, validateOptionalHeaders, - validateRequiredHeaders + validateRequiredHeaders, } from "./utils/validators.js"; export type RunAtOption = "start" | "end" | "idle" | "body" | "menu"; @@ -44,18 +44,18 @@ export type GeneratorOptions = CommonGeneratorOptions & run?: RunAtOption; spaces?: number; updateURL?: string; - whitelist?: Array<"self" | "localhost" | "*"> | string[]; + whitelist?: ("self" | "localhost" | "*")[] | string[]; }; -export type WriteHeadersOptions = { +export interface WriteHeadersOptions { cli: boolean; direct: boolean; eol?: string; output: string; -}; +} export const managersSupportingHomepage = new Set( - ["tampermonkey", "violentmonkey"] + ["tampermonkey", "violentmonkey"], ); /** @@ -79,11 +79,11 @@ export const writeHeaders = async (content: string, options: WriteHeadersOptions return content; } - await replaceFileContent(output, 0, 0, `${content}${eol}`); + await replaceFileContent(output, 0, 0, `${content}${eol || ""}`); return content; } - //running from CLI with file emit disabled + // running from CLI with file emit disabled if (cli) process.stdout.write(content); return content; @@ -98,7 +98,7 @@ export const writeHeaders = async (content: string, options: WriteHeadersOptions export const generate = async ( type: UserScriptManagerName, options: GeneratorOptions, - cli = false + cli = false, ): Promise => { const { packagePath, @@ -132,7 +132,7 @@ export const generate = async ( const { invalid: matchInvalid, status: matchStatus, - valid: validMatches + valid: validMatches, } = validateMatchHeaders(matches); if (!matchStatus) { console.error(chulk.bgRed`Invalid @match headers:\n` + matchInvalid.join("\n")); @@ -141,7 +141,7 @@ export const generate = async ( const { invalid: excludeInvalid, status: excludeStatus, - valid: validExcludes + valid: validExcludes, } = validateExcludeHeaders(excludes); if (!excludeStatus) { console.error(chulk.bgRed`Invalid @exclude headers:\n` + excludeInvalid.join("\n")); @@ -150,7 +150,7 @@ export const generate = async ( const { invalid: connectInvalid, status: connectStatus, - valid: validConnects + valid: validConnects, } = validateConnectHeaders(whitelist); if (!connectStatus) { console.error(chulk.bgRed`Invalid @connect headers:\n` + connectInvalid.join("\n")); @@ -169,7 +169,7 @@ export const generate = async ( const { isValidDownloadURL } = validateOptionalHeaders(options); - if (!isValidDownloadURL) { + if (!isValidDownloadURL && options.downloadURL) { console.error(chulk.bgRed`Invalid @downloadURL:\n` + options.downloadURL); } @@ -203,22 +203,24 @@ export const generate = async ( isHomepageAllowed: managersSupportingHomepage.has(type), }); if (error) console.error(error); // 'error' contains a preformatted string - return writeHeaders(headers, { cli, direct, eol, output }); + return await writeHeaders(headers, { cli, direct, eol, output }); } - return writeHeaders(content, { cli, direct, eol, output }); + return await writeHeaders(content, { cli, direct, eol, output }); } catch (error) { const exceptionObject = error as NodeJS.ErrnoException; const { code, name } = exceptionObject; - const errMap: { - [code: string]: (err: NodeJS.ErrnoException) => [string, string]; - } = { - ENOENT: ({ path }) => ["Missing path:", path!], + const errMap: Record< + "ENOENT" | "ENOTFOUND" | "default", + (err: NodeJS.ErrnoException) => [string, string] + > = { + ENOENT: ({ path }) => ["Missing path:", path || ""], ENOTFOUND: ({ message }) => ["Network failure:", message], default: ({ message }) => ["Something went wrong:", message], }; - const handler = errMap[code || "default"] || errMap.default; + const key = code === "ENOENT" || code === "ENOTFOUND" ? code : "default"; + const handler = errMap[key]; const [postfix, message] = handler(exceptionObject); diff --git a/src/generators/common/index.ts b/src/generators/common/index.ts index acb1d58..cc35d81 100644 --- a/src/generators/common/index.ts +++ b/src/generators/common/index.ts @@ -3,6 +3,7 @@ import { parseName, prettifyName } from "../../utils/name.js"; import type { PackageInfo, PackagePerson } from "../../utils/package.js"; import type { HeaderEntries } from "../index.js"; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export type CommonHeaders = T & { author: PackagePerson; contributors?: PackagePerson[]; @@ -27,11 +28,11 @@ export type CommonGrants = "none" | "unsafeWindow"; export type CommonRunAt = "document-start" | "document-end" | "document-idle"; -export type CommonGeneratorOptions = { +export interface CommonGeneratorOptions { namespace?: string; noframes?: boolean; pretty?: boolean; -} +}; /** * @summary generates headers common to all userscript managers @@ -40,12 +41,12 @@ export type CommonGeneratorOptions = { */ export const generateCommonHeaders = ( pkg: PackageInfo, - options: CommonGeneratorOptions + options: CommonGeneratorOptions, ) => { const { namespace, noframes = false, - pretty = false + pretty = false, } = options; const { @@ -55,7 +56,7 @@ export const generateCommonHeaders = ( version, icon, contributors = [], - license + license, } = pkg; const parsedAuthor = parseAuthor(author); @@ -76,8 +77,8 @@ export const generateCommonHeaders = ( if (noframes) headers.push(["noframes", ""]); if (contributors.length) { - const formatted = contributors.map((contributor) => - formatAuthor(parseAuthor(contributor)) + const formatted = contributors.map(contributor => + formatAuthor(parseAuthor(contributor)), ); headers.push(["contributors", formatted.join(", ")]); } diff --git a/src/generators/common/monkey.ts b/src/generators/common/monkey.ts index 56f2205..59e8678 100644 --- a/src/generators/common/monkey.ts +++ b/src/generators/common/monkey.ts @@ -10,7 +10,7 @@ export type MonkeyHeader = `// @${string} ${string}` | `// @${string}`; * @param name optional script name (defaults to UserScript) */ export const makeMonkeyTags = ( - name = "UserScript" + name = "UserScript", ): readonly [openTag: string, closeTag: string] => [ `// ==${name}==`, `// ==/${name}==`, @@ -21,8 +21,8 @@ export const makeMonkeyTags = ( * @param header name-value header entry */ export const makeMonkeyHeader = (header: HeaderEntry) => { - const [name, value,] = header; - return (value ? `// @${name} ${value}` : `// @${name}`); + const [name, value] = header; + return (value ? `// @${name} ${value}` : `// @${name}`) as MonkeyHeader; }; /** @@ -32,15 +32,15 @@ export const makeMonkeyHeader = (header: HeaderEntry */ export const finalizeMonkeyHeaders = >( headers: HeaderEntries, - spaces: number + spaces: number, ) => { const [openTag, closeTag] = makeMonkeyTags(); - const longest = getLongest(headers.map(([key]) => key as string)) + spaces - 1; + const longest = getLongest(headers.map(([key]) => key)) + spaces - 1; // @name header should come first, the rest are sorted alphabetically const sortedHeaders: HeaderEntries = headers.sort( - ([a], [b]) => a === "name" ? -1 : a < b ? -1 : 1 + ([a], [b]) => a === "name" ? -1 : a < b ? -1 : 1, ); const indentedHeaders: HeaderEntries = sortedHeaders.map(([key, val]) => [ diff --git a/src/generators/custom.ts b/src/generators/custom.ts index 3c3768d..41896e0 100644 --- a/src/generators/custom.ts +++ b/src/generators/custom.ts @@ -1,6 +1,6 @@ import type { HeaderEntries } from "./index.js"; -export type CustomHeaders = { contributors: string; } & { [name: string]: string; }; +export type CustomHeaders = { contributors: string } & Record; /** * @summary generates custom headers not built-in to any of the managers @@ -11,4 +11,4 @@ export const generateCustomHeaders = (custom: string[]): HeaderEntries = - async (packageInfo, options) => { +export const generateGreasemonkeyHeaders: HeaderGenerator + = async (packageInfo, options) => { const { collapse = false, custom = [], diff --git a/src/generators/greasemonkey/types.ts b/src/generators/greasemonkey/types.ts index 9cfb839..02f0282 100644 --- a/src/generators/greasemonkey/types.ts +++ b/src/generators/greasemonkey/types.ts @@ -2,7 +2,7 @@ import type { CommonGrantOptions, CommonGrants, CommonHeaders, - CommonRunAt + CommonRunAt, } from "../common/index.js"; import type { CustomHeaders } from "../custom.js"; diff --git a/src/generators/index.ts b/src/generators/index.ts index 710188e..c632679 100644 --- a/src/generators/index.ts +++ b/src/generators/index.ts @@ -10,12 +10,6 @@ import type { GreasemonkeyGrantOptions } from "./greasemonkey/types.js"; import type { TampermonkeyGrantOptions } from "./tampermonkey/types.js"; import type { ViolentmonkeyGrantOptions } from "./violentmonkey/types.js"; -declare global { - interface String { - padEnd(maxLength: number, fillString?: string): T; - } -} - export type GrantOptions = | GreasemonkeyGrantOptions | TampermonkeyGrantOptions @@ -41,19 +35,19 @@ export type HeaderEntries = HeaderEntry[]; */ export const generateGrantHeaders = < T extends CommonHeaders, - U extends GrantOptions + U extends GrantOptions, >( - grantMap: Record, - grants: U[] - ) => { - if (grants.find((g) => g === "all")) { + grantMap: Record, + grants: U[], +) => { + if (grants.find(g => g === "all")) { return Object.entries(grantMap).map(([, v]) => [ "grant", v, ]) as HeaderEntries; } - const headers: HeaderEntries = grants.map((g) => ["grant", grantMap[g]]); + const headers: HeaderEntries = grants.map(g => ["grant", grantMap[g]]); return headers.length ? headers @@ -67,17 +61,17 @@ export const generateGrantHeaders = < export const generateExcludeHeaders = ( excludes: string[], ): HeaderEntries => { - return excludes.flatMap(explodePaths).map((uri) => ["exclude", uri]); + return excludes.flatMap(explodePaths).map(uri => ["exclude", uri]); }; /** * @summary abstract '@exclude-match' header generator * @param excludes list of patterns to exclude */ -export const generateExcludeMatchHeaders = ( +export const generateExcludeMatchHeaders = ( excludes: string[], ): HeaderEntries => { - return excludes.flatMap(explodePaths).map((uri) => ["exclude-match", uri]); + return excludes.flatMap(explodePaths).map(uri => ["exclude-match", uri]); }; /** @@ -86,27 +80,27 @@ export const generateExcludeMatchHeaders = ( matches: string[], networkSiteScraper: () => Promise, - collapse = true + collapse = true, ): Promise> => { if (matches.includes("all")) { - const match = - matches.find((m) => /domain/.test(m)) || "https://domain/*"; + const match + = matches.find(m => m.includes("domain")) || "https://domain/*"; const sites = await networkSiteScraper(); if (matches.includes("meta")) { const metaSites = sites.flatMap(({ site, ...rest }) => { - return collapse && /stackexchange/.test(site) || /stackapps/.test(site) ? [] : [{ - ...rest, site: site.replace(/^(.+?\.(?=.+\.)|)/, "$1meta.") - }]; + return collapse && (site.includes("stackexchange") || site.includes("stackapps")) + ? [] + : [{ ...rest, site: site.replace(/^(.+?\.(?=.+\.)|)/, "$1meta.") }]; }); sites.push(...metaSites); } const all = sites.map(({ site }) => { - const domain = - collapse && /stackexchange/.test(site) + const domain + = collapse && site.includes("stackexchange") ? "*.stackexchange.com" : site; return match.replace("domain", domain); @@ -115,15 +109,15 @@ export const generateMatchHeaders = async ( return generateMatchHeaders(uniquify(all), networkSiteScraper); } - return matches.flatMap(explodePaths).map((uri) => ["match", uri]); + return matches.flatMap(explodePaths).map(uri => ["match", uri]); }; /** * @summary abstract '@run-at' header generator */ export const generateRunAtHeaders = ( - runAtMap: { [P in RunAtOption]?: T["run-at"] } & { [x: string]: unknown }, - runAt: T["run-at"] + runAtMap: { [P in RunAtOption]?: T["run-at"] } & Record, + runAt: T["run-at"], ) => { const runsAt = runAtMap[runAt]; return runsAt @@ -135,12 +129,12 @@ export const generateRunAtHeaders = ( * @summary abstract '@require' header generator */ export const generateRequireHeaders = ( - requires: string[] -): HeaderEntries<{ require: string; }> => { + requires: string[], +): HeaderEntries<{ require: string }> => { return requires - .filter((url) => validator.isURL(url, { - allow_protocol_relative_urls: true + .filter(url => validator.isURL(url, { + allow_protocol_relative_urls: true, })) .flatMap(explodePaths) - .map((url) => ["require", url]); -}; \ No newline at end of file + .map(url => ["require", url]); +}; diff --git a/src/generators/tampermonkey/index.ts b/src/generators/tampermonkey/index.ts index bdaf4c2..b60f763 100644 --- a/src/generators/tampermonkey/index.ts +++ b/src/generators/tampermonkey/index.ts @@ -10,12 +10,12 @@ import { generateRequireHeaders, generateRunAtHeaders, type HeaderEntries, - type HeaderGenerator + type HeaderGenerator, } from "../index.js"; import type { TampermonkeyGrantOptions, TampermonkeyGrants, - TampermonkeyHeaders + TampermonkeyHeaders, } from "./types.js"; /** @@ -25,8 +25,8 @@ import type { * @param packageInfo parsed {@link PackageInfo} * @param options generator configuration */ -export const generateTampermonkeyHeaders: HeaderGenerator = - async (packageInfo, options) => { +export const generateTampermonkeyHeaders: HeaderGenerator + = async (packageInfo, options) => { const { collapse = false, custom = [], @@ -116,7 +116,7 @@ export const generateTampermonkeyHeaders: HeaderGenerator = - async (packageInfo, options) => { +export const generateViolentmonkeyHeaders: HeaderGenerator + = async (packageInfo, options) => { const { collapse = false, custom = [], @@ -48,8 +48,8 @@ export const generateViolentmonkeyHeaders: HeaderGenerator = - { + const grantMap: Record + = { set: "GM_setValue", get: "GM_getValue", list: "GM_listValues", diff --git a/src/generators/violentmonkey/types.ts b/src/generators/violentmonkey/types.ts index c973e91..fbc8e58 100644 --- a/src/generators/violentmonkey/types.ts +++ b/src/generators/violentmonkey/types.ts @@ -2,7 +2,7 @@ import type { CommonGrantOptions, CommonGrants, CommonHeaders, - CommonRunAt + CommonRunAt, } from "../common/index.js"; import type { CustomHeaders } from "../custom.js"; diff --git a/src/index.ts b/src/index.ts index 49e7994..6a12b24 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,4 +2,4 @@ import { generate, type GeneratorOptions, type RunAtOption } from "./generate.js export { generate, GeneratorOptions, RunAtOption }; -export default generate; \ No newline at end of file +export default generate; diff --git a/src/linters/index.ts b/src/linters/index.ts index aec21f6..d6e6e67 100644 --- a/src/linters/index.ts +++ b/src/linters/index.ts @@ -1,16 +1,16 @@ import { ESLint } from "eslint"; -import { configs } from "eslint-plugin-userscripts"; +import userscripts from "eslint-plugin-userscripts"; -export type LintOptions = { +export interface LintOptions { fix?: boolean; isHomepageAllowed?: boolean; spaces?: number; -}; +} -export type LintResult = { +export interface LintResult { error: string; headers: string; -}; +} /** * @summary lints generated userscript headers @@ -22,14 +22,15 @@ export const lintHeaders = async (metadataBlock: string, options: LintOptions = const eslint = new ESLint({ baseConfig: { - plugins: ["userscripts"], + plugins: { userscripts }, rules: { - ...configs.recommended.rules, + ...userscripts.configs.recommended.rules, "userscripts/align-attributes": ["error", spaces], "userscripts/use-homepage-and-url": isHomepageAllowed ? "error" : "off", + "userscripts/filename-user": "off", }, }, - useEslintrc: false, + overrideConfigFile: true, fix, }); @@ -41,6 +42,6 @@ export const lintHeaders = async (metadataBlock: string, options: LintOptions = return { error: await formatter.format(results), - headers: fix && output ? output : metadataBlock + headers: fix && output ? output : metadataBlock, }; -}; \ No newline at end of file +}; diff --git a/src/utils/author.ts b/src/utils/author.ts index 9e5a4af..930bc69 100644 --- a/src/utils/author.ts +++ b/src/utils/author.ts @@ -8,7 +8,7 @@ export const formatAuthor = ({ name + (email ? ` <${email}>` : "") + (url ? ` (${url})` : ""); export const parseAuthor = ( - info: PackageInfo["author"] + info: PackageInfo["author"], ): Exclude => { if (typeof info === "object") return info; @@ -18,7 +18,7 @@ export const parseAuthor = ( if (!match) throw new Error(`unable to parse author field: ${info}`); - const [_full, name, email, url] = match; + const [, name, email, url] = match; return { name, diff --git a/src/utils/filesystem.ts b/src/utils/filesystem.ts index 8ea6dba..bdfe65b 100644 --- a/src/utils/filesystem.ts +++ b/src/utils/filesystem.ts @@ -9,7 +9,7 @@ export const replaceFileContent = async ( pathlike: string | URL, startOffset: number, endOffset: number, - newContent: string + newContent: string, ) => { const { writeFile, readFile } = await import("fs/promises"); @@ -18,8 +18,8 @@ export const replaceFileContent = async ( const update = Buffer.concat([ original.subarray(0, startOffset), Buffer.from(newContent), - original.subarray(endOffset) + original.subarray(endOffset), ]); return writeFile(pathlike, update); -}; \ No newline at end of file +}; diff --git a/src/utils/name.ts b/src/utils/name.ts index 5bf767d..452d544 100644 --- a/src/utils/name.ts +++ b/src/utils/name.ts @@ -1,16 +1,16 @@ import { scase } from "./common.js"; -export type ParsedName = { +export interface ParsedName { scope?: string; packageName: string; -}; +} /** * @summary parses a given name into an scope and unscoped package name pair * @param name scoped package name */ export const parseName = (name: string): ParsedName => { - const [, scope, packageName] = name.match(/(?:@([\w-]+)\/)?([\w-]+)/) || []; + const [, scope, packageName] = (/(?:@([\w-]+)\/)?([\w-]+)/.exec(name)) || []; return { scope, packageName }; }; diff --git a/src/utils/package.ts b/src/utils/package.ts index dcdd3b4..c1ba735 100644 --- a/src/utils/package.ts +++ b/src/utils/package.ts @@ -3,12 +3,12 @@ import { readFile } from "fs/promises"; export type PackagePerson = | string | { - name: string; - email?: string; - url?: string; - }; + name: string; + email?: string; + url?: string; + }; -export type PackageInfo = { +export interface PackageInfo { author: PackagePerson; contributors?: PackagePerson[]; icon?: string; @@ -25,7 +25,7 @@ export type PackageInfo = { type: "git" | "https"; url: string; }; -}; +} /** * @summary gets a package.json file info @@ -34,8 +34,9 @@ export type PackageInfo = { export const getPackage = async (path: string): Promise => { try { const contents = await readFile(path, { encoding: "utf-8" }); - return JSON.parse(contents); - } catch (error) { + + return JSON.parse(contents) as PackageInfo; + } catch { return null; } }; diff --git a/src/utils/scraper.ts b/src/utils/scraper.ts index 0ff2355..b876418 100644 --- a/src/utils/scraper.ts +++ b/src/utils/scraper.ts @@ -1,20 +1,20 @@ -export type NetworkSiteInfo = { +export interface NetworkSiteInfo { icon: string; site: string; name: string; -}; +} -type ApiItems = { +interface ApiItems { icon_url: string; site_url: string; name: string; -}; +} -type ApiResponse = { +interface ApiResponse { items: ApiItems[]; has_more: boolean; backoff?: number; -}; +} /** * @summary scrapes Stack Exchange network site list @@ -38,7 +38,7 @@ export const scrapeNetworkSites = async () => { const { items, backoff, has_more } = result; if (backoff) { - await new Promise((resolve) => setTimeout(resolve, backoff * 1000)); + await new Promise(resolve => setTimeout(resolve, backoff * 1000)); } items @@ -46,7 +46,7 @@ export const scrapeNetworkSites = async () => { siteInfo.push({ icon, site: site.replace(/^https?:\/\//, "").replace(/\/$/, ""), - name + name, }); }); diff --git a/src/utils/types.ts b/src/utils/types.ts index fa4129f..02a27fe 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -1,4 +1,4 @@ -//@see https://stackoverflow.com/a/68261391/11407695 +// @see https://stackoverflow.com/a/68261391/11407695 export type RequiredOnly = { [K in keyof T as T[K] extends Required[K] ? K : never]: T[K]; }; @@ -7,4 +7,4 @@ export type RequiredProps = T & { [P in K]-?: T[P]; }; -export type OnlyOptional = { [P in keyof T as undefined extends T[P] ? P : never]: T[P] }; \ No newline at end of file +export type OnlyOptional = { [P in keyof T as undefined extends T[P] ? P : never]: T[P] }; diff --git a/src/utils/urls.ts b/src/utils/urls.ts index 83d5812..a4a5eb9 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -35,7 +35,7 @@ export const explodePaths = (url: string): string[] => { url.pathname = path; return url.toString().replace(/\/$/, ""); }); - } catch (error) { + } catch { return [url]; } -}; \ No newline at end of file +}; diff --git a/src/utils/validators.ts b/src/utils/validators.ts index 5529807..fb75c6b 100644 --- a/src/utils/validators.ts +++ b/src/utils/validators.ts @@ -7,23 +7,23 @@ import type { GrantOptions } from "../generators/index.js"; import type { PackageInfo } from "./package.js"; import type { OnlyOptional, RequiredOnly } from "./types.js"; -export type OptionalHeadersValidationResult = { +export interface OptionalHeadersValidationResult { isValidDownloadURL: boolean; isValidUpdateURL: boolean; -} +}; -export type HeadersValidationResult = { - invalid: string[], - status: boolean, +export interface HeadersValidationResult { + invalid: string[]; + status: boolean; valid: string[]; -} +}; -export type RequiredHeadersValidationResult = { - status: boolean, - isValidVersion: boolean, - isValidHomepage: boolean, +export interface RequiredHeadersValidationResult { + status: boolean; + isValidVersion: boolean; + isValidHomepage: boolean; missing: string[]; -} +}; /** * @summary calculates existing headers offset from the start of the file @@ -59,7 +59,9 @@ export const getExistingHeadersOffset = async (path: string | URL, eol = EOL) => }); readline.on("error", reject); - readline.on("close", () => resolve([openTagOffset, closeTagOffset])); + readline.on("close", () => { + resolve([openTagOffset, closeTagOffset]); + }); }); }; @@ -68,13 +70,13 @@ export const getExistingHeadersOffset = async (path: string | URL, eol = EOL) => * @param matches list of match patterns */ export const validateMatchHeaders = (matches: string[]): HeadersValidationResult => { - const validationRegex = - /^((?:https?|file|ftp|\*)(?=:\/\/)|(?:urn(?=:))):(?:\/\/)?(?:((?:\*||.+?)(?=\/|$)))?(\/\*|(?:.+?\*?)+)?||all|meta$/; - const invalid = matches.filter((match) => !validationRegex.test(match)); + const validationRegex + = /^((?:https?|file|ftp|\*)(?=:\/\/)|(?:urn(?=:))):(?:\/\/)?(?:((?:\*||.+?)(?=\/|$)))?(\/\*|(?:.+?\*?)+)?||all|meta$/; + const invalid = matches.filter(match => !validationRegex.test(match)); return { invalid, status: !invalid.length, - valid: matches.filter((m) => !invalid.includes(m)), + valid: matches.filter(m => !invalid.includes(m)), }; }; @@ -84,11 +86,11 @@ export const validateMatchHeaders = (matches: string[]): HeadersValidationResult */ export const validateExcludeHeaders = (excludes: string[]): HeadersValidationResult => { const validationRegex = /^((?:https?|file|ftp|\*)(?=:\/\/)|(?:urn(?=:))):(?:\/\/)?(?:((?:\*||.+?)(?=\/|$)))?(\/\*|(?:.+?\*?)+)?$/; - const invalid = excludes.filter((pattern) => !validationRegex.test(pattern)); + const invalid = excludes.filter(pattern => !validationRegex.test(pattern)); return { invalid, status: !invalid.length, - valid: excludes.filter((e) => !invalid.includes(e)), + valid: excludes.filter(e => !invalid.includes(e)), }; }; @@ -100,15 +102,15 @@ export const validateConnectHeaders = (whitelist: string[]): HeadersValidationRe const specialWordRegex = /^localhost|self|\*$/; const ipv4Regex = /^((?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\.|$)){4}/; // https://stackoverflow.com/a/57129482/11407695 - const domainRegex = /^(?!.*?_.*?)(?!(?:[\w]+?\.)?\-[\w\.\-]*?)(?![\w]+?\-\.(?:[\w\.\-]+?))(?=[\w])(?=[\w\.\-]*?\.+[\w\.\-]*?)(?![\w\.\-]{254})(?!(?:\.?[\w\-\.]*?[\w\-]{64,}\.)+?)[\w\.\-]+?(? !checks.some((r) => r.test(remote))); + const invalid = whitelist.filter(remote => !checks.some(r => r.test(remote))); return { invalid, status: !invalid.length, - valid: whitelist.filter((r) => !invalid.includes(r)) + valid: whitelist.filter(r => !invalid.includes(r)), }; }; @@ -123,15 +125,15 @@ export const validateRequiredHeaders = (packageInfo: PackageInfo): RequiredHeade "version", "description", ]; - const missing = required.filter((p) => !(p in packageInfo)); + const missing = required.filter(p => !(p in packageInfo)); const { homepage, version } = packageInfo; const isValidVersion = !!semver.valid(version); - const isValidHomepage = homepage === void 0 || validator.isURL(homepage); + const isValidHomepage = validator.isURL(homepage); const status = [isValidVersion, isValidHomepage, !missing.length].reduce( - (a, c) => a && c + (a, c) => a && c, ); return { @@ -147,7 +149,7 @@ export const validateRequiredHeaders = (packageInfo: PackageInfo): RequiredHeade * @param options generator options */ export const validateOptionalHeaders = ( - options: OnlyOptional> + options: OnlyOptional>, ): OptionalHeadersValidationResult => { const { downloadURL, updateURL } = options; @@ -156,6 +158,6 @@ export const validateOptionalHeaders = ( return { isValidDownloadURL, - isValidUpdateURL + isValidUpdateURL, }; -}; \ No newline at end of file +};