Skip to content

Commit fd9ea26

Browse files
committed
fix: handle undefined ignore in TypeScript rules
1 parent 33b5842 commit fd9ea26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/typescript.cts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ function globifyGitIgnoreFileWithDeps(cwd: string, include: boolean) {
1616
const globifyGitIgnoreFileSync = makeSynchronous(globifyGitIgnoreFileWithDeps) as (
1717
cwd: string,
1818
include: boolean,
19-
) => GlobifiedEntry[]
19+
) => GlobifiedEntry[] | undefined
2020

2121
/** Check if there are any tsconfig.json files */
2222
function disableProjectBasedRules() {
2323
// get all the files that are ignored by git
24-
const ignore = globifyGitIgnoreFileSync(".", true).map((entry) => {
24+
const ignore = globifyGitIgnoreFileSync(".", true)?.map((entry) => {
2525
if (entry.included) {
2626
return `!${entry.glob}`
2727
}
2828
return entry.glob
29-
})
29+
}) ?? []
3030
ignore.push("./**/.git/**", "./**/node_modules/**")
3131

3232
// check if there are any ts files

0 commit comments

Comments
 (0)