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

Can't unignore patterns inside of ignore option #356

Closed
nzakas opened this issue Mar 23, 2022 · 2 comments
Closed

Can't unignore patterns inside of ignore option #356

nzakas opened this issue Mar 23, 2022 · 2 comments

Comments

@nzakas
Copy link

nzakas commented Mar 23, 2022

Environment

  • OS Version: Windows 10
  • Node.js Version: v16.3.0

Actual behavior

When specifying the ignore option, negated patterns are ignored.

Expected behavior

When specifying the ignore option, negated patterns should be honored.

Steps to reproduce

  1. Call fg or fg.sync with an ignore option specified containing a negated pattern.
  2. Note that the results do not reflect the negated pattern.

Code sample

This should return all JS files inside of a directory, ignoring lib but including lib/rules:

fg.sync[["**/*.js"], { ignore: ["**/lib/**", "!**/lib/rules/**"] })

However, the result is that no files from lib/rules are included in the results.

Note: .gitignore allows negated patterns such as this to re-include files that were previously ignored.

@mrmlnc
Copy link
Owner

mrmlnc commented Jun 11, 2022

Hello, @nzakas,

Thanks for reporting this issue. Yes, you are right. Right now there is no way to use negative patterns in the ignore option to cancel previous patterns.

There is already an issue for this problem — #86. I will close this ticket in favor of the existing one.

@nzakas
Copy link
Author

nzakas commented Jun 14, 2022

Ah thanks! I will follow that one.

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

No branches or pull requests

2 participants