-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
no-useless-spread
: Check more cases
#1482
Comments
no-useless-spread
check more casesno-useless-spread
: Check more cases
It can check that spread isn't used when there's only a single property. So |
It can be making a shallow copy. In object spread, it can also ensuring object type. function foo(options) {
const {bar} = {...options};
} |
Could checking this be added as an option? Sometimes spread is used just to combine things, so if you start off with If there was this option you could disable the rule in cases when you want a shallow object. |
@rightaway |
(The badge links to a different issue but the bounty applies to this issue)
Fail
Other array methods returns a new array, eg:
concat()
,flatMap()
,copyWithin()
, etcOther known arrays, eg:
Array.from()
,Object.keys()
, ...Pass
These cases are like "useless array copy"
The text was updated successfully, but these errors were encountered: