Skip to content

Commit 35f6763

Browse files
ryoppippiantfu
andauthored
fix: override type-aware rules properly (#585)
Co-authored-by: Anthony Fu <github@antfu.me>
1 parent e638315 commit 35f6763

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/configs/typescript.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export async function typescript(
1010
const {
1111
componentExts = [],
1212
overrides = {},
13+
overridesTypeAware = {},
1314
parserOptions = {},
1415
type = 'app',
1516
} = options
@@ -166,7 +167,10 @@ export async function typescript(
166167
files: filesTypeAware,
167168
ignores: ignoresTypeAware,
168169
name: 'antfu/typescript/rules-type-aware',
169-
rules: typeAwareRules,
170+
rules: {
171+
...typeAwareRules,
172+
...overridesTypeAware,
173+
},
170174
}]
171175
: [],
172176
{

src/types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ export interface OptionsTypeScriptWithTypes {
152152
* @see https://typescript-eslint.io/linting/typed-linting/
153153
*/
154154
tsconfigPath?: string
155+
156+
/**
157+
* Override type aware rules.
158+
*/
159+
overridesTypeAware?: TypedFlatConfigItem['rules']
155160
}
156161

157162
export interface OptionsHasTypeScript {

0 commit comments

Comments
 (0)