Skip to content

Commit

Permalink
Minor fixes in git ignores parser
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Mar 28, 2024
1 parent e886db0 commit e455527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/knip/src/util/globby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function parseGitignoreFile(filePath: string) {
return file
.split(/\r?\n/)
.filter(line => line && !line.startsWith('#'))
.map(pattern => convertGitignoreToMicromatch(pattern.replace(/#.*/, '').trim()));
.map(pattern => convertGitignoreToMicromatch(pattern.replace(/(?<!\\)#.*/, '').trim()));
}

async function parseFindGitignores(options: Options): Promise<Gitignores> {
Expand Down

0 comments on commit e455527

Please sign in to comment.