summaryrefslogtreecommitdiff
path: root/cli/tools/lint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r--cli/tools/lint.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs
index 0f81ec89d..4eebf9e16 100644
--- a/cli/tools/lint.rs
+++ b/cli/tools/lint.rs
@@ -234,7 +234,7 @@ pub fn print_rules_list(json: bool) {
pub fn create_linter(
media_type: MediaType,
- rules: Vec<Arc<dyn LintRule>>,
+ rules: Vec<&'static dyn LintRule>,
) -> Linter {
LinterBuilder::default()
.ignore_file_directive("deno-lint-ignore-file")
@@ -247,7 +247,7 @@ pub fn create_linter(
fn lint_file(
file_path: &PathBuf,
source_code: String,
- lint_rules: Vec<Arc<dyn LintRule>>,
+ lint_rules: Vec<&'static dyn LintRule>,
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
let file_name = file_path.to_string_lossy().to_string();
let media_type = MediaType::from(file_path);
@@ -263,7 +263,7 @@ fn lint_file(
/// Treats input as TypeScript.
/// Compatible with `--json` flag.
fn lint_stdin(
- lint_rules: Vec<Arc<dyn LintRule>>,
+ lint_rules: Vec<&'static dyn LintRule>,
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
let mut source_code = String::new();
if stdin().read_to_string(&mut source_code).is_err() {
@@ -530,7 +530,9 @@ fn sort_diagnostics(diagnostics: &mut [LintDiagnostic]) {
});
}
-pub fn get_configured_rules(rules: LintRulesConfig) -> Vec<Arc<dyn LintRule>> {
+pub fn get_configured_rules(
+ rules: LintRulesConfig,
+) -> Vec<&'static dyn LintRule> {
if rules.tags.is_none() && rules.include.is_none() && rules.exclude.is_none()
{
rules::get_recommended_rules()