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.
This commit is contained in:
Luca Casonato 2024-09-27 16:14:17 +02:00 committed by GitHub
parent 3134abefa4
commit 6f0fbceaf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 27 additions and 29 deletions

View file

@ -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()),
})
}