Skip to content

Commit

Permalink
fix(scan-dirs): add tsx and jsx into default file extensions (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
noootwo authored Nov 29, 2024
1 parent 98e41db commit 1c0aaeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/node/scan-dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ const FileExtensionLookup = [
'mts',
'cts',
'ts',
'tsx',
'mjs',
'cjs',
'js',
'jsx',
]

const FileLookupPatterns = `*.{${FileExtensionLookup.join(',')}}`
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export interface Unimport {
*/
injectImports: (code: string | MagicString, id?: string, options?: InjectImportsOptions) => Promise<ImportInjectionResult>

scanImportsFromDir: (dir?: string[], options?: ScanDirExportsOptions) => Promise<Import[]>
scanImportsFromDir: (dir?: (string | ScanDir)[], options?: ScanDirExportsOptions) => Promise<Import[]>
scanImportsFromFile: (file: string, includeTypes?: boolean) => Promise<Import[]>

/**
Expand Down

0 comments on commit 1c0aaeb

Please sign in to comment.