Skip to content

Commit e56bbbe

Browse files
committed
feat: update some rules
1 parent 77223b4 commit e56bbbe

File tree

7 files changed

+10
-16
lines changed

7 files changed

+10
-16
lines changed

src/configs/sort.ts

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export function sortTsconfig(): TypedFlatConfigItem[] {
219219
'allowSyntheticDefaultImports',
220220
'esModuleInterop',
221221
'forceConsistentCasingInFileNames',
222+
'isolatedDeclarations',
222223
'isolatedModules',
223224
'preserveSymlinks',
224225
'verbatimModuleSyntax',

src/configs/svelte.ts

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export async function svelte(
8282
'svelte/no-useless-mustaches': 'error',
8383
'svelte/require-store-callbacks-use-set-param': 'error',
8484
'svelte/system': 'error',
85-
'svelte/valid-compile': 'error',
8685
'svelte/valid-each-key': 'error',
8786

8887
'unused-imports/no-unused-vars': [

src/configs/test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export async function test(
5353
'test/prefer-hooks-in-order': 'error',
5454
'test/prefer-lowercase-title': 'error',
5555

56+
'ts/explicit-function-return-type': 'off',
57+
5658
...overrides,
5759
},
5860
},

src/configs/typescript.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import process from 'node:process'
22
import { GLOB_ASTRO_TS, GLOB_DTS, GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from '../constants/glob'
33
import { pluginAntfu } from '../plugins'
4-
import { interopDefault, renameRules, toArray } from '../shared'
4+
import { interopDefault, renameRules } from '../shared'
55
import type {
66
OptionsComponentExts,
77
OptionsFiles,
@@ -32,9 +32,7 @@ export async function typescript(
3232
GLOB_ASTRO_TS,
3333
]
3434

35-
const tsconfigPath = options?.tsconfigPath
36-
? toArray(options.tsconfigPath)
37-
: undefined
35+
const tsconfigPath = options.tsconfigPath
3836
const isTypeAware = !!tsconfigPath
3937

4038
const typeAwareRules: TypedFlatConfigItem['rules'] = {
@@ -129,7 +127,7 @@ export async function typescript(
129127
'no-useless-constructor': 'off',
130128
'ts/ban-ts-comment': [
131129
'error',
132-
{ 'ts-ignore': 'allow-with-description' },
130+
{ 'ts-expect-error': 'allow-with-description' },
133131
],
134132
'ts/consistent-type-definitions': ['error', 'interface'],
135133
'ts/consistent-type-imports': [
@@ -155,7 +153,6 @@ export async function typescript(
155153
],
156154
'ts/no-useless-constructor': 'off',
157155
'ts/no-wrapper-object-types': 'error',
158-
'ts/prefer-ts-expect-error': 'error',
159156
'ts/triple-slash-reference': 'off',
160157
'ts/unified-signatures': 'off',
161158
...overrides,

src/constants/glob.ts

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const GLOB_EXCLUDE = [
7575
'**/.vitepress/cache',
7676
'**/.nuxt',
7777
'**/.next',
78+
'**/.svelte-kit',
7879
'**/.vercel',
7980
'**/.changeset',
8081
'**/.idea',

src/index.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fs from 'node:fs'
21
import {
32
command,
43
comments,
@@ -121,13 +120,8 @@ export async function defineConfig(
121120
)
122121
}
123122
else {
124-
if (fs.existsSync('.gitignore')) {
125-
configs.push(
126-
interopDefault(import('eslint-config-flat-gitignore')).then(r => [
127-
r(),
128-
]),
129-
)
130-
}
123+
configs.push(interopDefault(import('eslint-config-flat-gitignore'))
124+
.then(r => [r({ strict: false })]))
131125
}
132126
}
133127

src/types/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export interface OptionsTypeScriptWithTypes {
9696
* When this options is provided, type aware rules will be enabled.
9797
* @see https://typescript-eslint.io/linting/typed-linting/
9898
*/
99-
tsconfigPath?: string | string[]
99+
tsconfigPath?: string
100100
}
101101

102102
export interface OptionsHasTypeScript {

0 commit comments

Comments
 (0)