Skip to content

Commit

Permalink
Disallow template literals when placeholders or tagged template featu…
Browse files Browse the repository at this point in the history
…res are not used

Fixes: #838
Fixes: standard/eslint-config-standard#151
  • Loading branch information
feross committed Jul 27, 2019
1 parent 0fd684a commit c003b84
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## UNRELEASED

### New features

### New rules

*(Estimated % of affected standard users, based on test suite in parens)*

- 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%)

### Changed rules

## 13.1.0 - 2019-07-20

- Update `eslint` from `~6.0.1` to `~6.1.0`
Expand Down
8 changes: 6 additions & 2 deletions RULES.md
Expand Up @@ -37,8 +37,12 @@ your code.
eslint: [`quotes`](http://eslint.org/docs/rules/quotes)

```js
console.log('hello there')
$("<div class='box'>")
console.log('hello there') // ✓ ok
console.log("hello there") // ✗ avoid
console.log(`hello there`) // ✗ avoid

$("<div class='box'>") // ✓ ok
console.log(`hello ${name}`) // ✓ ok
```

* **No unused variables.**
Expand Down
5 changes: 4 additions & 1 deletion eslintrc.json
@@ -1,3 +1,6 @@
{
"extends": ["standard", "standard-jsx"]
"extends": ["standard", "standard-jsx"],
"rules": {
"quotes": ["error", "single", { "avoidEscape": true }]
}
}

0 comments on commit c003b84

Please sign in to comment.