Skip to content

Commit 09b597f

Browse files
feat(linter): handle help message from tsgolint (#13143)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7cf6186 commit 09b597f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

crates/oxc_linter/src/tsgolint.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl TsGoLintState {
130130
);
131131

132132
let oxc_diagnostic: OxcDiagnostic =
133-
tsgolint_diagnostic.into();
133+
OxcDiagnostic::from(tsgolint_diagnostic);
134134
let Some(severity) = severity else {
135135
// If the severity is not found, we should not report the diagnostic
136136
continue;
@@ -308,9 +308,13 @@ pub struct TsGoLintDiagnostic {
308308

309309
impl From<TsGoLintDiagnostic> for OxcDiagnostic {
310310
fn from(val: TsGoLintDiagnostic) -> Self {
311-
OxcDiagnostic::warn(val.message.description)
311+
let mut d = OxcDiagnostic::warn(val.message.description)
312312
.with_label(Span::new(val.range.pos, val.range.end))
313-
.with_error_code("typescript-eslint", val.rule)
313+
.with_error_code("typescript-eslint", val.rule);
314+
if let Some(help) = val.message.help {
315+
d = d.with_help(help);
316+
}
317+
d
314318
}
315319
}
316320

@@ -325,6 +329,7 @@ pub struct Range {
325329
pub struct RuleMessage {
326330
pub id: String,
327331
pub description: String,
332+
pub help: Option<String>,
328333
}
329334

330335
#[derive(Clone, Debug, Serialize, Deserialize)]

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ oxlint :
6767

6868
# Watch oxlint
6969
watch-oxlint *args='':
70-
just watch 'cargo run -p oxlint -- {{args}}'
70+
just watch 'cargo run -p oxlint -- --disable-nested-config {{args}}'
7171

7272
# Run cargo check
7373
check:

0 commit comments

Comments
 (0)