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

Allow to override default ignore with negative patterns #288

Closed
wants to merge 1 commit into from

Conversation

pvdlg
Copy link
Contributor

@pvdlg pvdlg commented Jan 20, 2018

Fix #65

In lintFiles instead of passing the ignores to globby ignores options, this PR invert the ignores patterns and pass them to globby within the pattern array.
The ignores pattern from the ignores options are concatenated to the default one so they can override them.

We have to invert the ignores patterns and pass them to the pattern parameter because node glob doesn't handle opposed patterns in the ignore options. In other words passing ['dir/**', '!dir/**'] or ['dir/**'] in the ignore options exclude the files in dir in both case. But passing ['!dir/**', 'dir/**'] in the pattern argument does include the files in dir.

@pvdlg pvdlg changed the title Allow to override default ignore with negative patterns [WIP] Allow to override default ignore with negative patterns Jan 20, 2018
@pvdlg pvdlg changed the title [WIP] Allow to override default ignore with negative patterns Allow to override default ignore with negative patterns Jan 20, 2018
@pvdlg
Copy link
Contributor Author

pvdlg commented Jan 21, 2018

This solution might be a good candidate for globby. Not sure where is the best place.

@sindresorhus
Copy link
Member

Yes, this should preferably be fixed in globby so all projects using it could benefit.

@sindresorhus
Copy link
Member

@pvdlg What should we do about this one?

@pvdlg
Copy link
Contributor Author

pvdlg commented Jun 24, 2018

We can close this PR. It should be done in globby. I'll get back to it at some point unless someone want to give it a shot.

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

Successfully merging this pull request may close these issues.

None yet

2 participants