Add 3 new eslint-plugin rules: prefer-destructured-lookups, no-dollar-prefix, require-destroyed-cleanup#729
Conversation
…ed-cleanup rules to eslint-plugin Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Export SizeUnchanged@studiometa/js-toolkit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #729 +/- ##
==========================================
+ Coverage 97.72% 97.78% +0.06%
==========================================
Files 159 162 +3
Lines 3607 3710 +103
Branches 1003 1040 +37
==========================================
+ Hits 3525 3628 +103
Misses 74 74
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | schedule + flush 50 read tasks |
433.6 µs | 358.6 µs | +20.92% |
| ❌ | all transforms |
299.7 µs | 340.2 µs | -11.89% |
| ❌ | combined (x, y, scale, rotate) |
286.8 µs | 326.2 µs | -12.08% |
| ❌ | rotate |
286.6 µs | 320.9 µs | -10.7% |
| ❌ | rotateX, rotateY, rotateZ |
289.8 µs | 327 µs | -11.38% |
| ❌ | scale |
289.5 µs | 324.5 µs | -10.78% |
| ❌ | scaleX, scaleY, scaleZ |
297.4 µs | 333.2 µs | -10.74% |
| ❌ | skew |
286.1 µs | 320.9 µs | -10.83% |
| ❌ | skewX, skewY |
291.8 µs | 329.2 µs | -11.38% |
| ❌ | translate3d (x only) |
287.8 µs | 325.7 µs | -11.65% |
| ⚡ | create tween with bezier curve |
375.9 µs | 340.6 µs | +10.39% |
| ❌ | getEdges (x axis, named offsets) |
21.8 µs | 24.3 µs | -10.28% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/eslint-plugin-new-rules-2 (919917a) with main (0030a99)
…lugin rules Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New rules
prefer-destructured-lookups(warn)When
this.$refs,this.$optionsorthis.$childrenmembers are accessed more than once inside the same method, they should be destructured into a local variable to avoid repeated lookups.no-dollar-prefix(error)User-defined instance methods and properties must not start with
$inBasesubclasses. The$prefix is reserved for framework-provided members ($el,$refs,$emit, etc.).require-destroyed-cleanup(warn)Basesubclasses that callsetTimeout,setIntervalorrequestAnimationFramemust define adestroyed()method to clear those timers and prevent memory leaks.