Commit 8810bd5
committed
fix(linter): prevent conflicting fixes between prefer_number_properties and prefer_numeric_literals (#16113)
When both rules apply to parseInt calls with radix 2, 8, or 16, their fixes
conflict and produce invalid code like `Number.0o111`.
prefer_number_properties now skips emitting a fix for parseInt calls that
would be better handled by prefer_numeric_literals (which converts them to
numeric literals like 0b10, 0o17, 0x1F).1 parent 39fd864 commit 8810bd5
File tree
1 file changed
+8
-1
lines changed- crates/oxc_linter/src/rules/unicorn
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
550 | 556 | | |
551 | 557 | | |
552 | 558 | | |
| 559 | + | |
553 | 560 | | |
554 | 561 | | |
555 | 562 | | |
| |||
0 commit comments