1
1
import process from 'node:process'
2
- import { GLOB_TS , GLOB_TSX } from '../constants/glob'
2
+ import { GLOB_ASTRO_TS , GLOB_MARKDOWN , GLOB_TS , GLOB_TSX } from '../constants/glob'
3
3
import { pluginAntfu } from '../plugins'
4
4
import { interopDefault , renameRules , toArray } from '../shared'
5
5
import type {
@@ -27,6 +27,10 @@ export async function typescript(
27
27
]
28
28
29
29
const filesTypeAware = options . filesTypeAware ?? [ GLOB_TS , GLOB_TSX ]
30
+ const ignoresTypeAware = options . ignoresTypeAware ?? [
31
+ `${ GLOB_MARKDOWN } /**` ,
32
+ GLOB_ASTRO_TS ,
33
+ ]
30
34
31
35
const tsconfigPath = options ?. tsconfigPath
32
36
? toArray ( options . tsconfigPath )
@@ -99,7 +103,7 @@ export async function typescript(
99
103
// assign type-aware parser for type-aware files and type-unaware parser for the rest
100
104
...( isTypeAware
101
105
? [
102
- makeParser ( true , filesTypeAware ) ,
106
+ makeParser ( true , filesTypeAware , ignoresTypeAware ) ,
103
107
makeParser ( false , files , filesTypeAware ) ,
104
108
]
105
109
: [ makeParser ( false , files ) ] ) ,
@@ -156,6 +160,7 @@ export async function typescript(
156
160
? [
157
161
{
158
162
files : filesTypeAware ,
163
+ ignores : ignoresTypeAware ,
159
164
name : 'coderwyd/typescript/rules-type-aware' ,
160
165
rules : {
161
166
...( tsconfigPath ? typeAwareRules : { } ) ,
@@ -165,7 +170,7 @@ export async function typescript(
165
170
]
166
171
: [ ] ) ,
167
172
{
168
- files : [ '**/*.d.ts' ] ,
173
+ files : [ GLOB_TS ] ,
169
174
name : 'coderwyd/typescript/disables/dts' ,
170
175
rules : {
171
176
'eslint-comments/no-unlimited-disable' : 'off' ,
0 commit comments