Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggested replacement for addIgnoreFile doesn't work always #108

Closed
dhilgarth opened this issue Jan 26, 2024 · 4 comments
Closed

Suggested replacement for addIgnoreFile doesn't work always #108

dhilgarth opened this issue Jan 26, 2024 · 4 comments

Comments

@dhilgarth
Copy link

With the attached .gitignore, the following code will return false

const ig = ignore.default();
ig.add(fs.readFileSync('.gitignore').toString());
console.log(ig.ignores('node_modules'));

I believe it's because of the BOM at the beginning of the file.

gitignore.zip

@dhilgarth dhilgarth changed the title Suggested replacement for addIgnoreFile doesn't work on Windows Suggested replacement for addIgnoreFile doesn't work always Jan 26, 2024
@kaelzhang
Copy link
Owner

kaelzhang commented Feb 1, 2024

confirmed. Nice catch buddy.

@kaelzhang
Copy link
Owner

kaelzhang commented Feb 1, 2024

I will do a complete tests for all zero-width chars

@kaelzhang
Copy link
Owner

Landed in 5.3.1

@dhilgarth
Copy link
Author

Awesome, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants