From 9cc1af589bb33af04ebe0e74e28c4acc32fa7636 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Thu, 28 Mar 2024 13:33:35 +0800 Subject: [PATCH] feat(linter): setting the default tsconfig path --- crates/oxc_linter/src/service.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/service.rs b/crates/oxc_linter/src/service.rs index 1384d8635523..3aef6d03e83e 100644 --- a/crates/oxc_linter/src/service.rs +++ b/crates/oxc_linter/src/service.rs @@ -135,7 +135,9 @@ pub struct Runtime { impl Runtime { fn new(linter: Linter, options: LintServiceOptions) -> Self { - let resolver = linter.options().import_plugin.then(|| Self::get_resolver(options.tsconfig)); + let resolver = linter.options().import_plugin.then(|| { + Self::get_resolver(options.tsconfig.or_else(|| Some(options.cwd.join("tsconfig.json")))) + }); Self { cwd: options.cwd, paths: options.paths.iter().cloned().collect(),