You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling Array#flat(depth) with depth. Normally the depth should be 1/Number.POSITIVE_INFINITY. Otherwise it should be reported, but I don't want this rule to get annoying, so
If it's not a number literal, we assume user know the max depth.
If there is a comment before the number, we assume the number is explained.
Fail
array.flat(2);
array.flat(99);
Pass
array.flat();
array.flat(Number.POSITIVE_INFINITY);
array.flat(depth);
array.flat(/* The depth is always 2 */2);
Additional Info
This rule should only be useful for users don't want to enable no-magic-numbers, otherwise the failed cases shold already covered.
The text was updated successfully, but these errors were encountered:
Description
A special case of
no-magic-numbers
rule.When calling
Array#flat(depth)
with depth. Normally the depth should be1
/Number.POSITIVE_INFINITY
. Otherwise it should be reported, but I don't want this rule to get annoying, soFail
Pass
Additional Info
This rule should only be useful for users don't want to enable
no-magic-numbers
, otherwise the failed cases shold already covered.The text was updated successfully, but these errors were encountered: