Repository navigation
Commit 87bd2ce
authored
* fix: avoid redeclared `let` when `no-var` and `one-var` fix together
- `no-var` now retains the whole declaration's range when it replaces `var`
with `let`, so other fixes that touch the same declaration wait for the
next pass. `one-var` could otherwise join a later declaration that
redeclares a parameter in the same pass, and the fixed code did not parse.
- Add `verifyAndFix` tests running both rules: a redeclared parameter stays
`var`, and declarations without a conflict still end as one `let`.
* test: move `no-var` and `one-var` fix tests to the `no-var` rule tests
- The cases enable `one-var` with an inline `/*eslint one-var:error*/`
comment in the `no-var` rule tests, so the single-pass output shows
`one-var`'s join waiting for the next pass while `no-var` replaces only
the `var` it can fix.
- Remove the two `verifyAndFix` cases from the linter tests, which do not
test rule behavior.
1 parent 47b7063 commit 87bd2ce
2 files changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
463 | | - | |
464 | | - | |
465 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
466 | 476 | | |
467 | 477 | | |
468 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
591 | 603 | | |
592 | 604 | | |
593 | 605 | | |
| |||
0 commit comments