fix: anchor ignore patterns to the config file's directory - #325
Open
MaximeGaudin wants to merge 2 commits into
Open
MaximeGaudin wants to merge 2 commits into
MaximeGaudin wants to merge 2 commits into
Conversation
4 tasks
MaximeGaudin
added a commit
that referenced
this pull request
Aug 29, 2026
* test: reproduce #25 — ignore patterns are not anchored to the config file Anchored, bare-name, leading-slash, negated, user-global-config, subdirectory-config and --ignore-path cases, all red before the fix. * fix: anchor ignore patterns to the config file's directory (#25) Patterns in `ignore` used to be matched as typed, so `fixtures/**` read like a .gitignore entry and matched nothing. Every pattern is now anchored to the directory of the file that named it: a pattern with a `/` is a path from there, a bare name matches at any depth below it, and a trailing `/**` excludes the named directory itself. `!` negation keeps winning over the plain patterns, anchored to the same directory. This makes the user-global config speak for its own tree and gives --ignore-path files the same rule — patterns in one are relative to that file's own directory — which supersedes the intent of #325 folded into #327's Ignore design. Fixes #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ignore = ["fixtures/**"]read like a.gitignoreentry but matched nothing: the pattern was compared against the paths as typed on the command line, so only a defensive**/prefix worked, and nobody had documented that.[[plugins]] pathalready uses:fixtures/**means the fixtures folder besideslint.tomlno matter how the path was passed, and a leading**/(or only that) still reaches everywhere. Matching is done against the resolved path, so relative and absolute invocations behave the same.Note: this PR, #323 and #324 all extend the same README/config.mdx paragraph; expect small textual conflicts when merging whichever lands second.
Fixes #25
Test plan
**/-prefixed patterns, including a non-canonical invocation path./scripts/check.sh, JS included)