Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions apps/oxlint/src/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ arguments: --type-aware
working directory: fixtures/tsgolint_config_error
----------

x Invalid tsconfig
,-[tsconfig.json:1:1]
1 | {
: ^
x typescript(tsconfig-error): Invalid tsconfig
,-[tsconfig.json:3:9]
2 | "compilerOptions": {
3 | "baseUrl": ".",
: ^^^^^^^^^
4 | }
`----
help: Option 'baseUrl' has been removed. Please remove it from your configuration.
See https://github.com/oxc-project/tsgolint/issues/351 for more information.
Expand Down
7 changes: 5 additions & 2 deletions crates/oxc_linter/src/tsgolint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ pub struct TsGoLintRuleDiagnostic {
#[derive(Debug, Clone)]
pub struct TsGoLintInternalDiagnostic {
pub message: RuleMessage,
pub range: Range,
pub file_path: Option<PathBuf>,
}

Expand Down Expand Up @@ -721,12 +722,13 @@ impl From<TsGoLintRuleDiagnostic> for OxcDiagnostic {
}
impl From<TsGoLintInternalDiagnostic> for OxcDiagnostic {
fn from(val: TsGoLintInternalDiagnostic) -> Self {
let mut d = OxcDiagnostic::error(val.message.description);
let mut d = OxcDiagnostic::error(val.message.description)
.with_error_code("typescript", val.message.id);
if let Some(help) = val.message.help {
d = d.with_help(help);
}
if val.file_path.is_some() {
d = d.with_label(Span::new(0, 0));
d = d.with_label(Span::new(val.range.pos, val.range.end));
}
d
}
Expand Down Expand Up @@ -1000,6 +1002,7 @@ fn parse_single_message(
DiagnosticKind::Internal => {
TsGoLintDiagnostic::Internal(TsGoLintInternalDiagnostic {
message: diagnostic_payload.message,
range: diagnostic_payload.range,
file_path: diagnostic_payload.file_path.map(PathBuf::from),
})
}
Expand Down
Loading