2021-04-28 18:08:03 +02:00
|
|
|
This rule checks that all string literals use the same kind of quotes.
|
|
|
|
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
Using the parameter default (forcing single quotes):
|
|
|
|
|
|
|
|
----
|
|
|
|
var firstParameter = "something"; // Noncompliant
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
var firstParameter = 'something';
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
== Exceptions
|
|
|
|
|
|
|
|
Strings that contain quotes are ignored.
|
|
|
|
|
|
|
|
----
|
|
|
|
let heSaid = "Then he said 'What?'." // ignored
|
|
|
|
let sheSaid = '"Whatever!" she replied.' // ignored
|
|
|
|
----
|
|
|
|
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
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[]
|