Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

fix: Config with just ignores should not always be applied #89

Merged
merged 3 commits into from
May 12, 2023
Merged

Conversation

nzakas
Copy link
Contributor

@nzakas nzakas commented May 9, 2023

When a config has ignores and not files, plus at least one other key, it should match all files that don't match ignores and the other keys should be merged into the resulting config only if the filename matches a files pattern in another config.

Prior to this, such a config was always merged in regardless if the filename matched ignores; after this change, it correctly merges in only when ignores matches.

Refs eslint/eslint#17103

cc @mdjermanovic

When a config has `ignores` and not `files`, plus at least one other
key, it should match all files that don't match `ignores` and the other
keys should be merged into the resulting config.

Prior to this, such a config was always merged in regardless if the
filename matched `ignores`; after this change, it correctly merges in
only when `ignores` matches.

Refs eslint/eslint#17103
src/config-array.js Outdated Show resolved Hide resolved
tests/config-array.test.js Outdated Show resolved Hide resolved
@nzakas nzakas changed the title fix: Config with just ignores should check ignores fix: Config with just ignores should not always be applied May 11, 2023
@nzakas
Copy link
Contributor Author

nzakas commented May 11, 2023

Okay, I think I got this straightened out now.

Copy link
Contributor

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

Code LGTM, but I think a test for this change is missing as all the new tests are passing with the old code too.

tests/config-array.test.js Show resolved Hide resolved
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@nzakas
Copy link
Contributor Author

nzakas commented May 12, 2023

Ah thanks. I added the test.

@nzakas nzakas merged commit 5ed9c2c into main May 12, 2023
@nzakas nzakas deleted the ignore-fix branch May 12, 2023 18:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants