29 lines
459 B
Plaintext
29 lines
459 B
Plaintext
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
|
|
----
|
|
|