-
useTemplate now reports all string concatenations.
Previously, the rule ignored concatenation of a value and a newline or a backquote.
For example, the following concatenation was not reported:
v + "\n";
"`" + v + "`";
The rule now reports these cases and suggests the following code fixes:
- v + "\n";
+ `${v}\n`;
- v + "`";
+ `\`${v}\``;
Contributed by @Conaclos
-
useExponentiationOperator suggests better code fixes.
The rule now preserves any comment preceding the exponent,
and it preserves any parenthesis around the base or the exponent.
It also adds spaces around the exponentiation operator **
,
and always adds parentheses for pre- and post-updates.
- Math.pow(a++, /**/ (2))
+ (a++) ** /**/ (2)
Contributed by @Conaclos
-
You can use // biome-ignore
as suppression comment.
-
The // rome-ignore
suppression is deprecated.
-
Fix #80,
making noDuplicateJsxProps case-insensitive.
Some frameworks, such as Material UI, rely on the case-sensitivity of JSX properties.
For
example, TextField has two properties with the same name, but distinct cases:
<TextField inputLabelProps="" InputLabelProps=""></TextField>
Contributed by @Conaclos
-
Fix #138
noCommaOperator now correctly ignores all use of comma
operators inside the update part of a for
loop.
The following code is now correctly ignored:
for (
let i = 0, j = 1, k = 2;
i < 100;
i++, j++, k++
) {}
Contributed by @Conaclos
-
Fix rome#4713.
Previously, useTemplate made the following suggestion:
- a + b + "px"
+ `${a}${b}px`
This breaks code where a
and b
are numbers.
Now, the rule makes the following suggestion:
- a + b + "px"
+ `${a + b}px`
Contributed by @Conaclos
-
Fix rome#4109
Previously, useTemplate suggested an invalid code fix when a leading
or trailing single-line comment was present:
// leading comment
- 1 /* inner comment */ + "+" + 2 // trailing comment
+ `${// leading comment
+ 1 /* inner comment */}+${2 //trailing comment}` // trailing comment
Now, the rule correctly handles this case:
// leading comment
- 1 + "+" + 2 // trailing comment
+ `${1}+${2}` // trailing comment
As a sideeffect, the rule also suggests the removal of any inner comments.
Contributed by @Conaclos
-
Fix rome#3850
Previously useExponentiationOperator suggested
invalid code in a specific edge case:
- 1 +Math.pow(++a, 2)
+ 1 +++a**2
Now, the rule properly adds parentheses:
- 1 +Math.pow(++a, 2)
+ 1 +(++a) ** 2
Contributed by @Conaclos
-
Fix #106
noUndeclaredVariables now correctly recognizes some
TypeScript types such as Uppercase
.
Contributed by @Conaclos
-
Fix rome#4616
Previously noUnreachableSuper reported valid codes with
complex nesting of control flow structures.
Contributed by @Conaclos