11import 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'
33import { pluginAntfu } from '../plugins'
44import { interopDefault , renameRules , toArray } from '../shared'
55import type {
@@ -27,6 +27,10 @@ export async function typescript(
2727 ]
2828
2929 const filesTypeAware = options . filesTypeAware ?? [ GLOB_TS , GLOB_TSX ]
30+ const ignoresTypeAware = options . ignoresTypeAware ?? [
31+ `${ GLOB_MARKDOWN } /**` ,
32+ GLOB_ASTRO_TS ,
33+ ]
3034
3135 const tsconfigPath = options ?. tsconfigPath
3236 ? toArray ( options . tsconfigPath )
@@ -99,7 +103,7 @@ export async function typescript(
99103 // assign type-aware parser for type-aware files and type-unaware parser for the rest
100104 ...( isTypeAware
101105 ? [
102- makeParser ( true , filesTypeAware ) ,
106+ makeParser ( true , filesTypeAware , ignoresTypeAware ) ,
103107 makeParser ( false , files , filesTypeAware ) ,
104108 ]
105109 : [ makeParser ( false , files ) ] ) ,
@@ -156,6 +160,7 @@ export async function typescript(
156160 ? [
157161 {
158162 files : filesTypeAware ,
163+ ignores : ignoresTypeAware ,
159164 name : 'coderwyd/typescript/rules-type-aware' ,
160165 rules : {
161166 ...( tsconfigPath ? typeAwareRules : { } ) ,
@@ -165,7 +170,7 @@ export async function typescript(
165170 ]
166171 : [ ] ) ,
167172 {
168- files : [ '**/*.d.ts' ] ,
173+ files : [ GLOB_TS ] ,
169174 name : 'coderwyd/typescript/disables/dts' ,
170175 rules : {
171176 'eslint-comments/no-unlimited-disable' : 'off' ,
0 commit comments