Skip to content

Commit

Permalink
fix: override type-aware rules properly (#585)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <github@antfu.me>
  • Loading branch information
ryoppippi and antfu authored Aug 22, 2024
1 parent e638315 commit 35f6763
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export async function typescript(
const {
componentExts = [],
overrides = {},
overridesTypeAware = {},
parserOptions = {},
type = 'app',
} = options
Expand Down Expand Up @@ -166,7 +167,10 @@ export async function typescript(
files: filesTypeAware,
ignores: ignoresTypeAware,
name: 'antfu/typescript/rules-type-aware',
rules: typeAwareRules,
rules: {
...typeAwareRules,
...overridesTypeAware,
},
}]
: [],
{
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ export interface OptionsTypeScriptWithTypes {
* @see https://typescript-eslint.io/linting/typed-linting/
*/
tsconfigPath?: string

/**
* Override type aware rules.
*/
overridesTypeAware?: TypedFlatConfigItem['rules']
}

export interface OptionsHasTypeScript {
Expand Down

0 comments on commit 35f6763

Please sign in to comment.