-
-
Notifications
You must be signed in to change notification settings - Fork 722
feat(linter): support ignorePatterns for nested configs
#12210
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
feat(linter): support ignorePatterns for nested configs
#12210
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #12210 will not alter performanceComparing Summary
|
3689fdf to
1b07bcd
Compare
1eef972 to
8f3f757
Compare
...ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts .@oxlint.snap
Show resolved
Hide resolved
8f3f757 to
f43d9d5
Compare
bb5556e to
83c7ff0
Compare
743fc71 to
ca998c8
Compare
|
@camc314 /ping |
6a31ecc to
e80b8f3
Compare
e80b8f3 to
a3a078f
Compare
...nsion__eslintrc.json fixtures__config_ignore_patterns__ignore_extension__main.js@oxlint.snap
Show resolved
Hide resolved
...rc/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c eslintrc.json@oxlint.snap
Outdated
Show resolved
Hide resolved
a3a078f to
40dd0a0
Compare
30316bd to
5d133b9
Compare
5d133b9 to
129fd28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for respecting ignorePatterns configuration in nested oxlint configurations. Previously, only ignorePatterns from the base configuration file were honored, but now all nested configurations properly apply their ignore patterns to files within their respective scopes.
- Moves ignore pattern processing from CLI to the config system
- Updates ignore pattern syntax from exact matches to glob patterns (e.g.,
"test_plugin"→"test_plugin/**") - Integrates ignore functionality into the language server to respect nested ignore patterns
Reviewed Changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_linter/src/config/mod.rs |
Adds ignore pattern resolution and storage to LintConfig |
crates/oxc_linter/src/config/config_store.rs |
Implements ignore pattern checking logic using nearest config resolution |
crates/oxc_linter/src/config/config_builder.rs |
Integrates ignore pattern resolution during config building |
crates/oxc_linter/src/service/mod.rs |
Exposes ignore checking method for language server |
crates/oxc_language_server/src/linter/server_linter.rs |
Removes redundant ignore pattern processing from server |
crates/oxc_language_server/src/linter/isolated_lint_handler.rs |
Adds ignore pattern check before linting files |
apps/oxlint/src/lint.rs |
Removes CLI-level ignore pattern processing in favor of config-level handling |
| Multiple test fixtures | Updates ignore patterns to use glob syntax |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
129fd28 to
03885ec
Compare
|
@camc314 Sorry to bother, but I am getting a bit frustrated resolving the merge conflicts >.< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the wait! thanks for fixing this!
Merge activity
|
03885ec to
aecacae
Compare
"ignorePatterns": [
- "vendor/",
+ "apps/api/public/vendor/**"
],Had to alter my config after this change, the diff shows before and after. Not sure how important this is to anyone else, I don't have a nested config and want to ignore "ignorePatterns": [
- "vendor/",
+ "**/vendor/**"
],This works too. |
closes #13204 Why I need now a `GitignoreBuilder` instead of `OverrideBuilder` like before #12210. Because `Gitignore::matched_path_or_any_parents` only allows paths inside his root, I needed to "trick" a bit. Or else the test with `--config another/directory/config.json` would fail. Now, the base `ignorePatterns` will always be at the current working directory.

Now every
ignorePatternsconfiguration in nested configuration are respected.Before, only
ignorePatterns, which are located in the base-configuration of the project, would be respected.Closes #11067
Closes #12857
Closes #11969