
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
include::../noncompliant.adoc[]
|
|
|
|
include::../compliant.adoc[]
|
|
|
|
=== Exceptions
|
|
|
|
* This rule ignores initializations to -1, 0, 1, ``++undefined++``, [], {}, ``++true++``, ``++false++`` and ``++""++``.
|
|
* Variables that start with an underscore (e.g. \'``++_unused++``') are ignored.
|
|
* Assignment of ``++null++`` is ignored because it is sometimes used to help garbage collection
|
|
* Increment and decrement expressions are ignored because they are often used idiomatically instead of `x+1`
|
|
* This rule also ignores variables declared with object destructuring using rest syntax (used to exclude some properties from object):
|
|
|
|
[source,javascript]
|
|
----
|
|
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[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 29 Apr 2015, 07:49:23 Ann Campbell wrote:
|
|
assigned for review of expansion
|
|
|
|
=== on 29 Apr 2015, 08:55:42 Linda Martin wrote:
|
|
Reviewed!
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|