fix(linter): add help text to eslint rule diagnostics#19560
Merged
camc314 merged 2 commits intooxc-project:mainfrom Feb 20, 2026
Merged
fix(linter): add help text to eslint rule diagnostics#19560camc314 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
This PR adds helpful guidance text to 5 ESLint rule diagnostics, making error messages more actionable for developers. This is part of a larger effort (issue #19121) to ensure all linter diagnostics provide clear instructions on how to fix issues.
Changes:
- Added
.with_help()to 5 ESLint rules with actionable guidance on how to fix the detected issues - Updated corresponding snapshot files to reflect the new help text in diagnostic output
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_linter/src/rules/eslint/no_new.rs |
Added help text instructing to assign the result of 'new' to a variable or compare it to a reference |
crates/oxc_linter/src/rules/eslint/no_multi_str.rs |
Added help text suggesting template literals or string concatenation as alternatives |
crates/oxc_linter/src/rules/eslint/no_label_var.rs |
Added help text advising to rename either the variable or label to avoid confusion |
crates/oxc_linter/src/rules/eslint/no_nested_ternary.rs |
Added help text recommending refactoring to if-else statements for better readability |
crates/oxc_linter/src/rules/eslint/no_func_assign.rs |
Added help text warning against re-assigning function declarations |
crates/oxc_linter/src/snapshots/eslint_no_new.snap |
Updated snapshot to include new help text for no_new rule |
crates/oxc_linter/src/snapshots/eslint_no_multi_str.snap |
Updated snapshot to include new help text for no_multi_str rule |
crates/oxc_linter/src/snapshots/eslint_no_label_var.snap |
Updated snapshot to include new help text for no_label_var rule |
crates/oxc_linter/src/snapshots/eslint_no_nested_ternary.snap |
Updated snapshot to include new help text for no_nested_ternary rule |
crates/oxc_linter/src/snapshots/eslint_no_func_assign.snap |
Updated snapshot to include new help text for no_func_assign rule |
Merging this PR will not alter performance
Comparing Footnotes
|
camc314
pushed a commit
that referenced
this pull request
Feb 23, 2026
# Oxlint ### 🚀 Features - 46177dd linter: Implement unicorn/prefer-module (#19603) (camc314) - 42f78bb linter: Implement unicorn/prefer-ternary (#19605) (camc314) ### 🐛 Bug Fixes - 43df857 react/exhaustive-deps: Normalize .current callback deps (#19610) (camc314) - 574f48f linter/no-throw-literal: Close warning block (#19612) (camc314) - 79fe3b4 linter/prefer-mock-return-shorthand: Avoid unsafe autofixes for call-like returns (#19581) (camc314) - 85045e8 linter: Check protected members in explicit-module-boundary-types (#19594) (camc314) - e38115e linter: Catch missing return type on exported arrow/function expressions (#19587) (Peter Wagenet) - 419d3fd linter: Fix false negatives in typescript/no-require-imports (#19589) (Peter Wagenet) - 7958b56 linter: Fix syntax error reporting in some output formatters. (#19590) (connorshea) - 024f51c linter: Add help text to more eslint diagnostics (#19591) (Anthony Amaro) - a8489a1 linter: Warning `eslint/no-throw-literal` rule to be deprecated, better use `typescript/only-throw-error` (#19593) (Said Atrahouch) - 50fc70d linter/type-aware: Use correct span for disable directives (#19576) (camc314) - 421a99c linter: Add help guidance to eslint diagnostic messages (#19562) (Anthony Amaro) - e81364a linter: Add help text to eslint rule diagnostics (#19560) (Anthony Amaro) - 89b58d0 linter: Add help text to more eslint rule diagnostics (#19561) (Anthony Amaro) - 74f7833 linter/jest/prefer-mock-return-shorthand: Preserve typed arrow returns (#19556) (camc314) - bdd6f34 linter: Restrict prefer-import-in-mock to mock calls (#19555) (camc314) ### 📚 Documentation - a331993 linter: Improve docs for `eslint/radix` rule. (#19611) (connorshea) ### 🛡️ Security - c67f9dc linter: Update ajv version. (#19613) (connorshea) # Oxfmt ### 🚀 Features - 984dc07 oxfmt: Strip `"experimental"SortXxx` prefix (#19567) (leaysgur) ### 🐛 Bug Fixes - d7b63a4 oxfmt: Update API types for `sortPackageJsonOptions` (#19569) (leaysgur) Co-authored-by: Boshen <1430279+Boshen@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.
PR covers:
Closes #19121 (partially)
Add
.with_help()to 5 ESLint rule diagnostics:no-new: "Assign the result of 'new' to a variable or compare it to a reference."no-multi-str: "Multiline strings are not allowed. Use template literals or string concatenationinstead."
no-label-var: "Rename either the variable or the label to avoid confusion."no-nested-ternary: "Refactor nested ternary expressions into if-else statements for betterreadability."
no-func-assign: "Do not re-assign a function declared as a FunctionDeclaration."5 rule files changed + 5 corresponding snapshot updates.