summaryrefslogtreecommitdiff
path: root/cli/tools/lint.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-01 14:35:23 -0400
committerGitHub <noreply@github.com>2023-05-01 14:35:23 -0400
commit9efed4c7a3d32de62e9c9b5e0c6712ce97637abb (patch)
treeaa370f95df93c71f6c57d6a01a50b4df1955ee57 /cli/tools/lint.rs
parent30628288ce2b411ca3def46129a4606073e16bac (diff)
refactor(cli): remove ProcState - add CliFactory (#18900)
This removes `ProcState` and replaces it with a new `CliFactory` which initializes our "service structs" on demand. This isn't a performance improvement at the moment for `deno run`, but might unlock performance improvements in the future.
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r--cli/tools/lint.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs
index eae2f1032..40c37ce77 100644
--- a/cli/tools/lint.rs
+++ b/cli/tools/lint.rs
@@ -11,8 +11,8 @@ use crate::args::FilesConfig;
use crate::args::LintOptions;
use crate::args::LintReporterKind;
use crate::args::LintRulesConfig;
-use crate::cache::Caches;
use crate::colors;
+use crate::factory::CliFactory;
use crate::tools::fmt::run_parallelized;
use crate::util::file_watcher;
use crate::util::file_watcher::ResolutionResult;
@@ -98,11 +98,12 @@ pub async fn lint(
};
let has_error = Arc::new(AtomicBool::new(false));
- let deno_dir = cli_options.resolve_deno_dir()?;
- let caches = Caches::default();
+ let factory = CliFactory::from_cli_options(Arc::new(cli_options));
+ let cli_options = factory.cli_options();
+ let caches = factory.caches()?;
let operation = |paths: Vec<PathBuf>| async {
let incremental_cache = Arc::new(IncrementalCache::new(
- caches.lint_incremental_cache_db(&deno_dir),
+ caches.lint_incremental_cache_db(),
// use a hash of the rule names in order to bust the cache
&{
// ensure this is stable by sorting it