diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-11-24 15:14:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 15:14:19 -0500 |
commit | adc5974333174bd59796f5b7bb8b010c17479dd0 (patch) | |
tree | 969e9ec5e1bdd2f037ad87a283858306bf2a18d2 /cli/tools/lint.rs | |
parent | 88000b5feb531fc3969bfa8d60faec0f204cc659 (diff) |
fix(lsp): lsp should respect include/exclude files in format config (#12876)
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r-- | cli/tools/lint.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 2c68a0dac..b7ae88e4f 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -10,7 +10,7 @@ use crate::config_file::LintConfig; use crate::file_watcher::ResolutionResult; use crate::flags::LintFlags; use crate::fmt_errors; -use crate::fs_util::{collect_files, is_supported_ext}; +use crate::fs_util::{collect_files, is_supported_ext, specifier_to_file_path}; use crate::tools::fmt::run_parallelized; use crate::{colors, file_watcher}; use deno_ast::MediaType; @@ -71,11 +71,21 @@ pub async fn lint( if let Some(lint_config) = maybe_lint_config.as_ref() { if include_files.is_empty() { - include_files = lint_config.files.include.clone(); + include_files = lint_config + .files + .include + .iter() + .filter_map(|s| specifier_to_file_path(s).ok()) + .collect::<Vec<_>>(); } if exclude_files.is_empty() { - exclude_files = lint_config.files.exclude.clone(); + exclude_files = lint_config + .files + .exclude + .iter() + .filter_map(|s| specifier_to_file_path(s).ok()) + .collect::<Vec<_>>(); } } |