-
-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(noUndeclaredVariables): add checkTypes option #4471
Conversation
c7d12ea
to
464e9e3
Compare
CodSpeed Performance ReportMerging #4471 will improve performances by 6.1%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could consider in Biome 2.0 to turn on the rule by default
Maybe for 2.0 we can do a check in biome init
to see if there is a tsconfig.json
? If there is then we disable the rule since it would be redundant with TS, but if there isn’t we enable it.
It kinda makes me wonder if Biome 2.0 should even have the checkTypes
option at all. If you use TypeScript, it takes care of it. If you don’t, you don’t have types anyway.
True, but people complain that TypeScript is slow. If Biome can do what TypeScript does already, but faster and without losing performance, I'd say it's a win for Biome :) |
I wholeheartedly agree, and it's a great argument for building our own type checker, but this option is not coming even near that 😅 |
f47cb41
to
1addede
Compare
Thank you! |
Hi, I tested the nightly build v1.9.5-nightly.81fdedb
|
@elawad. I've just tested with the nightly and everything is ok for me. Please make sure you use the latest nightly (and check with |
Thanks, please disregard. It was an error on my part. Needed to uninstall first, then install the nightly. |
Summary
See this thread for some context.
Add a new
checkTypes
option fornoUndeclaredVariables
.The option is turned on by default. I plan to turn it off in Biome 2.0.
This will bring
noUndeclaredVariables
closer tono-undef
(So we will set the rule as a source instead of an inspiration).This also eliminates many false positives.
TypeScript is better suited to perform this kind of check.
We could consider in Biome 2.0 to turn on the rule by default because
checkTypes
set to false will reduce significantly the number of false positives.I chose to name the option
checkTypes
instead ofignoreTypes
because I plan to make it false by default.Test Plan
I added a test.