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 airbnb#992
  • Loading branch information
lencioni authored and jaylaw81 committed Sep 19, 2017
1 parent 18f961c commit 5ebc25b
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 5ebc25b

Please sign in to comment.