1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(lint): add links to help at lint.deno.land (#11667)

This commit is contained in:
Bartek Iwańczuk 2021-08-12 19:15:31 +02:00 committed by GitHub
parent fd94575576
commit 7d55e05486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,6 +127,8 @@ pub fn print_rules_list(json: bool) {
println!("Available rules:");
for rule in lint_rules {
println!(" - {}", rule.code());
println!(" help: https://lint.deno.land/#{}", rule.code());
println!();
}
}
}
@ -231,6 +233,7 @@ impl LintReporter for PrettyLintReporter {
format!("({}) {}", colors::gray(&d.code), d.message.clone());
let message = format_diagnostic(
&d.code,
&pretty_message,
&source_lines,
d.range.clone(),
@ -266,6 +269,7 @@ impl LintReporter for PrettyLintReporter {
}
pub fn format_diagnostic(
diagnostic_code: &str,
message_line: &str,
source_lines: &[&str],
range: deno_lint::diagnostic::Range,
@ -300,19 +304,23 @@ pub fn format_diagnostic(
if let Some(hint) = maybe_hint {
format!(
"{}\n{}\n at {}\n\n {} {}",
"{}\n{}\n at {}\n\n {} {}\n {} for further information visit https://lint.deno.land/#{}",
message_line,
lines.join("\n"),
formatted_location,
colors::gray("hint:"),
hint,
colors::gray("help:"),
diagnostic_code,
)
} else {
format!(
"{}\n{}\n at {}",
"{}\n{}\n at {}\n\n {} for further information visit https://lint.deno.land/#{}",
message_line,
lines.join("\n"),
formatted_location
formatted_location,
colors::gray("help:"),
diagnostic_code,
)
}
}