diff options
author | Luca Casonato <hello@lcas.dev> | 2024-05-30 02:09:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 00:09:16 +0000 |
commit | e084fe10a98556d4630b54bdda2ce23b3b5b8a60 (patch) | |
tree | fe9d25aadc1fdf3884ead22f90595f1f9e1f3e55 /cli/args/mod.rs | |
parent | 13723f267eb87f8c28ef0769cdf7e233b971326e (diff) |
feat(lint): add `no-boolean-literal-for-arguments` rule and enable `no-unused-vars` for jsx files (#24034)
* https://github.com/denoland/deno_lint/pull/1271
* https://github.com/denoland/deno_lint/pull/1277
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 69adee970..5bdecca9b 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1445,6 +1445,27 @@ impl CliOptions { LintOptions::resolve(maybe_lint_config, Some(lint_flags), &self.initial_cwd) } + pub fn resolve_lint_config( + &self, + ) -> Result<deno_lint::linter::LintConfig, AnyError> { + let ts_config_result = + self.resolve_ts_config_for_emit(TsConfigType::Emit)?; + + let (transpile_options, _) = + crate::args::ts_config_to_transpile_and_emit_options( + ts_config_result.ts_config, + )?; + + Ok(deno_lint::linter::LintConfig { + default_jsx_factory: transpile_options + .jsx_automatic + .then(|| transpile_options.jsx_factory.clone()), + default_jsx_fragment_factory: transpile_options + .jsx_automatic + .then(|| transpile_options.jsx_fragment_factory.clone()), + }) + } + pub fn resolve_config_excludes(&self) -> Result<PathOrPatternSet, AnyError> { let maybe_config_files = if let Some(config_file) = &self.maybe_config_file { |