Skip to content

Commit be3efc6

Browse files
committedDec 26, 2023
fix: allow const enum in dts file
1 parent 8ff5311 commit be3efc6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎src/configs/typescript.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GLOB_TS, GLOB_TSX } from '../globs'
1+
import { GLOB_JS, GLOB_TS, GLOB_TSX } from '../globs'
22
import { parserTypeScript, pluginAntfu, pluginTypeScript } from '../plugins'
33
import { restrictedSyntaxJs } from './javascript'
44
import type { FlatESLintConfigItem } from 'eslint-define-config'
@@ -69,10 +69,16 @@ export const typescript: FlatESLintConfigItem[] = [
6969
},
7070
},
7171
{
72-
files: ['**/*.js', '**/*.cjs'],
72+
files: [GLOB_JS, '**/*.cjs'],
7373
rules: {
7474
'@typescript-eslint/no-require-imports': 'off',
7575
'@typescript-eslint/no-var-requires': 'off',
7676
},
7777
},
78+
{
79+
files: ['**/*.d.ts'],
80+
rules: {
81+
'no-restricted-syntax': ['error', ...restrictedSyntaxJs],
82+
},
83+
},
7884
]

0 commit comments

Comments
 (0)
Please sign in to comment.