Skip to content

Commit 6d24d3b

Browse files
committed
Disallow template literals when placeholders or tagged template features are not used
Fixes: standard/standard#838 Fixes: standard/eslint-config-standard#151
1 parent a8f0deb commit 6d24d3b

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## UNRELEASED
7+
8+
### New features
9+
10+
### New rules
11+
12+
*(Estimated % of affected standard users, based on test suite in parens)*
13+
14+
- Disallow template literals when placeholders or tagged template features are not used. ([quotes](https://eslint.org/docs/rules/quotes)) [#838](https://github.com/standard/standard/issues/838) [eslint-config-standard/#151](https://github.com/standard/eslint-config-standard/pull/151) (1%)
15+
16+
### Changed rules
17+
618
## 13.1.0 - 2019-07-20
719

820
- Update `eslint` from `~6.0.1` to `~6.1.0`

RULES.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ your code.
3737
eslint: [`quotes`](http://eslint.org/docs/rules/quotes)
3838

3939
```js
40-
console.log('hello there')
41-
$("<div class='box'>")
40+
console.log('hello there') // ✓ ok
41+
console.log("hello there") // ✗ avoid
42+
console.log(`hello there`) // ✗ avoid
43+
44+
$("<div class='box'>") // ✓ ok
45+
console.log(`hello ${name}`) // ✓ ok
4246
```
4347

4448
* **No unused variables.**

eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": ["standard", "standard-jsx"]
2+
"extends": ["standard", "standard-jsx"],
3+
"rules": {
4+
"quotes": ["error", "single", { "avoidEscape": true }]
5+
}
36
}

0 commit comments

Comments
 (0)