Skip to content

Commit

Permalink
feat(linter): fallback to the default tsconfig path (#2842)
Browse files Browse the repository at this point in the history
Users usually do not need to manually set the tsconfig path, as it is
usually located in cwd/tsconfig.json.
  • Loading branch information
Dunqing committed Mar 28, 2024
1 parent ab7d7dc commit d63807e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/oxc_linter/src/service.rs
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 d63807e

Please sign in to comment.