Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Escape { and ( characters in convertIgnorePatternToMinimatch #79

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request?

Improves correctness of convertIgnorePatternToMinimatch() by escaping { and ( characters, which are just literal characters in gitignore patterns but can form brace expansion or extglob syntax in minimatch patterns.

For example, gitignore pattern src/{a,b}.js ignores file src/{a,b}.js. But, the same minimatch pattern src/{a,b}.js ignores files src/a.js and src/b.js. By escaping {, we get a minimatch pattern src/\{a,b}.js that matches the same as gitignore pattern src/{a,b}.js.

What changes did you make? (Give an overview)

Updated convertIgnorePatternToMinimatch() to escape { and ( characters.

Related Issues

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Jul 4, 2024
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@nzakas nzakas merged commit 811c3d7 into main Jul 5, 2024
14 checks passed
@nzakas nzakas deleted the compat-escape-braces branch July 5, 2024 14:51
@github-actions github-actions bot mentioned this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

None yet

2 participants