📎 noUndeclaredVariables
: set checkTypes
to false
by default
#5401
Labels
Milestone
noUndeclaredVariables
: set checkTypes
to false
by default
#5401
Description
As cited by our last changelog:
noUndeclaredVariables now provides the
checkTypes
option (#3998).noUndeclaredVariables
is inspired by the no-undef ESLint rule. It reports all references that are not bound to any declarations within a module.Node.js, JavaScript and TypeScript globals are ignored.
Biome provides the
javascript.globals
option to list additional globals that should be ignored by the rule.In TypeScript projects, developers often use global declaration files to declare global types.
Biome is currently unable to detect these global types.
This creates many false positives for
noUndeclaredVariables
.TypeScript is better suited to perform this kind of check.
As proof of this, TypeScript ESLint doesn't provide any rule that extends the
no-undef
ESLint rule.This is why we introduce today a new option
checkTypes
which, when it is set tofalse
, ignores undeclared type references.Given the following configuration...
...
UndeclaredType
is not reported by the rule.We plan to turn off the option by default in Biome 2.0
Also, this will bring the Biome rule closer to the no-undef ESLint rule.
The text was updated successfully, but these errors were encountered: