diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 502167fa..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/lib diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index aa63ae8d..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "overrides": [ - { - "files": ["*.js", "*.ts"], - "extends": "./lib/index.js" - } - ] -} diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 00000000..1564d359 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,26 @@ +const tseslint = require('typescript-eslint') + +module.exports = [ + require('.'), + { + files: [ + '**/*.cjs', + '**/*.js', + '**/*.ts' + ], + linterOptions: { + reportUnusedDisableDirectives: 'error' + } + }, + { + files: ['eslint.config.cjs'], + rules: { + ...tseslint.configs.disableTypeChecked.rules, + '@typescript-eslint/no-var-requires': 'off' + }, + languageOptions: { parserOptions: { project: false } } + }, + { + ignores: ['lib/'] + } +] diff --git a/package-lock.json b/package-lock.json index 2a9baf88..caaff770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,10 @@ "version": "47.0.0", "license": "MIT", "dependencies": { - "@typescript-eslint/parser": "^7.0.1" + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0", + "typescript-eslint": "^7.0.1" }, "devDependencies": { "@arkweid/lefthook": "0.7.7", @@ -23,17 +26,10 @@ "@types/npm-package-arg": "6.1.4", "@types/semver": "7.5.8", "@types/ungap__structured-clone": "1.2.0", - "@typescript-eslint_bottom/eslint-plugin": "npm:@typescript-eslint/eslint-plugin@7.0.1", - "@typescript-eslint_bottom/parser": "npm:@typescript-eslint/parser@7.0.1", - "@typescript-eslint/eslint-plugin": "7.9.0", - "@typescript-eslint/utils": "7.9.0", "@ungap/structured-clone": "1.2.0", "ava": "6.1.3", "editorconfig-checker": "5.1.5", "eslint": "8.57.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-promise": "6.1.1", "js-yaml": "4.1.0", "just-diff": "6.0.2", "lodash": "4.17.21", @@ -46,14 +42,11 @@ "standard-version": "9.5.0", "tsconfigs": "5.0.0", "type-fest": "4.18.2", - "typescript": "5.4.5" + "typescript": "5.4.5", + "typescript-eslint_bottom": "npm:typescript-eslint@7.0.1" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^7.0.1", "eslint": "^8.0.1", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", - "eslint-plugin-promise": "^6.0.0", "typescript": "*" } }, @@ -2214,8 +2207,7 @@ "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/lodash": { "version": "4.17.4", @@ -2263,101 +2255,10 @@ "integrity": "sha512-ZoaihZNLeZSxESbk9PUAPZOlSpcKx81I1+4emtULDVmBLkYutTcMlCj2K9VNlf9EWODxdO6gkAqEaLorXwZQVA==", "dev": true }, - "node_modules/@typescript-eslint_bottom/eslint-plugin": { - "name": "@typescript-eslint/eslint-plugin", - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz", - "integrity": "sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/type-utils": "7.0.1", - "@typescript-eslint/utils": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.4", - "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint_bottom/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.1.tgz", - "integrity": "sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/typescript-estree": "7.0.1", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - } - }, - "node_modules/@typescript-eslint_bottom/parser": { - "name": "@typescript-eslint/parser", - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.1.tgz", - "integrity": "sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/typescript-estree": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1", - "debug": "^4.3.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz", "integrity": "sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==", - "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "7.9.0", @@ -2390,7 +2291,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz", "integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "@typescript-eslint/visitor-keys": "7.9.0" @@ -2407,7 +2307,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz", "integrity": "sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==", - "dev": true, "dependencies": { "@typescript-eslint/typescript-estree": "7.9.0", "@typescript-eslint/utils": "7.9.0", @@ -2434,7 +2333,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", - "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -2447,7 +2345,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz", "integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "@typescript-eslint/visitor-keys": "7.9.0", @@ -2475,7 +2372,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz", "integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "eslint-visitor-keys": "^3.4.3" @@ -2492,7 +2388,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -2501,7 +2396,6 @@ "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2770,7 +2664,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.9.0.tgz", "integrity": "sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==", - "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "7.9.0", @@ -2792,7 +2685,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz", "integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "@typescript-eslint/visitor-keys": "7.9.0" @@ -2809,7 +2701,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", - "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -2822,7 +2713,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz", "integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "@typescript-eslint/visitor-keys": "7.9.0", @@ -2850,7 +2740,6 @@ "version": "7.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz", "integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==", - "dev": true, "dependencies": { "@typescript-eslint/types": "7.9.0", "eslint-visitor-keys": "^3.4.3" @@ -2867,7 +2756,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -2876,7 +2764,6 @@ "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3130,7 +3017,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -3158,7 +3044,6 @@ "version": "3.1.7", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -3185,7 +3070,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -3204,7 +3088,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -3222,7 +3105,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -3240,7 +3122,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", - "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -3429,7 +3310,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3499,7 +3379,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, "engines": { "node": ">=6" }, @@ -3511,7 +3390,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", - "dev": true, "dependencies": { "semver": "^7.0.0" } @@ -3520,7 +3398,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -4676,7 +4553,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" @@ -5045,7 +4921,6 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", - "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "arraybuffer.prototype.slice": "^1.0.1", @@ -5098,7 +4973,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3", "has": "^1.0.3", @@ -5112,7 +4986,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, "dependencies": { "has": "^1.0.3" } @@ -5121,7 +4994,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -5212,7 +5084,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", - "dev": true, "engines": { "node": ">=12" }, @@ -5224,7 +5095,6 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -5235,7 +5105,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -5244,7 +5113,6 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", - "dev": true, "dependencies": { "debug": "^3.2.7" }, @@ -5261,7 +5129,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -5270,7 +5137,6 @@ "version": "7.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", "integrity": "sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==", - "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.1.2", "@eslint-community/regexpp": "^4.6.0", @@ -5290,7 +5156,6 @@ "version": "2.29.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", - "dev": true, "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -5321,7 +5186,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -5330,7 +5194,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -5342,7 +5205,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -5351,7 +5213,6 @@ "version": "16.6.2", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz", "integrity": "sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==", - "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", @@ -5379,7 +5240,6 @@ "version": "6.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -5710,7 +5570,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -5772,7 +5631,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5793,7 +5651,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -5811,7 +5668,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5911,7 +5767,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -6045,7 +5900,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -6061,7 +5915,6 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.0.tgz", "integrity": "sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==", - "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -6251,7 +6104,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, "dependencies": { "define-properties": "^1.1.3" }, @@ -6285,7 +6137,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -6338,7 +6189,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -6350,7 +6200,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6367,7 +6216,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -6379,7 +6227,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -6391,7 +6238,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -6403,7 +6249,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -6424,7 +6269,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -6616,7 +6460,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", @@ -6655,7 +6498,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -6675,7 +6517,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -6687,7 +6528,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -6703,7 +6543,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, "dependencies": { "builtin-modules": "^3.3.0" }, @@ -6718,7 +6557,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -6730,7 +6568,6 @@ "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, "dependencies": { "hasown": "^2.0.0" }, @@ -6742,7 +6579,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6788,7 +6624,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -6808,7 +6643,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6864,7 +6698,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -6880,7 +6713,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -6904,7 +6736,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -6919,7 +6750,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -6946,7 +6776,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -6973,7 +6802,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -6984,8 +6812,7 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", @@ -7085,7 +6912,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, "dependencies": { "minimist": "^1.2.0" }, @@ -7703,7 +7529,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7789,8 +7614,7 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mz": { "version": "2.7.0", @@ -10916,7 +10740,6 @@ "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10925,7 +10748,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -10934,7 +10756,6 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -10952,7 +10773,6 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -10969,7 +10789,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -10981,7 +10800,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -11249,8 +11067,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "4.0.0", @@ -11728,7 +11545,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -11775,7 +11591,6 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -11813,7 +11628,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } @@ -11873,7 +11687,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -11897,7 +11710,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -12288,7 +12100,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -12888,7 +12699,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -12905,7 +12715,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -12919,7 +12728,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -12955,7 +12763,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, "engines": { "node": ">=4" } @@ -13085,7 +12892,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -13299,7 +13105,6 @@ "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -13340,7 +13145,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", @@ -13354,7 +13158,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -13372,7 +13175,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -13391,7 +13193,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", @@ -13419,6 +13220,145 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.9.0.tgz", + "integrity": "sha512-7iTn9c10teHHCys5Ud/yaJntXZrjt3h2mrx3feJGBOLgQkF3TB1X89Xs3aVQ/GgdXRAXpk2bPTdpRwHP4YkUow==", + "dependencies": { + "@typescript-eslint/eslint-plugin": "7.9.0", + "@typescript-eslint/parser": "7.9.0", + "@typescript-eslint/utils": "7.9.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint_bottom": { + "name": "typescript-eslint", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.0.1.tgz", + "integrity": "sha512-aIquOfwHkGHrMSH57HxLT+1Qzp99YtGxEHXMRD+BXOc8fkuFBbA5BXsMYnoVXFuXOWBdXg8U2rN9Xe4p7LrPSQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "7.0.1", + "@typescript-eslint/parser": "7.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint_bottom/node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz", + "integrity": "sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/type-utils": "7.0.1", + "@typescript-eslint/utils": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint_bottom/node_modules/@typescript-eslint/parser": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.1.tgz", + "integrity": "sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint_bottom/node_modules/@typescript-eslint/utils": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.1.tgz", + "integrity": "sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.1", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, "node_modules/uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -13436,7 +13376,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -13592,7 +13531,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -13608,7 +13546,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", diff --git a/package.json b/package.json index f2543ea0..4f3c5b88 100644 --- a/package.json +++ b/package.json @@ -50,14 +50,13 @@ "TypeScript" ], "dependencies": { - "@typescript-eslint/parser": "^7.0.1" - }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^7.0.1", - "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", "eslint-plugin-promise": "^6.0.0", + "typescript-eslint": "^7.0.1" + }, + "peerDependencies": { + "eslint": "^8.0.1", "typescript": "*" }, "devDependencies": { @@ -72,17 +71,10 @@ "@types/npm-package-arg": "6.1.4", "@types/semver": "7.5.8", "@types/ungap__structured-clone": "1.2.0", - "@typescript-eslint_bottom/eslint-plugin": "npm:@typescript-eslint/eslint-plugin@7.0.1", - "@typescript-eslint_bottom/parser": "npm:@typescript-eslint/parser@7.0.1", - "@typescript-eslint/eslint-plugin": "7.9.0", - "@typescript-eslint/utils": "7.9.0", "@ungap/structured-clone": "1.2.0", "ava": "6.1.3", "editorconfig-checker": "5.1.5", "eslint": "8.57.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-promise": "6.1.1", "js-yaml": "4.1.0", "just-diff": "6.0.2", "lodash": "4.17.21", @@ -95,7 +87,8 @@ "standard-version": "9.5.0", "tsconfigs": "5.0.0", "type-fest": "4.18.2", - "typescript": "5.4.5" + "typescript": "5.4.5", + "typescript-eslint_bottom": "npm:typescript-eslint@7.0.1" }, "files": [ "lib/index.js", diff --git a/readme.md b/readme.md index 6d2f4659..05b7312d 100644 --- a/readme.md +++ b/readme.md @@ -3,65 +3,22 @@ A TypeScript ESLint config that loves you -# Peer dependencies - -This package specifies the following `peerDependencies`: - -- TypeScript, which you may already have installed -- [ESLint](https://github.com/eslint/eslint) -- 3 ESLint plugins -- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin); ESLint rules for TypeScript. - -Yes, this is a large number of `peerDependencies`. -This is due to [a known limitation in ESLint](https://github.com/eslint/eslint/issues/3458). - -# @typescript-eslint dependencies - -This package has `@typescript-eslint/parser` in `dependencies`. -And it has `@typescript-eslint/eslint-plugin` in `peerDependencies`. -Both are specified as ranges. -It's probably safest for the installed versions of these packages to be the same. -This can be achieved by: - -1. Pin (exact version) the `@typescript-eslint/eslint-plugin` in `package.json`. -1. Have a `package-lock.json` which locks the version of the `@typescript-eslint/parser` sub-dependency. - -And both pin/lock to the same version. - -# Yarn - -Yarn does not automatically install `peerDependencies`, -so if that's what you're using, install them manually. -Here is an example, but use it only for reference, -because your decisions regarding version ranges and range specifiers may vary. - -``` -yarn add --dev \ - typescript@\* \ - eslint@^8.0.1 \ - eslint-plugin-promise@^6.0.0 \ - eslint-plugin-import@^2.25.2 \ - eslint-plugin-n@^15.0.0 \ - @typescript-eslint/eslint-plugin@^7.0.1 \ - eslint-config-love@latest -``` - # Example config -Here is an example `.eslintrc.js`. +Here is an example `eslint.config.cjs`. ```js -module.exports = { - overrides: [ - { - files: ['*.js', '*.jsx', '*.ts', '*.tsx'], - extends: 'love' - } - ], -} +module.exports = [ + { + ...require('eslint-config-love'), + files: ['*.js', '*.jsx', '*.ts', '*.tsx'], + } +] ``` -Note: the config exported by this package sets `parserOptions.project = true`. +[Learn how to configure ESLint](https://eslint.org/docs/latest/use/configure/). + +Note: the config exported by this package sets `languageOptions.parserOptions.project = true`. Read about the `project` option [here](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration). There are [some more `parserOptions`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration) you may care about. diff --git a/src/index.ts b/src/index.ts index 3f4d3835..a2bad82e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,8 @@ import { TSESLint } from '@typescript-eslint/utils' +import { parser, plugin as tseslintPlugin } from 'typescript-eslint' +import * as importPlugin from 'eslint-plugin-import' +import * as nPlugin from 'eslint-plugin-n' +import * as promisePlugin from 'eslint-plugin-promise' const rules = { '@typescript-eslint/adjacent-overload-signatures': ['error'], @@ -398,21 +402,23 @@ const namesOfEslintRulesForWhichWeAreUsingTsEquivalents = eslintRuleNames .filter(name => Object.hasOwn(rules, `@typescript-eslint/${name}`)) const config = { - plugins: [ - '@typescript-eslint', - 'import', - 'n', - 'promise' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: true + languageOptions: { + parser, + parserOptions: { + project: true + } + }, + plugins: { + '@typescript-eslint': tseslintPlugin, + import: importPlugin, + n: nPlugin, + promise: promisePlugin }, rules: { ...Object.fromEntries(namesOfEslintRulesForWhichWeAreUsingTsEquivalents.map(name => [name, ['off']])), ...rules } -} satisfies TSESLint.ClassicConfig.Config +} satisfies TSESLint.FlatConfig.Config export = config diff --git a/src/test/_util.ts b/src/test/_util.ts index 4b9dd430..331f50ce 100644 --- a/src/test/_util.ts +++ b/src/test/_util.ts @@ -1,7 +1,10 @@ import exported from '..' -import { rules as tseslintRules } from '@typescript-eslint/eslint-plugin' +import { parser, plugin as tseslintPlugin } from 'typescript-eslint' import { TSESLint } from '@typescript-eslint/utils' import semver from 'semver' +import * as importPlugin from 'eslint-plugin-import' +import * as nPlugin from 'eslint-plugin-n' +import * as promisePlugin from 'eslint-plugin-promise' import { type PackageJson } from 'type-fest' interface PkgDetails { @@ -43,25 +46,25 @@ export const isPinnedRange = (rangeStr: string): boolean => { export const extractVersionRange = (spec: string): string => spec.split('@').slice(-1)[0] -const ourRules_: TSESLint.ClassicConfig.RulesRecord = exported.rules +const ourRules_ = exported.rules if (ourRules_ === undefined) throw new Error('we seem to be exporting no rules') export const ourRules = ourRules_ export const equivalents = [...(new TSESLint.Linter()).getRules().keys()] - .filter(name => Object.prototype.hasOwnProperty.call(tseslintRules, name)) - -export const tseslintBottom = '@typescript-eslint_bottom' + .filter(name => Object.prototype.hasOwnProperty.call(tseslintPlugin.rules, name)) export const expectedExportedValue = { - plugins: [ - '@typescript-eslint', - 'import', - 'n', - 'promise' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: true + languageOptions: { + parser, + parserOptions: { + project: true + } + }, + plugins: { + '@typescript-eslint': tseslintPlugin, + import: importPlugin, + n: nPlugin, + promise: promisePlugin }, rules: { 'no-var': ['warn'], @@ -449,4 +452,4 @@ export const expectedExportedValue = { '@typescript-eslint/type-annotation-spacing': ['error'], '@typescript-eslint/unbound-method': ['error', { ignoreStatic: false }] } -} satisfies TSESLint.ClassicConfig.Config +} satisfies TSESLint.FlatConfig.Config diff --git a/src/test/compatibility.ts b/src/test/compatibility.ts index 89f0226f..ed5af3c2 100644 --- a/src/test/compatibility.ts +++ b/src/test/compatibility.ts @@ -2,51 +2,42 @@ import test from 'ava' import { TSESLint } from '@typescript-eslint/utils' import exported from '..' import semver from 'semver' -import { extractVersionRange, getPkgDetails, ourRules, tseslintBottom } from './_util' +import { extractVersionRange, getPkgDetails } from './_util' +import { parser as tseslintBottomParser, plugin as tseslintBottomPlugin } from 'typescript-eslint_bottom' -const tseslintBottomPlugin = `${tseslintBottom}/eslint-plugin` -const tseslintBottomParser = `${tseslintBottom}/parser` +const tseslintBottom = 'typescript-eslint_bottom' -test('our configuration is compatible with the plugin and parser at bottom of peer dep range', async (t) => { - const { ourPeerDeps, ourDevDeps } = await getPkgDetails() +test('our configuration is compatible with the plugin and parser at bottom of dep range', async (t) => { + const { ourDeps, ourDevDeps } = await getPkgDetails() - const peerDepRange = ourPeerDeps['@typescript-eslint/eslint-plugin'] - if (peerDepRange === undefined) throw new Error() + const tseslintDepRange = ourDeps['typescript-eslint'] + if (tseslintDepRange === undefined) throw new Error() - const bottomPluginRange = ourDevDeps[tseslintBottomPlugin] - if (bottomPluginRange === undefined) throw new Error() - const bottomPluginVersion = extractVersionRange(bottomPluginRange) - const bottomParserRange = ourDevDeps[tseslintBottomParser] - if (bottomParserRange === undefined) throw new Error() - const bottomParserVersion = extractVersionRange(bottomParserRange) + const tseslintBottomRange = ourDevDeps[tseslintBottom] + if (tseslintBottomRange === undefined) throw new Error() + const tseslintBottomVersion = extractVersionRange(tseslintBottomRange) - const minPeerDepVersion = semver.minVersion(peerDepRange) - if (minPeerDepVersion === null) throw new Error() + const tseslintMinVersion = semver.minVersion(tseslintDepRange) + if (tseslintMinVersion === null) throw new Error() - t.deepEqual(bottomPluginVersion, minPeerDepVersion.version, 'bottom plugin version is bottom of peer dep') - t.deepEqual(bottomParserVersion, minPeerDepVersion.version, 'bottom parser version is bottom of peer dep') + t.deepEqual(tseslintBottomVersion, tseslintMinVersion.version, 'typescript-eslint_bottom version is min of dep') const config = { - ...structuredClone(exported), - plugins: [ - ...exported.plugins.filter(p => p !== '@typescript-eslint'), - tseslintBottomPlugin - ], - parser: tseslintBottomParser, - rules: Object.fromEntries( - Object.entries(ourRules).map(([name, config]) => [ - name.replace('@typescript-eslint/', `${tseslintBottom}/`), - config - ]) - ), - parserOptions: { - project: './tsconfig.json' + ...exported, + languageOptions: { + parser: tseslintBottomParser, + parserOptions: { + project: './tsconfig.json' + } + }, + plugins: { + ...exported.plugins, + 'typescript-eslint': tseslintBottomPlugin } - } + } satisfies TSESLint.FlatConfig.Config - const eslint = new TSESLint.ESLint({ - useEslintrc: false, - overrideConfig: config + const eslint = new TSESLint.FlatESLint({ + baseConfig: [config] }) const results = await eslint.lintText('', { filePath: 'src/index.ts' }) diff --git a/src/test/dependencies.ts b/src/test/dependencies.ts index b83a1063..41c32623 100644 --- a/src/test/dependencies.ts +++ b/src/test/dependencies.ts @@ -1,5 +1,4 @@ import test from 'ava' -import semver from 'semver' import { extractVersionRange, getPkgDetails, isPinnedRange, isSingleCaretRange } from './_util' test('range types', async (t) => { @@ -15,7 +14,7 @@ test('range types', async (t) => { return spec !== '*' } - if (depName === 'eslint-plugin-n' && depType === 'peer') { + if (depName === 'eslint-plugin-n' && depType === 'dep') { const ranges = spec.split('||').map(range => range.trim()) if (ranges.length !== 2) return true return !ranges.every(range => isSingleCaretRange(range)) @@ -36,33 +35,3 @@ test('range types', async (t) => { t.deepEqual(nonCompliantDepRanges, []) }) - -test('@typescript-eslint/eslint-plugin, dev dep subset of peer dep', async (t) => { - const { ourPeerDeps, ourDevDeps } = await getPkgDetails() - const peerDepPluginRange = ourPeerDeps['@typescript-eslint/eslint-plugin'] - if (peerDepPluginRange === undefined) { - t.fail() - return - } - const devDepPluginRange = ourDevDeps['@typescript-eslint/eslint-plugin'] - if (devDepPluginRange === undefined) throw new Error() - t.true(semver.subset(devDepPluginRange, peerDepPluginRange)) -}) - -test('devDep plugin range subset of dep parser range', async (t) => { - const { ourDeps, ourDevDeps } = await getPkgDetails() - const depParserRange = ourDeps['@typescript-eslint/parser'] - const devPluginRange = ourDevDeps['@typescript-eslint/eslint-plugin'] - if (devPluginRange === undefined) throw new Error() - if (depParserRange === undefined) throw new Error() - t.true(semver.subset(devPluginRange, depParserRange)) -}) - -test('devDep @typescript-eslint/utils range equals devDep plugin range', async (t) => { - const { ourDevDeps } = await getPkgDetails() - const devPluginRange = ourDevDeps['@typescript-eslint/eslint-plugin'] - const devUtilsRange = ourDevDeps['@typescript-eslint/utils'] - if (devPluginRange === undefined) throw new Error() - if (devUtilsRange === undefined) throw new Error() - t.true(semver.subset(devUtilsRange, devPluginRange)) -}) diff --git a/src/test/equivalents.ts b/src/test/equivalents.ts index fdb46e50..d759d74b 100644 --- a/src/test/equivalents.ts +++ b/src/test/equivalents.ts @@ -1,13 +1,15 @@ import test from 'ava' import { rules as tseslintRules } from '@typescript-eslint/eslint-plugin' import { equivalents, ourRules } from './_util' +import { type TSESLint } from '@typescript-eslint/utils' test('JS equivalent rules are off', async (t) => { - Object.keys(ourRules).forEach((name) => { + const ourRules_: TSESLint.FlatConfig.Rules = ourRules + Object.keys(ourRules_).forEach((name) => { const bareName = name.replace('@typescript-eslint/', '') if (!Object.prototype.hasOwnProperty.call(tseslintRules, bareName)) return if (!equivalents.includes(bareName)) return - const config = ourRules[bareName] + const config = ourRules_[bareName] t.deepEqual(config, ['off'], bareName) }) }) diff --git a/src/test/readme.ts b/src/test/readme.ts deleted file mode 100644 index 42eb4123..00000000 --- a/src/test/readme.ts +++ /dev/null @@ -1,41 +0,0 @@ -import test from 'ava' -import semver from 'semver' -import npmPkgArg from 'npm-package-arg' -import { getPkgDetails } from './_util' -import { readFile } from 'fs/promises' -import { resolve } from 'path' - -test('yarn install args in readme satisfy peerDeps', async (t) => { - const { pkgJson, pkgPath, ourPeerDeps } = await getPkgDetails() - const readme = (await readFile(resolve(pkgPath, '..', 'readme.md'))).toString() - const match = readme.match(/```\n(yarn add .*?)```/s) - if (match === null) throw new Error("couldn't find yarn add") - if (match.length === 0) throw new Error('failed to find code block') - if (match.length > 2) throw new Error('matched multiple code blocks') - const installArgRanges = Object.fromEntries( - match[1] - .replace(/\\/g, '') - .trim() - .split('\n') - .slice(1) - .map(arg => { - const { name, fetchSpec: range } = npmPkgArg(arg.trim()) - if (name === null) throw new Error() - if (range === null) throw new Error() - return [name, range] as const - }) - .filter(([name]) => name !== pkgJson.name) - ) - Object.entries(ourPeerDeps as Record).forEach(([name, peerDepRange]) => { - t.true(Object.prototype.hasOwnProperty.call(installArgRanges, name), `missing peerDep ${name} in install args`) - const installArgRange = installArgRanges[name] - t.true( - semver.subset(installArgRange, peerDepRange), - `${name} install arg range ${installArgRange} is not a subset of peerDep range ${peerDepRange}` - ) - }) - const installArgsLength = Object.keys(installArgRanges).length - const ourPeerDepsLength = Object.keys(ourPeerDeps).length - t.false(installArgsLength > ourPeerDepsLength, 'more install args than peer deps') - t.false(ourPeerDepsLength > installArgsLength, 'more peer deps than install args') -}) diff --git a/src/test/resolved-config.ts b/src/test/resolved-config.ts index 07b430c5..26134dc5 100644 --- a/src/test/resolved-config.ts +++ b/src/test/resolved-config.ts @@ -3,23 +3,45 @@ import { TSESLint } from '@typescript-eslint/utils' import exported from '..' import { expectedExportedValue } from './_util' -const eslint = new TSESLint.ESLint({ - useEslintrc: false, - overrideConfig: structuredClone(exported) +const eslint = new TSESLint.FlatESLint({ + baseConfig: [exported] }) -const actual = eslint.calculateConfigForFile('foo.js') +const actualP = eslint.calculateConfigForFile('foo.js') test('plugins', async (t) => { - t.deepEqual((await actual).plugins, [...expectedExportedValue.plugins].reverse()) + // @ts-expect-error type seems wrong + const actual: TSESLint.FlatConfig.Config = await actualP + if (actual.plugins === undefined) throw new Error() + + const actualSansAt = Object.fromEntries( + Object.entries(actual.plugins).filter(([key, _]) => key !== '@') + ) + t.deepEqual(actualSansAt, expectedExportedValue.plugins) }) -test('parser', async (t) => { - const parser = (await actual).parser - if (typeof parser !== 'string') throw new Error() - t.true(parser.includes(expectedExportedValue.parser)) +test('languageOptions', async (t) => { + // @ts-expect-error type seems wrong + const actual: TSESLint.FlatConfig.Config = await actualP + const actualLanguageOptions = actual.languageOptions + if (actualLanguageOptions === undefined) throw new Error() + t.deepEqual(actualLanguageOptions, { + ...expectedExportedValue.languageOptions, + ecmaVersion: 'latest', + sourceType: 'module' + }) }) test('rules', async (t) => { - t.deepEqual((await actual).rules, expectedExportedValue.rules) + // @ts-expect-error type seems wrong + const actual: TSESLint.FlatConfig.Config = await actualP + const rules: TSESLint.FlatConfig.Rules = expectedExportedValue.rules + const normalized = Object.fromEntries(Object.entries(rules).map(([name, value]) => { + if (value === undefined) throw new Error() + if (!Array.isArray(value)) throw new Error() + const [level, ...options] = value + if (typeof level === 'number') throw new Error() + return [name, [{ error: 2, warn: 1, off: 0 }[level], ...options]] + })) + t.deepEqual(actual.rules, normalized) }) diff --git a/src/test/rules-to-consider.ts b/src/test/rules-to-consider.ts index 46be1b88..ee05e6f9 100644 --- a/src/test/rules-to-consider.ts +++ b/src/test/rules-to-consider.ts @@ -7,6 +7,10 @@ import { ourRules } from './_util' import _ from 'lodash' import { TSESLint } from '@typescript-eslint/utils' +if (pluginN === undefined) throw new Error() +if (pluginImport === undefined) throw new Error() +if (pluginPromise === undefined) throw new Error() + const eslintRules = (new TSESLint.Linter()).getRules() if (pluginN.rules === undefined) throw new Error()