Skip to content

Commit 9e2b5c0

Browse files
committed
Add template literal "bad" example to single quotes guideline
There has been some confusion around whether we should use single quotes or template literals. To help avoid this confusion, I am adding a "bad" example to the single quotes guideline. This rule is already enforced by the quotes linter rule. Generally, we want code to clearly express developer intention. Using template literals communicates that you intend to use some of the features that template literals offer (e.g. interpolation). Fixes #992
1 parent c6a8ec4 commit 9e2b5c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ Other Style Guides
475475
// bad
476476
const name = "Capt. Janeway";
477477
478+
// bad - template literals should contain interpolation or newlines
479+
const name = `Capt. Janeway`;
480+
478481
// good
479482
const name = 'Capt. Janeway';
480483
```

0 commit comments

Comments
 (0)