Skip to content

Commit

Permalink
Add template literal "bad" example to single quotes guideline
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lencioni committed Aug 4, 2016
1 parent bfc842e commit 6d2fc89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ Other Style Guides
// bad
const name = "Capt. Janeway";
// bad - template literals should contain interpolation or newlines
const name = `Capt. Janeway`;
// good
const name = 'Capt. Janeway';
```
Expand Down

0 comments on commit 6d2fc89

Please sign in to comment.