Browse Source
chore: update eslint type (#4032)
* chore: update eslint type
* fix: test type error
---------
Co-authored-by: dong <196628497@qq.com>
pull/4035/head
Donny Wang
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
4 additions and
5 deletions
-
internal/lint-configs/eslint-config/src/configs/jsonc.ts
-
internal/lint-configs/eslint-config/src/configs/test.ts
-
internal/lint-configs/eslint-config/src/custom-config.ts
-
internal/lint-configs/eslint-config/src/index.ts
|
|
@ -51,7 +51,7 @@ export async function jsonc(): Promise<Linter.Config[]> { |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function sortPackageJson(): Linter.FlatConfig { |
|
|
function sortPackageJson(): Linter.Config { |
|
|
return { |
|
|
return { |
|
|
files: ['**/package.json'], |
|
|
files: ['**/package.json'], |
|
|
rules: { |
|
|
rules: { |
|
|
@ -130,7 +130,7 @@ function sortPackageJson(): Linter.FlatConfig { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function sortTsconfig(): Linter.FlatConfig { |
|
|
function sortTsconfig(): Linter.Config { |
|
|
return { |
|
|
return { |
|
|
files: [ |
|
|
files: [ |
|
|
'**/tsconfig.json', |
|
|
'**/tsconfig.json', |
|
|
|
|
|
@ -22,7 +22,6 @@ export async function test(): Promise<Linter.Config[]> { |
|
|
test: { |
|
|
test: { |
|
|
...pluginTest, |
|
|
...pluginTest, |
|
|
rules: { |
|
|
rules: { |
|
|
// @ts-expect-error - no types
|
|
|
|
|
|
...pluginTest.rules, |
|
|
...pluginTest.rules, |
|
|
...pluginNoOnlyTests.rules, |
|
|
...pluginNoOnlyTests.rules, |
|
|
}, |
|
|
}, |
|
|
|
|
|
@ -6,7 +6,7 @@ const restrictedImportIgnores = [ |
|
|
'**/postcss.config.mjs', |
|
|
'**/postcss.config.mjs', |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
const customConfig: Linter.FlatConfig[] = [ |
|
|
const customConfig: Linter.Config[] = [ |
|
|
// shadcn-ui 内部组件是自动生成的,不做太多限制
|
|
|
// shadcn-ui 内部组件是自动生成的,不做太多限制
|
|
|
{ |
|
|
{ |
|
|
files: ['packages/@core/ui-kit/shadcn-ui/**/**'], |
|
|
files: ['packages/@core/ui-kit/shadcn-ui/**/**'], |
|
|
|
|
|
@ -21,7 +21,7 @@ import { |
|
|
} from './configs'; |
|
|
} from './configs'; |
|
|
import { customConfig } from './custom-config'; |
|
|
import { customConfig } from './custom-config'; |
|
|
|
|
|
|
|
|
type FlatConfig = Linter.FlatConfig; |
|
|
type FlatConfig = Linter.Config; |
|
|
|
|
|
|
|
|
type FlatConfigPromise = |
|
|
type FlatConfigPromise = |
|
|
| FlatConfig |
|
|
| FlatConfig |
|
|
|