fix(linter): add help text to eslint rule diagnostics#19508
Merged
camc314 merged 2 commits intooxc-project:mainfrom Feb 19, 2026
Merged
fix(linter): add help text to eslint rule diagnostics#19508camc314 merged 2 commits intooxc-project:mainfrom
camc314 merged 2 commits intooxc-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds actionable help text to previously “message-only” ESLint rule diagnostics in oxc_linter, aligning with #19121’s goal of making lints easier to fix.
Changes:
- Added
.with_help(...)guidance to diagnostics for 8 ESLint rules (across 7 files). - Expanded several diagnostics from single-line chains into multi-line builder chains to include help text.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/eslint/require_yield.rs | Adds help suggesting adding yield or converting to a non-generator function. |
| crates/oxc_linter/src/rules/eslint/no_lone_blocks.rs | Adds help text for both “unnecessary block” and “redundant nested block” diagnostics. |
| crates/oxc_linter/src/rules/eslint/no_eval.rs | Adds help with safer alternatives to eval(). |
| crates/oxc_linter/src/rules/eslint/no_delete_var.rs | Adds help explaining delete is for object properties and suggests an alternative. |
| crates/oxc_linter/src/rules/eslint/no_constructor_return.rs | Adds help clarifying that return; (no value) is allowed for early exit. |
| crates/oxc_linter/src/rules/eslint/no_const_assign.rs | Adds help recommending let when reassignment is intended. |
| crates/oxc_linter/src/rules/eslint/no_case_declarations.rs | Adds help recommending {} to introduce explicit block scope within case bodies. |
Add actionable .with_help() messages to 8 eslint linter rules that
were missing them:
- no_eval: suggest JSON.parse() and bracket notation as alternatives
- no_await_in_loop: suggest Promise.all() for parallel execution
- no_case_declarations: suggest wrapping case body in braces {}
- no_constructor_return: clarify bare return; is allowed for early exit
- no_delete_var: suggest assigning undefined instead of delete
- no_lone_blocks: suggest removing unnecessary/redundant blocks
- require_yield: suggest adding yield or converting to regular function
- no_const_assign: suggest using let for reassignable variables
Fixes oxc-project#19121
50ee09c to
6a59ed6
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
camc314
added a commit
that referenced
this pull request
Feb 19, 2026
# Oxlint ### 💥 BREAKING CHANGES - 4315594 oxlint: [**BREAKING**] Deprecate `"always"` and `"as-needed"` options of the radix rule (#19408) (Sysix) - d4c7af3 linter: [**BREAKING**] Remove `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` option (#19451) (camc314) ### 🚀 Features - 82ca5c3 linter: Add typescript/dot-notation rule (#19442) (camc314) - 6db0811 linter: Implement eslint-plugin-vitest/no-importing-vitest-globals (#18694) (Said Atrahouch) - c7fe8ae linter: Implement eslint-plugin-vitest/prefer-import-in-mock (#17966) (Said Atrahouch) - 0abb39a linter: Implement eslint-vitest-jest-plugin/prefer-mock-return-shorthand (#18002) (Said Atrahouch) - 2b95537 linter: Implement `n/no-path-concat` rule (#19502) (Mikhail Baev) - 735d0e4 linter: Implement typescript/no-useless-default-assignment (#19488) (camc314) - 31c3a93 linter: Add typescript/no-unnecessary-type-parameters rule (#19450) (camc314) - c948090 linter: Add typescript/consistent-return rule (#19449) (camc314) - 9f87df0 linter: Add typescript/prefer-string-starts-ends-with rule (#19448) (camc314) - 04536be linter: Add typescript/prefer-regexp-exec rule (#19447) (camc314) - 56a7feb linter: Add typescript/prefer-readonly rule (#19446) (camc314) - a1cea63 linter: Add typescript/no-unnecessary-qualifier rule (#19445) (camc314) - e3144d2 linter: Add typescript/prefer-find rule (#19444) (camc314) - 13c7408 linter: Add typescript/prefer-readonly-parameter-types rule (#19443) (camc314) - 9b17d44 linter: Add typescript/strict-void-return rule (#19441) (camc314) - ed821b4 linter: Add typescript/consistent-type-exports rule (#19440) (camc314) ### 🐛 Bug Fixes - daad7bc linter/array-callback-return: Check `allowVoid` option (#19506) (Said Atrahouch) - 638cf94 linter: Add help text to eslint rule diagnostics (#19508) (Kyle Tse) - 79fc6d7 linter: Move no-use-before-define to eslint plugin (#19438) (camc314) - c832a9f linter: Add `onScrollEnd` and `onScrollEndCapture` to `react/no-unknown-property`. (#19536) (connorshea) - 999a0db linter: Add help text to `symbol-description` diagnostics (#19538) (Anthony Amaro) - f064482 linter: Add help text to eslint rule diagnostics (#19539) (Anthony Amaro) - fd11073 linter/react/no-unknown-property: Add missing `fetchPriority` prop (#19525) (João Pedro Schmitz) - a9bb604 linter/no-shadow: Align initializer shadow handling with typescript-eslint (#19462) (camc314) - 32e6eb9 linter: Handle typed arrays/array buffers in `prefer-spread` rule. (#19478) (connorshea) - e309f84 linter: Handle additional cases in `typescript/consistent-generic-constructors` rule. (#19477) (connorshea) - 71db91a linter/array-callback-return: Check `fromAsync`, update test cases (#19483) (Said Atrahouch) - 2a12d74 linter: Handle optional chaining in `no-array-method-this-argument` rule. (#19476) (connorshea) - f65310b linter: Handle optional chaining in `prefer-object-from-entries` rule. (#19475) (connorshea) - 840acf4 linter: Handle optional chain in `no-unnecessary-array-flat-depth` rule. (#19471) (connorshea) - 85a19e9 linter: Skip string literal imports in `consistent-assert` rule. (#19474) (connorshea) ### ⚡ Performance - 6155ac4 linter/constructor-super: Use node_id over nodes loop (#19489) (camc314) - a02496d linter/consistent-index-object-style: Resolve circular type refs semantically (#19490) (camc314) # Oxfmt ### 🚀 Features - 652c346 oxfmt/lsp: Support `untitled://` schema (#19287) (Sysix) ### 🐛 Bug Fixes - 6c61b70 oxfmt: Fix outdated `sortImports.groups` doc comments (#19513) (leaysgur) Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
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
Fixes #19121
Adds actionable
.with_help()messages to 8 eslint linter rules that were missing them, as requested in #19121.Changes
no_evalJSON.parse()and bracket notation as alternatives toeval()no_await_in_loopPromise.all()for parallel async executionno_case_declarations{}to create explicit block scopeno_constructor_returnreturn;is allowed for early exitno_delete_varundefinedinstead of usingdeleteon variablesno_lone_blocksrequire_yieldyieldexpression or converting to a regular functionno_const_assignletwhen a variable needs to be reassignedAll help messages are actionable — they tell the user what to do to fix the issue.