From 6f0fbceaf213f523bc68d23ea28fd457499f3a75 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 27 Sep 2024 16:14:17 +0200 Subject: fix(lint): correctly handle old jsx in linter (#25902) Previously the CLI was incorrectly reporting `React` as unused in a JSX file that uses the "old" transform. The LSP was already handling this correctly. --- cli/args/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cli') diff --git a/cli/args/mod.rs b/cli/args/mod.rs index a11d3bc10..995a04823 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1327,11 +1327,9 @@ impl CliOptions { )?; Ok(deno_lint::linter::LintConfig { - default_jsx_factory: transpile_options - .jsx_automatic + default_jsx_factory: (!transpile_options.jsx_automatic) .then(|| transpile_options.jsx_factory.clone()), - default_jsx_fragment_factory: transpile_options - .jsx_automatic + default_jsx_fragment_factory: (!transpile_options.jsx_automatic) .then(|| transpile_options.jsx_fragment_factory.clone()), }) } -- cgit v1.2.3