2020-06-30 12:47:33 +02:00
include::../description.adoc[]
include::../noncompliant.adoc[]
include::../compliant.adoc[]
== Exceptions
2021-02-08 12:42:26 +01:00
This rule ignores initializations to -1, 0, 1, ``++null++``, ``++undefined++``, [], {}, ``++true++``, ``++false++`` and ``++""++``. Variables that start with an underscore (e.g. \'``++_unused++``') are ignored.
2020-06-30 12:47:33 +02:00
2021-02-02 15:02:10 +01:00
2020-06-30 12:47:33 +02:00
This rule also ignores variables declared with object destructuring using rest syntax (used to exclude some properties from object):
2020-06-30 14:49:38 +02:00
2020-06-30 12:47:33 +02:00
----
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[]
2021-06-02 20:44:38 +02:00
2021-06-03 09:05:38 +02:00
ifdef::env-github,rspecator-view[]
2021-06-08 15:52:13 +02:00
'''
2021-06-02 20:44:38 +02:00
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
2021-06-03 09:05:38 +02:00
endif::env-github,rspecator-view[]