diff --git a/configs/flat/typescript.mjs b/configs/flat/typescript.mjs index c619b19..acf0536 100644 --- a/configs/flat/typescript.mjs +++ b/configs/flat/typescript.mjs @@ -1,38 +1,34 @@ -// @ts-check -import typescriptEslint from '@typescript-eslint/eslint-plugin'; -import typescriptEslintParser from '@typescript-eslint/parser'; +import tseslint from 'typescript-eslint'; import typescriptRuleSetBase from '../../rules/typescript.js'; const typescriptRuleSet = { plugins: { - '@typescript-eslint': typescriptEslint, - }, - rules: { - ...typescriptEslint.configs['eslint-recommended'].overrides?.[0].rules, - ...typescriptEslint.configs['strict-type-checked'].rules, - ...typescriptEslint.configs['stylistic-type-checked'].rules, - ...typescriptRuleSetBase.rules, + '@typescript-eslint': tseslint.plugin, }, + extends: [ + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + ], + rules: typescriptRuleSetBase.rules, }; -export default [ - { - files: ['**/*.@(ts|tsx|cts|mts)'], +export default tseslint.config({ + files: ['**/*.@(ts|tsx|cts|mts)'], - languageOptions: { - parser: typescriptEslintParser, - parserOptions: { - project: true, - }, + languageOptions: { + parser: tseslint.parser, + parserOptions: { + projectService: true, + tsconfigRootDir: process.env.TSCONFIG_ROOT_DIR ?? import.meta.dirname, }, + }, - settings: { - // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers - 'import/parsers': { - '@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'], - }, + settings: { + // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'], }, - - ...typescriptRuleSet, }, -]; + + ...typescriptRuleSet, +}); diff --git a/package-lock.json b/package-lock.json index 42c11f8..539c7a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,8 @@ "license": "MIT", "dependencies": { "@next/eslint-plugin-next": "^15.0.3", - "@typescript-eslint/eslint-plugin": "^7.10.0", - "@typescript-eslint/parser": "^7.10.0", + "@typescript-eslint/eslint-plugin": "^8.16.0", + "@typescript-eslint/parser": "^8.16.0", "confusing-browser-globals": "^1.0.11", "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.31.0", @@ -26,7 +26,8 @@ "eslint-plugin-storybook": "^0.11.1", "eslint-plugin-testing-library": "^7.0.0", "eslint-plugin-unicorn": "^56.0.0", - "globals": "^15.11.0" + "globals": "^15.11.0", + "typescript-eslint": "^8.16.0" }, "devDependencies": { "@semantic-release/changelog": "6.0.3", @@ -41,12 +42,12 @@ "typescript": "5.7.2" }, "engines": { - "node": ">= 18.18.0 || >= 20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { "eslint": "^8.56.0", "jest": "*", - "typescript": "^4.7.5 || ^5.0.0" + "typescript": "^4.8.4 || ^5.0.0" }, "peerDependenciesMeta": { "jest": { @@ -2272,30 +2273,31 @@ "devOptional": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz", - "integrity": "sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", + "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.10.0", - "@typescript-eslint/type-utils": "7.10.0", - "@typescript-eslint/utils": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0", + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/type-utils": "8.16.0", + "@typescript-eslint/utils": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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": { @@ -2304,15 +2306,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz", - "integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0" + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2320,11 +2323,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2332,21 +2336,22 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz", - "integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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", @@ -2359,36 +2364,43 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.10.0.tgz", - "integrity": "sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", + "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.10.0", - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/typescript-estree": "7.10.0" + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.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" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz", - "integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.16.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2399,14 +2411,28 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2418,9 +2444,10 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2429,25 +2456,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.10.0.tgz", - "integrity": "sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==", - "dependencies": { - "@typescript-eslint/scope-manager": "7.10.0", - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/typescript-estree": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", + "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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": { @@ -2456,15 +2484,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz", - "integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0" + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2472,11 +2501,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2484,21 +2514,22 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz", - "integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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", @@ -2511,15 +2542,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz", - "integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.16.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2530,14 +2562,28 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, + "node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2549,9 +2595,10 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2560,24 +2607,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.10.0.tgz", - "integrity": "sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", + "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.10.0", - "@typescript-eslint/utils": "7.10.0", + "@typescript-eslint/typescript-estree": "8.16.0", + "@typescript-eslint/utils": "8.16.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" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2586,15 +2634,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz", - "integrity": "sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0" + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2602,11 +2651,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.10.0.tgz", - "integrity": "sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2614,21 +2664,22 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz", - "integrity": "sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/visitor-keys": "7.10.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.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", @@ -2641,36 +2692,43 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.10.0.tgz", - "integrity": "sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", + "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.10.0", - "@typescript-eslint/types": "7.10.0", - "@typescript-eslint/typescript-estree": "7.10.0" + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.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" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz", - "integrity": "sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.10.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.16.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2681,14 +2739,28 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, + "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2700,9 +2772,10 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2913,14 +2986,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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==", - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", @@ -3979,6 +4044,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -6100,25 +6166,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "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" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -11411,6 +11458,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -12871,6 +12919,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "devOptional": true, "engines": { "node": ">=8" } @@ -13587,6 +13636,182 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.16.0.tgz", + "integrity": "sha512-wDkVmlY6O2do4V+lZd0GtRfbtXbeD0q9WygwXXSJnC1xorE8eqyC2L1tJimqpSeFrOzRlYtWnUp/uzgHQOgfBQ==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", + "@typescript-eslint/utils": "8.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", + "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", + "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", + "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/visitor-keys": "8.16.0", + "debug": "^4.3.4", + "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.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", + "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.16.0", + "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/typescript-estree": "8.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", + "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.16.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/typescript-eslint/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typescript-eslint/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/uglify-js": { "version": "3.19.2", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.2.tgz", diff --git a/package.json b/package.json index b44ce2e..47c1f8d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "./typescript": "./configs/eslintrc/typescript.js" }, "engines": { - "node": ">= 18.18.0 || >= 20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "files": [ "configs", @@ -40,8 +40,8 @@ "homepage": "https://github.com/moneyforward/eslint-config-moneyforward#readme", "dependencies": { "@next/eslint-plugin-next": "^15.0.3", - "@typescript-eslint/eslint-plugin": "^7.10.0", - "@typescript-eslint/parser": "^7.10.0", + "@typescript-eslint/eslint-plugin": "^8.16.0", + "@typescript-eslint/parser": "^8.16.0", "confusing-browser-globals": "^1.0.11", "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.31.0", @@ -56,7 +56,8 @@ "eslint-plugin-storybook": "^0.11.1", "eslint-plugin-testing-library": "^7.0.0", "eslint-plugin-unicorn": "^56.0.0", - "globals": "^15.11.0" + "globals": "^15.11.0", + "typescript-eslint": "^8.16.0" }, "devDependencies": { "@semantic-release/changelog": "6.0.3", @@ -73,7 +74,7 @@ "peerDependencies": { "eslint": "^8.56.0", "jest": "*", - "typescript": "^4.7.5 || ^5.0.0" + "typescript": "^4.8.4 || ^5.0.0" }, "peerDependenciesMeta": { "jest": { diff --git a/rules/typescript.js b/rules/typescript.js index 8262e3d..b81ae53 100644 --- a/rules/typescript.js +++ b/rules/typescript.js @@ -35,13 +35,6 @@ module.exports = { '@typescript-eslint/prefer-promise-reject-errors': baseBestPracticesRules['prefer-promise-reject-errors'], - // Disallow throwing literals as exceptions. - // https://typescript-eslint.io/rules/no-throw-literal/ - // Replace 'no-throw-literal' rule with '@typescript-eslint' version - // TODO: Disable this rule if you are using the React.Suspense. - '@typescript-eslint/no-throw-literal': - baseBestPracticesRules['no-throw-literal'], - // Enforce naming conventions for everything across a codebase. // https://typescript-eslint.io/rules/naming-convention/ // Replace 'camelcase' rule with '@typescript-eslint/naming-convention' diff --git a/tests/snapshot-test/eslintrc/next/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/eslintrc/next/__snapshots__/snapshot.test.js.snap index e2cb099..9eb104f 100644 --- a/tests/snapshot-test/eslintrc/next/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/eslintrc/next/__snapshots__/snapshot.test.js.snap @@ -84,9 +84,6 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -164,6 +161,9 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -176,7 +176,7 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -209,9 +209,6 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -242,10 +239,10 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -254,6 +251,9 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -263,6 +263,9 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -278,12 +281,18 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -302,10 +311,7 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -317,6 +323,9 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -347,13 +356,16 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -380,6 +392,10 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1345,7 +1361,7 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1530,7 +1546,7 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -1954,6 +1970,9 @@ exports[`should match ESLint configuration snapshot: next 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/eslintrc/react/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/eslintrc/react/__snapshots__/snapshot.test.js.snap index a6d3fd1..0ac8b4c 100644 --- a/tests/snapshot-test/eslintrc/react/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/eslintrc/react/__snapshots__/snapshot.test.js.snap @@ -21,9 +21,6 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -101,6 +98,9 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -113,7 +113,7 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -146,9 +146,6 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -179,10 +176,10 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -191,6 +188,9 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -200,6 +200,9 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -215,12 +218,18 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -239,10 +248,7 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -254,6 +260,9 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -284,13 +293,16 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -317,6 +329,10 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1282,7 +1298,7 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1467,7 +1483,7 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -1891,6 +1907,9 @@ exports[`should match ESLint configuration snapshot: react 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/eslintrc/storybook/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/eslintrc/storybook/__snapshots__/snapshot.test.js.snap index 5505acc..36e27cf 100644 --- a/tests/snapshot-test/eslintrc/storybook/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/eslintrc/storybook/__snapshots__/snapshot.test.js.snap @@ -21,9 +21,6 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -101,6 +98,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -113,7 +113,7 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -146,9 +146,6 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -179,10 +176,10 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -191,6 +188,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -200,6 +200,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -215,12 +218,18 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -239,10 +248,7 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -254,6 +260,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -284,13 +293,16 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -317,6 +329,10 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1039,7 +1055,7 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1224,7 +1240,7 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -1648,6 +1664,9 @@ exports[`should match ESLint configuration snapshot: storybook 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/flat/next/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/flat/next/__snapshots__/snapshot.test.js.snap index 9b2236a..1fbb94d 100644 --- a/tests/snapshot-test/flat/next/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/flat/next/__snapshots__/snapshot.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` +exports[`ESLint Configuration Snapshot Tests should match ESLint Flat Configuration snapshot: next 1`] = ` { "languageOptions": { "ecmaVersion": "latest", @@ -67,20 +67,17 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "unescape": false, }, "parser": { - "clearCaches": [Function], - "createProgram": [Function], "meta": { "name": "typescript-eslint/parser", - "version": "7.10.0", + "version": "8.16.0", }, - "parse": [Function], "parseForESLint": [Function], - "version": "7.10.0", }, "parserOptions": { "ecmaVersion": "latest", - "project": true, + "projectService": true, "sourceType": "module", + "tsconfigRootDir": "/dummy", }, "sourceType": "module", }, @@ -166,9 +163,6 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -246,6 +240,9 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -258,7 +255,7 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -291,9 +288,6 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -324,10 +318,10 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -336,6 +330,9 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -345,6 +342,9 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -360,12 +360,18 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -384,10 +390,7 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -399,6 +402,9 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -429,13 +435,16 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -462,6 +471,10 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1410,7 +1423,7 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1595,7 +1608,7 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -2019,6 +2032,9 @@ exports[`should match ESLint Flat Configuration snapshot: next 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/flat/next/dummy.page.tsx b/tests/snapshot-test/flat/next/dummy.page.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/tests/snapshot-test/flat/next/snapshot.test.js b/tests/snapshot-test/flat/next/snapshot.test.js index efa3125..0cdb1fd 100644 --- a/tests/snapshot-test/flat/next/snapshot.test.js +++ b/tests/snapshot-test/flat/next/snapshot.test.js @@ -1,12 +1,23 @@ +/* eslint-disable unicorn/prefer-module */ const { getESLintConfig } = require('../../helper'); -test('should match ESLint Flat Configuration snapshot: next', async () => { - const filePath = './dummy.page.tsx'; - const { languageOptions, rules, settings } = await getESLintConfig( - filePath, - __dirname, - true, - ); +describe('ESLint Configuration Snapshot Tests', () => { + beforeAll(() => { + process.env.TSCONFIG_ROOT_DIR = '/dummy'; + }); - expect({ languageOptions, rules, settings }).toMatchSnapshot(); + test('should match ESLint Flat Configuration snapshot: next', async () => { + const filePath = './dummy.page.tsx'; + const { languageOptions, rules, settings } = await getESLintConfig( + filePath, + __dirname, + true, + ); + + expect({ languageOptions, rules, settings }).toMatchSnapshot(); + }); + + afterAll(() => { + process.env.TSCONFIG_ROOT_DIR = undefined; + }); }); diff --git a/tests/snapshot-test/flat/node/dummy.js b/tests/snapshot-test/flat/node/dummy.js deleted file mode 100644 index e69de29..0000000 diff --git a/tests/snapshot-test/flat/react/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/flat/react/__snapshots__/snapshot.test.js.snap index 5822159..d1fe0a9 100644 --- a/tests/snapshot-test/flat/react/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/flat/react/__snapshots__/snapshot.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should match ESLint Configuration snapshot: react 1`] = ` +exports[`ESLint Configuration Snapshot Tests should match ESLint Configuration snapshot: react 1`] = ` { "languageOptions": { "ecmaVersion": "latest", @@ -67,20 +67,17 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "unescape": false, }, "parser": { - "clearCaches": [Function], - "createProgram": [Function], "meta": { "name": "typescript-eslint/parser", - "version": "7.10.0", + "version": "8.16.0", }, - "parse": [Function], "parseForESLint": [Function], - "version": "7.10.0", }, "parserOptions": { "ecmaVersion": "latest", - "project": true, + "projectService": true, "sourceType": "module", + "tsconfigRootDir": "/dummy", }, "sourceType": "module", }, @@ -103,9 +100,6 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -183,6 +177,9 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -195,7 +192,7 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -228,9 +225,6 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -261,10 +255,10 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -273,6 +267,9 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -282,6 +279,9 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -297,12 +297,18 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -321,10 +327,7 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -336,6 +339,9 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -366,13 +372,16 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -399,6 +408,10 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1347,7 +1360,7 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1532,7 +1545,7 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -1956,6 +1969,9 @@ exports[`should match ESLint Configuration snapshot: react 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/flat/react/dummy.tsx b/tests/snapshot-test/flat/react/dummy.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/tests/snapshot-test/flat/react/snapshot.test.js b/tests/snapshot-test/flat/react/snapshot.test.js index 750c8a4..f8ff79a 100644 --- a/tests/snapshot-test/flat/react/snapshot.test.js +++ b/tests/snapshot-test/flat/react/snapshot.test.js @@ -1,12 +1,23 @@ +/* eslint-disable unicorn/prefer-module */ const { getESLintConfig } = require('../../helper'); -test('should match ESLint Configuration snapshot: react', async () => { - const filePath = 'dummy.tsx'; - const { languageOptions, rules, settings } = await getESLintConfig( - filePath, - __dirname, - true, - ); +describe('ESLint Configuration Snapshot Tests', () => { + beforeAll(() => { + process.env.TSCONFIG_ROOT_DIR = '/dummy'; + }); - expect({ languageOptions, rules, settings }).toMatchSnapshot(); + test('should match ESLint Configuration snapshot: react', async () => { + const filePath = 'dummy.tsx'; + const { languageOptions, rules, settings } = await getESLintConfig( + filePath, + __dirname, + true, + ); + + expect({ languageOptions, rules, settings }).toMatchSnapshot(); + }); + + afterAll(() => { + process.env.TSCONFIG_ROOT_DIR = undefined; + }); }); diff --git a/tests/snapshot-test/flat/storybook/__snapshots__/snapshot.test.js.snap b/tests/snapshot-test/flat/storybook/__snapshots__/snapshot.test.js.snap index 456ca7d..5176bd7 100644 --- a/tests/snapshot-test/flat/storybook/__snapshots__/snapshot.test.js.snap +++ b/tests/snapshot-test/flat/storybook/__snapshots__/snapshot.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` +exports[`ESLint Configuration Snapshot Tests should match ESLint Flat Configuration snapshot: storybook 1`] = ` { "languageOptions": { "ecmaVersion": "latest", @@ -67,20 +67,17 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "unescape": false, }, "parser": { - "clearCaches": [Function], - "createProgram": [Function], "meta": { "name": "typescript-eslint/parser", - "version": "7.10.0", + "version": "8.16.0", }, - "parse": [Function], "parseForESLint": [Function], - "version": "7.10.0", }, "parserOptions": { "ecmaVersion": "latest", - "project": true, + "projectService": true, "sourceType": "module", + "tsconfigRootDir": "/dummy", }, "sourceType": "module", }, @@ -103,9 +100,6 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/ban-tslint-comment": [ 2, ], - "@typescript-eslint/ban-types": [ - 2, - ], "@typescript-eslint/class-literal-property-style": [ 2, ], @@ -183,6 +177,9 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-confusing-void-expression": [ 2, ], + "@typescript-eslint/no-deprecated": [ + 2, + ], "@typescript-eslint/no-duplicate-enum-values": [ 2, ], @@ -195,7 +192,7 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-empty-function": [ 2, ], - "@typescript-eslint/no-empty-interface": [ + "@typescript-eslint/no-empty-object-type": [ 2, ], "@typescript-eslint/no-explicit-any": [ @@ -228,9 +225,6 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-invalid-void-type": [ 2, ], - "@typescript-eslint/no-loss-of-precision": [ - 2, - ], "@typescript-eslint/no-meaningless-void-operator": [ 2, ], @@ -261,10 +255,10 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-redundant-type-constituents": [ 2, ], - "@typescript-eslint/no-this-alias": [ + "@typescript-eslint/no-require-imports": [ 2, ], - "@typescript-eslint/no-throw-literal": [ + "@typescript-eslint/no-this-alias": [ 2, ], "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ @@ -273,6 +267,9 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unnecessary-condition": [ 2, ], + "@typescript-eslint/no-unnecessary-template-expression": [ + 2, + ], "@typescript-eslint/no-unnecessary-type-arguments": [ 2, ], @@ -282,6 +279,9 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unnecessary-type-constraint": [ 2, ], + "@typescript-eslint/no-unnecessary-type-parameters": [ + 2, + ], "@typescript-eslint/no-unsafe-argument": [ 1, ], @@ -297,12 +297,18 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-unsafe-enum-comparison": [ 2, ], + "@typescript-eslint/no-unsafe-function-type": [ + 2, + ], "@typescript-eslint/no-unsafe-member-access": [ 1, ], "@typescript-eslint/no-unsafe-return": [ 2, ], + "@typescript-eslint/no-unsafe-unary-minus": [ + 2, + ], "@typescript-eslint/no-unused-expressions": [ 2, { @@ -321,10 +327,7 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/no-useless-constructor": [ 2, ], - "@typescript-eslint/no-useless-template-literals": [ - 2, - ], - "@typescript-eslint/no-var-requires": [ + "@typescript-eslint/no-wrapper-object-types": [ 2, ], "@typescript-eslint/non-nullable-type-assertion-style": [ @@ -336,6 +339,9 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/prefer-as-const": [ 2, ], + "@typescript-eslint/prefer-find": [ + 2, + ], "@typescript-eslint/prefer-for-of": [ 2, ], @@ -366,13 +372,16 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "@typescript-eslint/prefer-reduce-type-parameter": [ 2, ], + "@typescript-eslint/prefer-regexp-exec": [ + 2, + ], "@typescript-eslint/prefer-return-this-type": [ 2, ], "@typescript-eslint/prefer-string-starts-ends-with": [ 2, ], - "@typescript-eslint/prefer-ts-expect-error": [ + "@typescript-eslint/related-getter-setter-pairs": [ 2, ], "@typescript-eslint/require-await": [ @@ -399,6 +408,10 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` "allowRegExp": false, }, ], + "@typescript-eslint/return-await": [ + 2, + "error-handling-correctness-only", + ], "@typescript-eslint/switch-exhaustiveness-check": [ 2, ], @@ -1104,7 +1117,7 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` 2, ], "no-class-assign": [ - 2, + 0, ], "no-compare-neg-zero": [ 2, @@ -1289,7 +1302,7 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` 2, ], "no-loss-of-precision": [ - 0, + 2, ], "no-magic-numbers": [ 0, @@ -1713,6 +1726,9 @@ exports[`should match ESLint Flat Configuration snapshot: storybook 1`] = ` 2, "always", ], + "no-return-await": [ + 0, + ], "no-script-url": [ 2, ], diff --git a/tests/snapshot-test/flat/storybook/dummy.stories.tsx b/tests/snapshot-test/flat/storybook/dummy.stories.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/tests/snapshot-test/flat/storybook/snapshot.test.js b/tests/snapshot-test/flat/storybook/snapshot.test.js index 0d7fc24..36f4078 100644 --- a/tests/snapshot-test/flat/storybook/snapshot.test.js +++ b/tests/snapshot-test/flat/storybook/snapshot.test.js @@ -1,12 +1,23 @@ +/* eslint-disable unicorn/prefer-module */ const { getESLintConfig } = require('../../helper'); -test('should match ESLint Flat Configuration snapshot: storybook', async () => { - const filePath = 'dummy.stories.tsx'; - const { languageOptions, rules, settings } = await getESLintConfig( - filePath, - __dirname, - true, - ); +describe('ESLint Configuration Snapshot Tests', () => { + beforeAll(() => { + process.env.TSCONFIG_ROOT_DIR = '/dummy'; + }); - expect({ languageOptions, rules, settings }).toMatchSnapshot(); + test('should match ESLint Flat Configuration snapshot: storybook', async () => { + const filePath = 'dummy.stories.tsx'; + const { languageOptions, rules, settings } = await getESLintConfig( + filePath, + __dirname, + true, + ); + + expect({ languageOptions, rules, settings }).toMatchSnapshot(); + }); + + afterAll(() => { + process.env.TSCONFIG_ROOT_DIR = undefined; + }); });