Replies: 5 comments 15 replies
-
Suggestion: test the rules on other AST / static analysis projects, and linting projects (ESLint, typescript-eslint, etc) in particular.
|
Beta Was this translation helpful? Give feedback.
-
My team explicitly enabled this, but I'm still not sure how hard this is to port. |
Beta Was this translation helpful? Give feedback.
-
This is very important when implementing software while using Node.js compatibility mode in the Edge Runtime, and if it's supported by default, it's much better. |
Beta Was this translation helpful? Give feedback.
-
I believe these are good directions for performance and consistency. |
Beta Was this translation helpful? Give feedback.
-
I have a question, is it a good idea for rules like Ex for <img src="image.png" /> After applying code fix <img src="image.png" alt="" /> |
Beta Was this translation helpful? Give feedback.
-
This is an in-progress report outlining the focus for the next few weeks.
Improve user experience
Promote some suggestions to safe fixes
A suggestion or unsafe fix can change the behavior of the program or the intent of the programmer.
In contrast to suggestions, A safe fix does not change the behavior of the program.
A user can automatically apply a safe fixes with confidence.
From a rule maker point of view is thus scary of marking a fix as a safe fix.
Thus, we generally start with suggestions.
Biome has now more rules with suggestions than safe fixes.
This leads some users to directly apply all unsafe fixes.
As with nursery rules which are promoted to another group once stabilized,
we should promote relevant suggestions to safe fixes once we are confident about them.
I think that the following rules could benefit of the promotion of (some of) their suggestions to safe fixes.
Provide more code fixes
noUnusedVariables
A
catch
with an unused variable could be shorten to an argument-lesscatch
.useIsNan
We could provide a suggestion.
Smarter rules
useTemplate
The rule provides the following suggestion:
This breaks code where
a
andb
are numbers (rome#4713).To fix the issue, we could make the following suggestion:
Note that the issue is not present for the following code:
Remove noAssignInExpressions code fix
The code fix is sometimes unwanted by users rome#4717
Deprecate annoying or confusing rules
Remove noConfusingArrow
The rule is already turned off in most cases.
useSingleCaseStatement
The rule is confusing: it requires block around in switch clause if there is more than 1 statement.
A lot of users complained about the rule.
We should deprecate the rule and provide a rule that enforces block in all switch clauses.
Improve stability
Write guidelines
Rule promotions. Guideline to promote a rule (when, ...).
Code fixes. It is sometimes hard to decide whether a code fix is safe or unsafe.
Safe fixes are automatically applied with the fix-all and quickfixes on-save IDE actions.
As a result, it is a bit risky of marking a code fix as safe.
Conservatively, we categorize a code fix as unsafe.
Unfortunately, this reduces the usefulness of the code fixes and encourages the use of unsafe fixes.
In this regard, we should provide some guidelines and a clear procedure to update an eligible unsafe fix to a safe fix.
Fix long-standing issues
noUnreachableSuper bugs (rome#4674 and 4616)
noUnnecessaryContinue rome#4745
noRedeclare rome#4291
noUnusedVariables rome#4245
useSimplifiedLogicExpression rome#3527
useTemplate incorrectly handle single-line comments rome#4109
rome-ignore issue rome#3734
useExponentiationOperator rome#3850
Suppress comments and indentation rome#3923
Test rules on big projects
Beta Was this translation helpful? Give feedback.
All reactions