From 7994d664fd3e8564b664ffec0c0ab6ee2e89fa79 Mon Sep 17 00:00:00 2001 From: Donny Wang <53386850+coderwyd@users.noreply.github.com> Date: Sun, 4 Aug 2024 13:02:01 +0800 Subject: [PATCH] chore: update eslint type (#4032) * chore: update eslint type * fix: test type error --------- Co-authored-by: dong <196628497@qq.com> --- internal/lint-configs/eslint-config/src/configs/jsonc.ts | 4 ++-- internal/lint-configs/eslint-config/src/configs/test.ts | 1 - internal/lint-configs/eslint-config/src/custom-config.ts | 2 +- internal/lint-configs/eslint-config/src/index.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/lint-configs/eslint-config/src/configs/jsonc.ts b/internal/lint-configs/eslint-config/src/configs/jsonc.ts index bc436cf7..4072e4cd 100644 --- a/internal/lint-configs/eslint-config/src/configs/jsonc.ts +++ b/internal/lint-configs/eslint-config/src/configs/jsonc.ts @@ -51,7 +51,7 @@ export async function jsonc(): Promise { ]; } -function sortPackageJson(): Linter.FlatConfig { +function sortPackageJson(): Linter.Config { return { files: ['**/package.json'], rules: { @@ -130,7 +130,7 @@ function sortPackageJson(): Linter.FlatConfig { }; } -function sortTsconfig(): Linter.FlatConfig { +function sortTsconfig(): Linter.Config { return { files: [ '**/tsconfig.json', diff --git a/internal/lint-configs/eslint-config/src/configs/test.ts b/internal/lint-configs/eslint-config/src/configs/test.ts index 03bf9acd..ddfde2b8 100644 --- a/internal/lint-configs/eslint-config/src/configs/test.ts +++ b/internal/lint-configs/eslint-config/src/configs/test.ts @@ -22,7 +22,6 @@ export async function test(): Promise { test: { ...pluginTest, rules: { - // @ts-expect-error - no types ...pluginTest.rules, ...pluginNoOnlyTests.rules, }, diff --git a/internal/lint-configs/eslint-config/src/custom-config.ts b/internal/lint-configs/eslint-config/src/custom-config.ts index 62a96714..13526bcc 100644 --- a/internal/lint-configs/eslint-config/src/custom-config.ts +++ b/internal/lint-configs/eslint-config/src/custom-config.ts @@ -6,7 +6,7 @@ const restrictedImportIgnores = [ '**/postcss.config.mjs', ]; -const customConfig: Linter.FlatConfig[] = [ +const customConfig: Linter.Config[] = [ // shadcn-ui 内部组件是自动生成的,不做太多限制 { files: ['packages/@core/ui-kit/shadcn-ui/**/**'], diff --git a/internal/lint-configs/eslint-config/src/index.ts b/internal/lint-configs/eslint-config/src/index.ts index 023c5806..c9f08bd5 100644 --- a/internal/lint-configs/eslint-config/src/index.ts +++ b/internal/lint-configs/eslint-config/src/index.ts @@ -21,7 +21,7 @@ import { } from './configs'; import { customConfig } from './custom-config'; -type FlatConfig = Linter.FlatConfig; +type FlatConfig = Linter.Config; type FlatConfigPromise = | FlatConfig