31 lines
854 B
Plaintext
31 lines
854 B
Plaintext
include::../description.adoc[]
|
|
|
|
include::../noncompliant.adoc[]
|
|
|
|
include::../compliant.adoc[]
|
|
|
|
== Exceptions
|
|
|
|
This rule ignores initializations to -1, 0, 1, ``++null++``, ``++undefined++``, [], {}, ``++true++``, ``++false++`` and ``++""++``. Variables that start with an underscore (e.g. \'``++_unused++``') are ignored.
|
|
|
|
|
|
This rule also ignores variables declared with object destructuring using rest syntax (used to exclude some properties from object):
|
|
|
|
----
|
|
let {a, b, ...rest} = obj; // 'a' and 'b' are ok
|
|
doSomething(rest);
|
|
|
|
let [x1, x2, x3] = arr; // but 'x1' is noncompliant, as omitting syntax can be used: "let [, x2, x3] = arr;"
|
|
doSomething(x2, x3);
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|