mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
chore: improve prefer-enum-initializers error message
This commit is contained in:
parent
2fd6d05a4a
commit
d9e2431acf
2 changed files with 6 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ use oxc_span::Span;
|
|||
use crate::{context::LintContext, rule::Rule, AstNode};
|
||||
|
||||
fn prefer_enum_initializers_diagnostic(x0: &str, x1: usize, span2: Span) -> OxcDiagnostic {
|
||||
OxcDiagnostic::warning(format!("typescript-eslint(prefer-enum-initializers):The value of the member {x0:?} should be explicitly defined."))
|
||||
OxcDiagnostic::warning(format!("typescript-eslint(prefer-enum-initializers): The value of the member {x0:?} should be explicitly defined."))
|
||||
.with_help(format!("Can be fixed to {x0:?} = {x1:?}."))
|
||||
.with_labels([span2.into()])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
source: crates/oxc_linter/src/tester.rs
|
||||
expression: prefer_enum_initializers
|
||||
---
|
||||
⚠ typescript-eslint(prefer-enum-initializers):The value of the member "Up" should be explicitly defined.
|
||||
⚠ typescript-eslint(prefer-enum-initializers): The value of the member "Up" should be explicitly defined.
|
||||
╭─[prefer_enum_initializers.tsx:3:6]
|
||||
2 │ enum Direction {
|
||||
3 │ Up,
|
||||
|
|
@ -11,7 +11,7 @@ expression: prefer_enum_initializers
|
|||
╰────
|
||||
help: Can be fixed to "Up" = 1.
|
||||
|
||||
⚠ typescript-eslint(prefer-enum-initializers):The value of the member "Up" should be explicitly defined.
|
||||
⚠ typescript-eslint(prefer-enum-initializers): The value of the member "Up" should be explicitly defined.
|
||||
╭─[prefer_enum_initializers.tsx:3:6]
|
||||
2 │ enum Direction {
|
||||
3 │ Up,
|
||||
|
|
@ -20,7 +20,7 @@ expression: prefer_enum_initializers
|
|||
╰────
|
||||
help: Can be fixed to "Up" = 1.
|
||||
|
||||
⚠ typescript-eslint(prefer-enum-initializers):The value of the member "Down" should be explicitly defined.
|
||||
⚠ typescript-eslint(prefer-enum-initializers): The value of the member "Down" should be explicitly defined.
|
||||
╭─[prefer_enum_initializers.tsx:4:6]
|
||||
3 │ Up,
|
||||
4 │ Down,
|
||||
|
|
@ -29,7 +29,7 @@ expression: prefer_enum_initializers
|
|||
╰────
|
||||
help: Can be fixed to "Down" = 2.
|
||||
|
||||
⚠ typescript-eslint(prefer-enum-initializers):The value of the member "Down" should be explicitly defined.
|
||||
⚠ typescript-eslint(prefer-enum-initializers): The value of the member "Down" should be explicitly defined.
|
||||
╭─[prefer_enum_initializers.tsx:4:6]
|
||||
3 │ Up = 'Up',
|
||||
4 │ Down,
|
||||
|
|
@ -38,7 +38,7 @@ expression: prefer_enum_initializers
|
|||
╰────
|
||||
help: Can be fixed to "Down" = 2.
|
||||
|
||||
⚠ typescript-eslint(prefer-enum-initializers):The value of the member "Up" should be explicitly defined.
|
||||
⚠ typescript-eslint(prefer-enum-initializers): The value of the member "Up" should be explicitly defined.
|
||||
╭─[prefer_enum_initializers.tsx:3:6]
|
||||
2 │ enum Direction {
|
||||
3 │ Up,
|
||||
|
|
|
|||
Loading…
Reference in a new issue