Skip to content

fix(linter): report an error on unsupported extends values#21406

Merged
camc314 merged 7 commits intooxc-project:mainfrom
costajohnt:fix/warn-on-unknown-named-config
Apr 15, 2026
Merged

fix(linter): report an error on unsupported extends values#21406
camc314 merged 7 commits intooxc-project:mainfrom
costajohnt:fix/warn-on-unknown-named-config

Conversation

@costajohnt
Copy link
Copy Markdown
Contributor

@costajohnt costajohnt commented Apr 14, 2026

Fixes #20831

Previously, when an entry in the extends array looks like a named config (no . in the path), oxlint silently skips it. This is confusing when the entry is a typo or invalid value, since no error or warning is shown.

This PR corrects this behaviour, and now emits an error for any extends values that are invalid.

@costajohnt costajohnt requested a review from camc314 as a code owner April 14, 2026 02:20
@github-actions github-actions Bot added A-linter Area - Linter C-bug Category - Bug labels Apr 14, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 14, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing costajohnt:fix/warn-on-unknown-named-config (b83a94b) with main (cf2d281)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Comment thread crates/oxc_linter/src/config/config_builder.rs Outdated
@github-actions github-actions Bot added the A-cli Area - CLI label Apr 14, 2026
Copy link
Copy Markdown
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

this is great, but can you make this a hard error rather than a warning?

Also looks like the lint CI job failed - you can just disable the clippy warning for this line

Thanks!

@camc314 camc314 self-assigned this Apr 14, 2026
costajohnt and others added 4 commits April 14, 2026 13:41
When an entry in the `extends` array doesn't contain a `.` and doesn't
match known ESLint prefixes (`eslint:` or `plugin:`), it is heuristically
skipped as a potential named config. Previously this was completely silent,
which confused users who had typos or invalid entries.

Now emits a warning for these entries so users know they are being
skipped and can fix the config. Known ESLint prefixes are still skipped
silently since they are clearly intentional.

Also fixed the dead `Path::starts_with` checks (PathBuf component
matching, not string prefix matching) by converting to string first.

Fixes oxc-project#20831
@costajohnt costajohnt force-pushed the fix/warn-on-unknown-named-config branch from 71c451b to 8b3ca5b Compare April 14, 2026 20:41
costajohnt and others added 2 commits April 14, 2026 14:13
Switch from warning to hard error when unsupported named configs
(e.g., "prettier", "eslint:recommended", "plugin:unicorn/recommended")
appear in extends. Since oxlint doesn't auto-discover ESLint config
files, any named config in extends is either a mistake or a leftover
from ESLint migration.

Removes the warnings field from ConfigStoreBuilder and the eprintln
loop in lint.rs, fixing the clippy::print_stderr lint failure.
Copy link
Copy Markdown
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

Thanks!

@camc314 camc314 changed the title fix(linter): warn on unsupported named configs in extends fix(linter): report an error on unsupported extends values Apr 15, 2026
@camc314 camc314 merged commit eab5934 into oxc-project:main Apr 15, 2026
27 checks passed
camc314 added a commit that referenced this pull request Apr 20, 2026
# Oxlint
### 💥 BREAKING CHANGES

- 24fb7eb allocator: [**BREAKING**] Rename `Box` and `Vec` methods
(#21395) (overlookmotel)

### 🚀 Features

- 38d8090 linter/jest: Implemented jest `version` settings in config
file. (#21522) (Said Atrahouch)
- 7dbbb99 linter/eslint: Implement suggestion for `no-case-declarations`
rule (#21508) (Mikhail Baev)
- 9b4d9f6 linter/prefer-template: Implement autofix (#21502) (François)
- daa64ed linter/no-empty-pattern: Add `allowObjectPatternsAsParameters`
option (#21474) (camc314)
- cf2d281 linter/typescript: Implement explicit-member-accessibility
(#21447) (Hunter Tunnicliff)
- d48de6f linter/unicorn: Add help messages to 3 rule diagnostics
(#21459) (Mukunda Rao Katta)
- cffdc2e linter: Backfill rule version metadata (#21391) (Old Autumn)

### 🐛 Bug Fixes

- 1e69b91 linter/no-useless-assignment: Improve diagnostic spans
(#21581) (camc314)
- f272594 linter/plugins: Align `RuleMeta.replacedBy` type with ESLint
(#21544) (bab)
- 4d57851 linter/eslint: Enhance `no-empty-function` rule to support
async and generator functions in VariableDeclarator (#21542) (Mikhail
Baev)
- 00fc136 codegen: Preserve coverage comments before object properties
(#21312) (bab)
- a56b7b9 oxlint: Dont enable gitlab formatter by default (#21501)
(camc314)
- 9c9b6a2 linter/array-callback-return: Ignore non-exit CFG dead ends
(#21497) (camc314)
- 61088e0 linter/unicorn: Handle computed property access in
`prefer-dom-node-remove` rule (#21470) (Mikhail Baev)
- eab5934 linter: Report an error on unsupported `extends` values
(#21406) (John Costa)
- 3289ba0 linter/valid-expect-in-promise: Check a jest fn to be `test`
instead of `describe` (#21422) (Said Atrahouch)
- 4417fe3 linter/prefer-ending-with-an-expect: Ignore vi.mock factory
callbacks (#21414) (Cédric Exbrayat)
- a904883 linter/consistent-type-imports: Ignore vue/svelte/astro files
(#21415) (bab)
- 2498fe6 linter/no-unused-vars: Allow segments of dotted namespace
declarations (#21416) (bab)
- 44b5b35 linter: Preserve vitest-compatible jest rules when applying
overrides (#21389) (Cameron)
- 7bd8331 linter/prefer-ending-with-an-expect: Add missing `version`
docs (#21390) (Said Atrahouch)
- 43d8f0d linter/no-useless-assignment: Ignore writes read by closures
(#21380) (camc314)

### 📚 Documentation

- c1eeae3 linter: Add version to `rule.json` (#21547) (camchenry)
- 0ec6ab2 linter: Improve the `vitest/no-importing-vitest-globals` rule
documentation. (#21557) (connorshea)
# Oxfmt
### 💥 BREAKING CHANGES

- 24fb7eb allocator: [**BREAKING**] Rename `Box` and `Vec` methods
(#21395) (overlookmotel)

### 🚀 Features

- 5aa7fe1 oxfmt: Add `--disable-nested-config` CLI flag (#21514)
(leaysgur)
- b5cb8d1 oxfmt: Update prettier to 3.8.3 (#21451) (leaysgur)
- 16713d5 oxfmt/cli: Support per-directory config (#21103) (leaysgur)
- 952de06 oxfmt/lsp: Support per-directory config (#21081) (leaysgur)

### 🐛 Bug Fixes

- a501a53 formatter: Handle comments after pipe in single-member union
types (#21487) (John Costa)
- 6f49fad oxfmt: Respect nested config.`ignorePatterns` (#21489)
(leaysgur)
- 7c98d52 oxfmt: Do not panic on finding invalid nested config (#21461)
(leaysgur)
- 41bb2d5 formatter: Preserve more `intrinsic` parens (#21449)
(leaysgur)
- f894750 formatter: Preserve parens around `intrinsic` in type alias
annotation (#21410) (Dunqing)

### ⚡ Performance

- df27b48 oxfmt: Skip ancestors check when no nested config found
(#21517) (leaysgur)
- 5e1522a oxfmt: Do not occupy the rayon thread solely for handover
(#21408) (leaysgur)

Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: invalid 'extends' values are silently ignored

3 participants