-
-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter): remove unsafe fixer of no-useless-spread
#6655
base: main
Are you sure you want to change the base?
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
⚠ eslint-plugin-unicorn(no-useless-spread): Using a spread operator here creates a new array unnecessarily. | ||
╭─[no_useless_spread.tsx:1:2] | ||
1 │ [...new Array(3)] | ||
· ─── | ||
╰──── | ||
help: `new Array(3)` returns a new array. Spreading it into an array expression to create a new array is redundant. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should still report this case - unicorn/no-useless-spread
reports an error.
how about we just don't suggest a fix in this case
to add, i'm happy for this to be discussed 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should fix [...new Array(3)]
to new Array(3).fill()
, or just give a warning. @DonIsaac cc
CodSpeed Performance ReportMerging #6655 will not alter performanceComparing Summary
|
In this case, we should mark the fix as dangerous instead of skipping it entirely |
e9d964c
to
4dfefe1
Compare
closes #6618