From ca7657c7284da3ca6f1262984f2ba9bc49eb7c34 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 19 Aug 2024 21:56:49 +0200 Subject: [PATCH] chore: fix lint errors --- eslint.config.js | 10 +--------- test/locale-imports.spec.ts | 2 +- test/simple-faker.spec.ts | 6 +++--- test/support/seeded-runs.ts | 4 +++- test/vitest-extensions.ts | 1 + 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index f79a2db75ab..679cf7a4b1d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,6 +27,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 +58,6 @@ export default tseslint.config( '@typescript-eslint': tseslint.plugin, }, languageOptions: { - parser: tseslint.parser, parserOptions: { project: true, warnOnUnsupportedTypeScriptVersion: false, @@ -148,13 +148,6 @@ export default tseslint.config( // @ts-expect-error: Just eat it! fixupPluginRules(eslintPluginDeprecation), }, - languageOptions: { - parser: tseslint.parser, - parserOptions: { - project: true, - warnOnUnsupportedTypeScriptVersion: false, - }, - }, rules: { 'deprecation/deprecation': 'error', }, @@ -162,7 +155,6 @@ export default tseslint.config( //#endregion //#region unicorn - // @ts-expect-error: Ignore for now eslintPluginUnicorn.configs['flat/recommended'], { rules: { 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..c9c6b00fcfa 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,6 +176,8 @@ class TestGenerator< * @param method The name of the method. * @param repetitions The number of repetitions to run. */ + // TODO @ST-DDT 2024-08-19: https://github.com/typescript-eslint/typescript-eslint/issues/9828 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters itRepeated>( method: TMethodName, repetitions: number 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({