-
-
Notifications
You must be signed in to change notification settings - Fork 403
Rule proposal: Prefer array.flat()
over array.flat(1)
#1629
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
Comments
Would it make sense to just add this check to the existing prefer-array-flat rule? |
Not sure it belongs in Would maybe be a better fit for #1356? |
We already have |
I wonder if someone prefer use |
All the rules mentioned here are a variation of "enforce or avoid the default value".
It almost feels like they belong together. I'm not particularly a fan of enforcing default values, but they do make it clearer sometimes. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Array.prototype.flat
uses1
as the argument if you passundefined
or do not provide a value.This means that
.flat(1)
is the same as.flat()
, making the argument unnecessary.Fail
Pass
The text was updated successfully, but these errors were encountered: