-
-
Notifications
You must be signed in to change notification settings - Fork 504
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(lint/noUselessElse): add rule #331
Conversation
69c13ba
to
a07cae0
Compare
a07cae0
to
a6e02a7
Compare
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
a6e02a7
to
7809e79
Compare
7809e79
to
e374b3a
Compare
I don't mind clippy's name :) |
imho, I like noRedundantElse.
PS: oh, we also have
maybe a chance to create naming rule for lints |
crates/biome_js_analyze/src/analyzers/nursery/no_useless_else.rs
Outdated
Show resolved
Hide resolved
I personally prefer @ematipico @unvalley Also, Should we recommend the rule? |
I think we shouldn't. Editing biome.json by name change is kinda bothering.
As for me it's just preference. No strong reason.
Nice! This rule helps readability and reducing waste code. |
I don't have strong opinions nor preferences. I like both. I definitely agree we should settle on one single naming style, and updating the internal convention, so new rules will follow it . For renaming existing rules, that's breaking material, so we can worry about it later in the future. |
Ok, I will keep
Yes. However, I think earlier the breaking change is, better is. |
e374b3a
to
de77c0e
Compare
de77c0e
to
544da95
Compare
Summary
Fixes #247.
I am not 100% sold on the rule name. I think that
noUselessElse
doesn't communicate the actual intent of the rule. Unfortunately I didn't find a better name yet. Clippy usesno_redundant_else
.Trivia handling is again a pain. I finally gave up and keep the suggested code mis-indented.
We should certainly implement a kind of "mini formatter" for the code fixes.
An alternative is to remove the code fix of the rule...
Test Plan
Tests included