feat(linter): introduce typeAware as config options#19614
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
853f5a3 to
bf890a9
Compare
bf890a9 to
613f5b0
Compare
4862be1 to
7d7d0b0
Compare
613f5b0 to
cf5d8df
Compare
cf5d8df to
26c42b9
Compare
|
TODO: add a test case to make sure we merge options correctly in extenss |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new options object in the Oxlint configuration schema to support options.typeAware, allowing type-aware linting to be enabled via config (in addition to CLI/LSP flags), with updated CLI/LSP behavior and expanded test coverage.
Changes:
- Add
OxlintOptions/options.typeAwareto Rust config model and JSON schema outputs. - Make CLI and LSP compute an “effective” type-aware setting using config + flags (LSP options can override config).
- Reject
options.typeAwarewhen it appears in nested configs, and add fixtures/snapshots validating the behavior.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tasks/website_linter/src/snapshots/schema_markdown.snap | Updates schema docs snapshot to include options.typeAware. |
| tasks/website_linter/src/snapshots/schema_json.snap | Updates schema JSON snapshot with options + OxlintOptions. |
| npm/oxlint/configuration_schema.json | Publishes options and OxlintOptions in shipped schema. |
| crates/oxc_linter/src/config/oxlintrc.rs | Adds OxlintOptions and wires it into Oxlintrc merge/serde/schema + tests. |
| crates/oxc_linter/src/config/mod.rs | Adds options to LintConfig and imports OxlintOptions. |
| crates/oxc_linter/src/config/config_store.rs | Exposes type_aware_enabled() and updates tests/builders for new field. |
| crates/oxc_linter/src/config/config_builder.rs | Propagates options into built LintConfig and exposes type_aware() accessor. |
| crates/oxc_language_server/README.md | Documents LSP typeAware as nullable/inheriting from config. |
| apps/oxlint/test/lsp/utils.ts | Allows passing typeAware initialization option in test harness. |
| apps/oxlint/test/lsp/lint/lint.test.ts | Adds LSP fixture cases for config-driven type aware and override behavior. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-type-aware/test.ts | New fixture file for type-aware config behavior. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-type-aware/test-with-lsp-config.ts | New fixture file for LSP override behavior. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-type-aware/oxlint.config.ts | New JS config enabling options.typeAware. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-nested-type-aware-invalid/oxlint.config.ts | New fixture root config for nested-config behavior. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-nested-type-aware-invalid/nested/test.ts | New nested fixture file. |
| apps/oxlint/test/lsp/lint/fixtures/config-ts-nested-type-aware-invalid/nested/oxlint.config.ts | New nested JS config using options.typeAware. |
| apps/oxlint/test/lsp/lint/snapshots/lint.test.ts.snap | Snapshot updates for new fixtures/behavior. |
| apps/oxlint/test/fixtures/js_config_type_aware/oxlint.config.ts | Adds CLI fixture using options.typeAware in JS config. |
| apps/oxlint/test/fixtures/js_config_type_aware/output.snap.md | Snapshot for CLI fixture output. |
| apps/oxlint/test/fixtures/js_config_type_aware/files/test.js | CLI fixture input file. |
| apps/oxlint/test/fixtures/js_config_invalid_cli_arg/output.snap.md | Updates expected unknown-field list to include options. |
| apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_type_aware_config@test.ts.snap | New/updated LSP snapshot for config-driven type aware. |
| apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_type_aware_config@test-with-lsp-config.ts.snap | New/updated LSP snapshot for LSP override behavior. |
| apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_nested_type_aware@test-root.ts_nested__test.ts.snap | New/updated LSP snapshot for nested typeAware rejection. |
| apps/oxlint/src/lsp/server_linter.rs | Uses config-derived typeAware when LSP option is unset; updates watcher logic; tests. |
| apps/oxlint/src/lsp/options.rs | Changes LSP type_aware option from bool to Option<bool> and parsing/tests. |
| apps/oxlint/src/lint.rs | CLI now ORs --type-aware with root config options.typeAware. |
| apps/oxlint/src/config_loader.rs | Rejects options.typeAware in nested configs; adds root-dir-aware loader + tests. |
| apps/oxlint/src-js/package/config.generated.ts | Adds options?: OxlintOptions and OxlintOptions.typeAware typings. |
| apps/oxlint/fixtures/tsgolint/config-type-aware.json | Adds CLI fixture enabling type aware via JSON config. |
| apps/oxlint/fixtures/tsgolint/config-type-aware-with-overrides.json | Adds fixture verifying overrides under type aware. |
| apps/oxlint/fixtures/tsgolint/config-type-aware-false.json | Adds fixture verifying disabled type aware. |
| apps/oxlint/fixtures/tsgolint/config-type-aware-false-with-overrides.json | Adds fixture verifying overrides when type aware is false. |
| apps/oxlint/fixtures/lsp/tsgolint/type_aware_config/test.ts | Adds LSP fixture input. |
| apps/oxlint/fixtures/lsp/tsgolint/type_aware_config/test-with-lsp-config.ts | Adds LSP fixture input for override case. |
| apps/oxlint/fixtures/lsp/tsgolint/type_aware_config/.oxlintrc.json | Adds LSP root config enabling options.typeAware. |
| apps/oxlint/fixtures/lsp/tsgolint/nested_type_aware/test-root.ts | Adds LSP fixture input. |
| apps/oxlint/fixtures/lsp/tsgolint/nested_type_aware/nested/test.ts | Adds LSP nested fixture input. |
| apps/oxlint/fixtures/lsp/tsgolint/nested_type_aware/nested/.oxlintrc.json | Adds nested config that should be rejected for options.typeAware. |
| apps/oxlint/fixtures/lsp/tsgolint/nested_type_aware/.oxlintrc.json | Adds LSP root config for nested-type-aware rejection scenario. |
26c42b9 to
65ce812
Compare
Merge activity
|
65ce812 to
694be7d
Compare
Closes oxc-project#15972. Adds `options.reportUnusedDisableDirectives` to `.oxlintrc.json`, following the same pattern as `typeAware` (oxc-project#19614) and `typeCheck` (oxc-project#19764). - Root-config-only (nested configs are rejected with a clear error) - CLI `--report-unused-disable-directives[-severity]` takes precedence over the config file value - Schema, TypeScript types, and website snapshots regenerated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Oxlint ### 🚀 Features - 2e0e1d0 linter/no-unused-vars: Add experimental fix mode controls (off|suggestion|fix) (#19774) (camc314) - f34f6fa linter: Introduce typeCheck config option (#19764) (camc314) - 694be7d linter: Introduce typeAware as config options (#19614) (camc314) - 655c38f semantic: Add "did you mean?" suggestions to undefined name errors (#19102) (copilot-swe-agent) - e97a57e linter/id-length: Use serde to deserialize rule options (#19636) (camc314) - c4a3677 parser: Report error for initializer in ambient context (#19187) (camc314) - 346045a linter/id-length: Add `checkGeneric` option (#19634) (camc314) ### 🐛 Bug Fixes - 1b7a937 linter: Correct double-comparisons fix with swapped operands (#19846) (camc314) - c308857 linter/consistent_type_imports: Add missing help and notes to diagnostics (#19827) (Daniel Osmond) - 7682e5a linter/plugins: Decode escapes in identifier tokens (#19838) (overlookmotel) - f368fcd linter/consistent_type_assertions: Add missing with_help and with_note to diagnostics (#19826) (Daniel Osmond) - 04e6223 npm: Add `preferUnplugged` for Yarn PnP compatibility (#19829) (Boshen) - 86d5037 linter: Add help text to no-extend-native, no-useless-backreference (#19733) (Anthony Amaro) - 50e8eff linter: Add .with_help() to operator-assignment, no-nonoctal-decimal-escape (#19732) (Anthony Amaro) - 1417bdc linter/no-wrapper-object-types: Add help messages to missing diagnostics (#19771) (Daniel Osmond) - 0838477 linter/ban_ts_comment: Add help and notes to missing diagnostics (#19781) (Daniel Osmond) - e8c77cf linter/adjacent_overload_signatures: Add missing diagnostics (#19780) (Daniel Osmond) - 28834ac linter/ban_types: Add missing help and note to diagnostics (#19782) (Daniel Osmond) - fd938d3 linter/prefer-enum-initializers: Add help messages to missing diagnostics (#19772) (Daniel Osmond) - eb928ee linter/no-dynamic-delete: Add help messages to missing diagnostics (#19768) (Daniel Osmond) - a985666 linter/no-empty-interface: Add help messages to missing diagnostics (#19769) (Daniel Osmond) - 2dc0ceb linter/no-extra-non-null-assertion: Add help messages to missing diagnostics (#19770) (Daniel Osmond) - 95d5d66 linter/no-dupe-keys: Handle `__proto__` proto setters in (#19762) (camc314) - 24ff0db linter/exhaustive-deps: False positive for member expressions in IIFEs (#19751) (Dennis Chen) - 7243a58 linter/no-use-before-define: Honor `ignoreTypeReferences` when value and type name collisions (#19747) (Dimava) - eefd818 linter/explicit-module-boundary-types: Add help messages to missing diagnostics (#19736) (Daniel Osmond) - 0440e9a linter: Add help text to no_control_regex, no_fallthrough, no_param_reassign (#19655) (Anthony Amaro) - e84cb2f react/display-name: Handle merged type+value context symbols (#19608) (camc314) - ce7e253 linter/prefer-object-from-entries: Require exact path match in unicorn helper (#19687) (camc314) - f5694ce estree/tokens: Reverse field order of `regex` object in tokens (#19679) (overlookmotel) - b2b7a55 estree/tokens: Generate tokens for files with BOM (#19535) (overlookmotel) - 0722721 linter/jsx-curly-brace-presence: False positive with prop & mixed quotes (#19674) (camc314) - 3496acd linter: Enhance diagnostic help messages for eslint rules (#19653) (Anthony Amaro) - e384e94 linter: Enhance help diagnostic messages for more eslint rules (#19658) (Anthony Amaro) - a4d5b34 linter: Avoid non-promise catch false positives (#19574) (camc314) - 5706f38 linter: `unicorn/no-array-callback-reference` skip `Effect.*` array-like methods name. (#19633) (Said Atrahouch) ### ⚡ Performance - 05ccf9f linter/plugins: Transfer tokens via raw transfer (#19893) (overlookmotel) - 4b0611a estree/tokens: Introduce `ESTreeTokenConfig` trait (#19842) (overlookmotel) - ec88f6a estree/tokens: Serialize tokens while visiting AST (#19726) (overlookmotel) - d4dcf26 linter/plugins: Remove `typescript` from bundle (#19531) (overlookmotel) - 6a6513c linter/plugins: Use Oxc tokens in plugins (#19498) (camc314) ### 📚 Documentation - d86f59e linter: Improve docs for no-useless-concat, mark as pending fixer. (#19859) (connorshea) - caa091d linter/plugins: Correct doc comments for `initTokens` (#19530) (overlookmotel) - 2fa936f README.md: Map npm package links to npmx.dev (#19666) (Boshen) - dc0ff73 linter/no-useless-constructor: Warn for parameter properties as well (#19638) (Ole Asteo) # Oxfmt ### 🚀 Features - 5141bc2 formatter: Support trailing ignore comments (#19304) (Andreas Lubbe) - 4888a99 oxfmt/lsp: Support other schemes beside `file://` and `untitled://` (#19872) (Sysix) - 14a0181 oxfmt: Support `graphql()` variant for gql-in-js (#19703) (leaysgur) - ca68ea6 oxfmt: Support gql-in-js substitution (#19670) (leaysgur) - 035933c formatter,oxfmt: Support js-in-vue (partially) (#19514) (leaysgur) - 9e11dc6 parser,estree,coverage: Collect tokens in parser and convert to ESTree format (#19497) (camc314) ### 🐛 Bug Fixes - 8e3842d oxfmt: Avoid embedded TSFN crash by returning errors as data (take2) (#19806) (Yuji Sugiura) - 04e6223 npm: Add `preferUnplugged` for Yarn PnP compatibility (#19829) (Boshen) - e540585 oxfmt: Support tailwind sort for CSS/LESS/SCSS (#19803) (leaysgur) - 93bb861 formatter: Trim trailing whitespace before breaking line (#19740) (leaysgur) - b85f97b formatter: Drop blank line between terminal call and first chain member (#19659) (Dunqing) ### ⚡ Performance - b3b2d30 parser: Introduce `ParserConfig` (#19637) (overlookmotel) ### 📚 Documentation - 2fa936f README.md: Map npm package links to npmx.dev (#19666) (Boshen) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Closes oxc-project#15972. Adds `options.reportUnusedDisableDirectives` to `.oxlintrc.json`, following the same pattern as `typeAware` (oxc-project#19614) and `typeCheck` (oxc-project#19764). - Root-config-only (nested configs are rejected with a clear error) - CLI `--report-unused-disable-directives[-severity]` takes precedence over the config file value - Schema, TypeScript types, and website snapshots regenerated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes oxc-project#15972. Adds `options.reportUnusedDisableDirectives` to `.oxlintrc.json`, following the same pattern as `typeAware` (oxc-project#19614) and `typeCheck` (oxc-project#19764). - Root-config-only (nested configs are rejected with a clear error) - CLI `--report-unused-disable-directives[-severity]` takes precedence over the config file value - Schema, TypeScript types, and website snapshots regenerated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ile (#19799) See #15972. ## Summary - Adds `options.reportUnusedDisableDirectives` to `.oxlintrc.json`, following the same pattern as `typeAware` (#19614) and `typeCheck` (#19764) - Root-config-only — nested configs are rejected with a clear diagnostic error - CLI `--report-unused-disable-directives` / `--report-unused-disable-directives-severity` take precedence over the config file value when both are set - Schema (`npm/oxlint/configuration_schema.json`), TypeScript types (`config.generated.ts`), and website snapshots regenerated ## Test plan - [ ] Unit tests in `oxlintrc.rs`: deserialization, `is_empty`, `merge` - [ ] Unit tests in `config_store.rs`: accessor returns value / `None` by default - [ ] Unit tests in `config_loader.rs`: nested config rejection - [ ] Integration tests in `config_builder.rs`: `extends` inheritance and override precedence - [ ] `cargo test -p oxc_linter && cargo test -p oxlint` ## Note on AI usage This PR was implemented with Claude Code assistance and has been reviewed and tested by the contributor. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wagenet <9835+wagenet@users.noreply.github.com> Co-authored-by: Cameron Clark <cameron.clark@hey.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

No description provided.