Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Jun 14, 2023
1 parent ee6a329 commit 6f7b899
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/src/rules/quotes.md
Expand Up @@ -15,14 +15,16 @@ var single = 'single';
var backtick = `backtick`; // ES6 only
```

Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).
Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded expressions to be interpreted).

Many codebases require strings to be defined in a consistent manner.

## Rule Details

This rule enforces the consistent use of either backticks, double, or single quotes.

This rule is aware of directive prologues such as `"use strict";` and will not flag or autofix them unless doing so will not change how the directive prologue is interpreted.

## Options

This rule has two options, a string option and an object option.
Expand Down Expand Up @@ -125,7 +127,9 @@ Examples of **correct** code for this rule with the `"backtick"` option:
/*eslint quotes: ["error", "backtick"]*/
/*eslint-env es6*/

"use strict"; // directives must use single or double quotes
var backtick = `backtick`;
var obj = { 'prop-name': `value` }; // backticks not allowed for property names
```

:::
Expand Down

0 comments on commit 6f7b899

Please sign in to comment.