Skip to content

Commit

Permalink
Add LintRule::docs() and LintDiagnostic::hint (denoland#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Sep 29, 2020
1 parent 0c37124 commit 8167501
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/diagnostic.rs
Expand Up @@ -36,4 +36,5 @@ pub struct LintDiagnostic {
pub filename: String,
pub message: String,
pub code: String,
pub hint: Option<String>,
}
1 change: 1 addition & 0 deletions src/linter.rs
Expand Up @@ -59,6 +59,7 @@ impl Context {
filename: self.file_name.clone(),
message: message.to_string(),
code: code.to_string(),
hint: None,
};

let time_end = Instant::now();
Expand Down
3 changes: 3 additions & 0 deletions src/rules/mod.rs
Expand Up @@ -94,6 +94,9 @@ pub trait LintRule {
module: &swc_ecmascript::ast::Module,
);
fn code(&self) -> &'static str;
fn docs(&self) -> &'static str {
""
}
}

pub fn get_recommended_rules() -> Vec<Box<dyn LintRule>> {
Expand Down

0 comments on commit 8167501

Please sign in to comment.