Commit 5ae31e0
fix(ego-lint): widen R-VER48-02 guard-window for distant version checks (#53)
## Summary
- Increase R-VER48-02 `guard-window` from 3 to 10 to recognize
PACKAGE_VERSION guards that appear far from the deprecated API call
(e.g., cached in a variable then used in nested ternaries)
- Add test fixture `version-guard-distant@test` reproducing the Dash to
Panel false-positive pattern where the guard is 5-9 lines from the
deprecated `Meta.disable_unredirect_for_display()` call
## Context
In Dash to Panel's `src/utils.js`, the version-compat guard
`Config.PACKAGE_VERSION >= '48'` is cached in a `v48` variable, then
used in nested `if/else` ternaries. The deprecated
`Meta.enable_unredirect_for_display()` and
`Meta.disable_unredirect_for_display()` calls appear 5 and 9 lines after
the guard respectively. With `guard-window: 3`, the sliding `deque`
lookback had already evicted the guard line, causing false positives.
Closes #39
Closes #42
## Test plan
- [x] New fixture `version-guard-distant@test` passes (R-VER48-02
suppressed)
- [x] Existing fixture `version-guard-pkgver@test` still passes
(close-range guard)
- [x] Full test suite passes with zero regressions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent f9c035b commit 5ae31e0
File tree
5 files changed
+46
-1
lines changed- rules
- tests
- assertions
- fixtures/version-guard-distant@test
5 files changed
+46
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | | - | |
| 926 | + | |
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments