diff --git a/eslint.config.js b/eslint.config.js index f79a2db75ab..60acff7c795 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,9 +1,8 @@ // @ts-check /* eslint-disable @typescript-eslint/no-unsafe-argument */ -import { fixupPluginRules, includeIgnoreFile } from '@eslint/compat'; +import { includeIgnoreFile } from '@eslint/compat'; import eslint from '@eslint/js'; import stylistic from '@stylistic/eslint-plugin'; -import eslintPluginDeprecation from 'eslint-plugin-deprecation'; import eslintPluginJsdoc from 'eslint-plugin-jsdoc'; import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; import eslintPluginUnicorn from 'eslint-plugin-unicorn'; @@ -27,6 +26,7 @@ export default tseslint.config( 'docs/.vitepress/components/shims.d.ts', 'docs/.vitepress/shared/utils/slugify.ts', 'docs/.vitepress/theme/index.ts', + 'eslint.config.js', ], }, { @@ -57,7 +57,6 @@ export default tseslint.config( '@typescript-eslint': tseslint.plugin, }, languageOptions: { - parser: tseslint.parser, parserOptions: { project: true, warnOnUnsupportedTypeScriptVersion: false, @@ -140,29 +139,7 @@ export default tseslint.config( }, //#endregion - //#region deprecation - { - plugins: { - deprecation: - // https://github.com/gund/eslint-plugin-deprecation/issues/78 - // @ts-expect-error: Just eat it! - fixupPluginRules(eslintPluginDeprecation), - }, - languageOptions: { - parser: tseslint.parser, - parserOptions: { - project: true, - warnOnUnsupportedTypeScriptVersion: false, - }, - }, - rules: { - 'deprecation/deprecation': 'error', - }, - }, - //#endregion - //#region unicorn - // @ts-expect-error: Ignore for now eslintPluginUnicorn.configs['flat/recommended'], { rules: { diff --git a/package.json b/package.json index a84c2cdd435..37e8c88a9b1 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "eslint": "9.9.0", "eslint-config-prettier": "9.1.0", "eslint-define-config": "2.1.0", - "eslint-plugin-deprecation": "3.0.0", "eslint-plugin-jsdoc": "50.2.2", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-unicorn": "55.0.0", @@ -127,7 +126,7 @@ "tsup": "8.2.4", "tsx": "4.17.0", "typescript": "5.5.4", - "typescript-eslint": "7.18.0", + "typescript-eslint": "8.3.0", "validator": "13.12.0", "vite": "5.4.1", "vitepress": "1.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a2acb84e3c..9ddfa5e48a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,9 +74,6 @@ importers: eslint-define-config: specifier: 2.1.0 version: 2.1.0 - eslint-plugin-deprecation: - specifier: 3.0.0 - version: 3.0.0(eslint@9.9.0)(typescript@5.5.4) eslint-plugin-jsdoc: specifier: 50.2.2 version: 50.2.2(eslint@9.9.0) @@ -120,8 +117,8 @@ importers: specifier: 5.5.4 version: 5.5.4 typescript-eslint: - specifier: 7.18.0 - version: 7.18.0(eslint@9.9.0)(typescript@5.5.4) + specifier: 8.3.0 + version: 8.3.0(eslint@9.9.0)(typescript@5.5.4) validator: specifier: 13.12.0 version: 13.12.0 @@ -915,22 +912,22 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@7.18.0': - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/eslint-plugin@8.3.0': + resolution: {integrity: sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/parser@7.18.0': - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/parser@8.3.0': + resolution: {integrity: sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: @@ -944,11 +941,14 @@ packages: resolution: {integrity: sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@7.18.0': - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.3.0': + resolution: {integrity: sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/type-utils@8.3.0': + resolution: {integrity: sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: @@ -962,6 +962,10 @@ packages: resolution: {integrity: sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/types@8.3.0': + resolution: {integrity: sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@7.18.0': resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -980,6 +984,15 @@ packages: typescript: optional: true + '@typescript-eslint/typescript-estree@8.3.0': + resolution: {integrity: sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/utils@7.18.0': resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -992,6 +1005,12 @@ packages: peerDependencies: eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/utils@8.3.0': + resolution: {integrity: sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/visitor-keys@7.18.0': resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1000,6 +1019,10 @@ packages: resolution: {integrity: sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.3.0': + resolution: {integrity: sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitejs/plugin-vue@5.1.2': resolution: {integrity: sha512-nY9IwH12qeiJqumTCLJLE7IiNx7HZ39cbHaysEUd+Myvbz9KAqd2yq+U01Kab1R/H1BmiyM2ShTYlNH32Fzo3A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1778,12 +1801,6 @@ packages: resolution: {integrity: sha512-QUp6pM9pjKEVannNAbSJNeRuYwW3LshejfyBBpjeMGaJjaDUpVps4C6KVR8R7dWZnD3i0synmrE36znjTkJvdQ==} engines: {node: '>=18.0.0', npm: '>=9.0.0', pnpm: '>=8.6.0'} - eslint-plugin-deprecation@3.0.0: - resolution: {integrity: sha512-JuVLdNg/uf0Adjg2tpTyYoYaMbwQNn/c78P1HcccokvhtRphgnRjZDKmhlxbxYptppex03zO76f97DD/yQHv7A==} - peerDependencies: - eslint: ^8.0.0 - typescript: ^4.2.4 || ^5.0.0 - eslint-plugin-jsdoc@50.2.2: resolution: {integrity: sha512-i0ZMWA199DG7sjxlzXn5AeYZxpRfMJjDPUl7lL9eJJX8TPRoIaxJU4ys/joP5faM5AXE1eqW/dslCj3uj4Nqpg==} engines: {node: '>=18'} @@ -3360,11 +3377,10 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript-eslint@7.18.0: - resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} - engines: {node: ^18.18.0 || >=20.0.0} + typescript-eslint@8.3.0: + resolution: {integrity: sha512-EvWjwWLwwKDIJuBjk2I6UkV8KEQcwZ0VM10nR1rIunRDIP67QJTZAHBXTX0HW/oI1H10YESF8yWie8fRQxjvFA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: @@ -4341,14 +4357,14 @@ snapshots: '@types/node': 20.16.1 optional: true - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/parser': 8.3.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.3.0 + '@typescript-eslint/type-utils': 8.3.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.3.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.3.0 eslint: 9.9.0 graphemer: 1.4.0 ignore: 5.3.2 @@ -4359,12 +4375,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.3.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager': 8.3.0 + '@typescript-eslint/types': 8.3.0 + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.3.0 debug: 4.3.6(supports-color@8.1.1) eslint: 9.9.0 optionalDependencies: @@ -4382,22 +4398,29 @@ snapshots: '@typescript-eslint/types': 8.2.0 '@typescript-eslint/visitor-keys': 8.2.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/scope-manager@8.3.0': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/types': 8.3.0 + '@typescript-eslint/visitor-keys': 8.3.0 + + '@typescript-eslint/type-utils@8.3.0(eslint@9.9.0)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.3.0(eslint@9.9.0)(typescript@5.5.4) debug: 4.3.6(supports-color@8.1.1) - eslint: 9.9.0 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color '@typescript-eslint/types@7.18.0': {} '@typescript-eslint/types@8.2.0': {} + '@typescript-eslint/types@8.3.0': {} + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': dependencies: '@typescript-eslint/types': 7.18.0 @@ -4428,6 +4451,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@8.3.0(typescript@5.5.4)': + dependencies: + '@typescript-eslint/types': 8.3.0 + '@typescript-eslint/visitor-keys': 8.3.0 + debug: 4.3.6(supports-color@8.1.1) + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@7.18.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) @@ -4450,6 +4488,17 @@ snapshots: - supports-color - typescript + '@typescript-eslint/utils@8.3.0(eslint@9.9.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@typescript-eslint/scope-manager': 8.3.0 + '@typescript-eslint/types': 8.3.0 + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) + eslint: 9.9.0 + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/visitor-keys@7.18.0': dependencies: '@typescript-eslint/types': 7.18.0 @@ -4460,6 +4509,11 @@ snapshots: '@typescript-eslint/types': 8.2.0 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@8.3.0': + dependencies: + '@typescript-eslint/types': 8.3.0 + eslint-visitor-keys: 3.4.3 + '@vitejs/plugin-vue@5.1.2(vite@5.4.1(@types/node@20.16.1))(vue@3.4.38(typescript@5.5.4))': dependencies: vite: 5.4.1(@types/node@20.16.1) @@ -5405,16 +5459,6 @@ snapshots: eslint-define-config@2.1.0: {} - eslint-plugin-deprecation@3.0.0(eslint@9.9.0)(typescript@5.5.4): - dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - eslint: 9.9.0 - ts-api-utils: 1.3.0(typescript@5.5.4) - tslib: 2.6.3 - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - eslint-plugin-jsdoc@50.2.2(eslint@9.9.0): dependencies: '@es-joy/jsdoccomment': 0.48.0 @@ -6987,15 +7031,15 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@7.18.0(eslint@9.9.0)(typescript@5.5.4): + typescript-eslint@8.3.0(eslint@9.9.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/parser': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - eslint: 9.9.0 + '@typescript-eslint/eslint-plugin': 8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.3.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.3.0(eslint@9.9.0)(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color typescript@5.5.4: {} diff --git a/test/locale-imports.spec.ts b/test/locale-imports.spec.ts index 229f782a818..b9a823b2e5d 100644 --- a/test/locale-imports.spec.ts +++ b/test/locale-imports.spec.ts @@ -5,7 +5,7 @@ import { keys } from '../src/internal/keys'; describe.each(keys(allLocales))('locale imports', (locale) => { it(`should be possible to directly require('@faker-js/faker/locale/${locale}')`, () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module + // eslint-disable-next-line @typescript-eslint/no-require-imports, unicorn/prefer-module const { faker } = require(`../dist/locale/${locale}.cjs`) as { faker: Faker; }; diff --git a/test/simple-faker.spec.ts b/test/simple-faker.spec.ts index 6602ed0f0d5..aa6f00c1892 100644 --- a/test/simple-faker.spec.ts +++ b/test/simple-faker.spec.ts @@ -9,10 +9,10 @@ describe('simpleFaker', () => { .filter((key) => typeof console[key] === 'function') .map((methodName) => vi.spyOn(console, methodName)); - // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module -- Using import() requires types being build but the CI / TS-Check runs without them. - require('..').simpleFaker; + // eslint-disable-next-line @typescript-eslint/no-require-imports, unicorn/prefer-module -- Using import() requires types being build but the CI / TS-Check runs without them. + expect(require('..').simpleFaker).toBeDefined(); - new SimpleFaker(); + expect(new SimpleFaker()).toBeDefined(); for (const spy of spies) { expect(spy).not.toHaveBeenCalled(); diff --git a/test/support/seeded-runs.ts b/test/support/seeded-runs.ts index 62b1d61613d..19ef410f02d 100644 --- a/test/support/seeded-runs.ts +++ b/test/support/seeded-runs.ts @@ -165,7 +165,7 @@ class TestGenerator< * * @param method The name of the method. */ - it>(method: TMethodName): this { + it(method: NoArgsMethodOf): this { return this.itRepeated(method, 1); } @@ -176,15 +176,12 @@ class TestGenerator< * @param method The name of the method. * @param repetitions The number of repetitions to run. */ - itRepeated>( - method: TMethodName, - repetitions: number - ): this { + itRepeated(method: NoArgsMethodOf, repetitions: number): this { this.expectNotTested(method); vi_it(method, () => this.callAndVerify( method, - [] as unknown as Parameters, + [] as unknown as Parameters]>, repetitions ) ); diff --git a/test/vitest-extensions.ts b/test/vitest-extensions.ts index 0a441d87425..5e94b6994ba 100644 --- a/test/vitest-extensions.ts +++ b/test/vitest-extensions.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-object-type */ import { expect } from 'vitest'; expect.extend({