From e084fe10a98556d4630b54bdda2ce23b3b5b8a60 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 30 May 2024 02:09:16 +0200 Subject: feat(lint): add `no-boolean-literal-for-arguments` rule and enable `no-unused-vars` for jsx files (#24034) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * https://github.com/denoland/deno_lint/pull/1271 * https://github.com/denoland/deno_lint/pull/1277 --------- Co-authored-by: Bartek IwaƄczuk --- cli/args/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cli/args/mod.rs') 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 { + 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 { let maybe_config_files = if let Some(config_file) = &self.maybe_config_file { -- cgit v1.2.3