Skip to content

Commit bef7d7a

Browse files
committed
fix: skip dts
1 parent 3e5773c commit bef7d7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/enum.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'node:assert'
22
import { spawnSync } from 'node:child_process'
33
import { readFileSync } from 'node:fs'
44
import path from 'node:path'
5-
import { babelParse, getLang, isTs } from 'ast-kit'
5+
import { babelParse, getLang, isDts, isTs } from 'ast-kit'
66
import picomatch from 'picomatch'
77
import { globSync } from 'tinyglobby'
88
import type { OptionsResolved } from './options'
@@ -70,7 +70,7 @@ export function scanEnums(options: ScanOptions): EnumData {
7070
// 2. parse matched files to collect enum info
7171
for (const file of files) {
7272
const lang = getLang(file)
73-
if (!isTs(lang)) continue
73+
if (!isTs(lang) || isDts(file)) continue
7474

7575
const content = readFileSync(file, 'utf8')
7676
const ast = babelParse(content, lang)

0 commit comments

Comments
 (0)