Skip to content

Commit

Permalink
feat(linter): setting the default tsconfig path
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Mar 28, 2024
1 parent d671007 commit 9cc1af5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/oxc_linter/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 9cc1af5

Please sign in to comment.