chore(lint): upgrade array creation, effect, and TypeScript rules #37885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Third batch of lint cleanup to reduce tech debt and enforce stricter patterns.
Rules upgraded to error:
unicorn/no-new-array- PreferArray.from({ length: n }, callback)overnew Array(n).fill().map()@typescript-eslint/no-use-before-define- Previously at warn, now error (no violations found)react-you-might-not-need-an-effect/no-adjust-state-on-prop-change- New rule addedreact-you-might-not-need-an-effect/no-pass-data-to-parent- New rule addedFixes applied:
Fixed all
unicorn/no-new-arrayviolations across 17 files by replacing:new Array(n).fill().map(callback)→Array.from({ length: n }, callback)new Array(n).fill(0).join('')→'0'.repeat(n)new Array(n).fill().forEach(callback)→forloopWhy prefer Array.from?
new Array(n).fill().map()has several issues:.fill()alone creates holes that behave unexpectedly with array methodsArray.from({ length: n }, callback)is more readable and directBEFORE/AFTER
Before:
After:
TESTING INSTRUCTIONS
These are lint rule changes. CI will verify all linting passes.
ADDITIONAL INFORMATION
🤖 Generated with Claude Code