Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Add configuration comments in examples #13738

Merged
merged 3 commits into from Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/rules/no-unmodified-loop-condition.md
Expand Up @@ -29,6 +29,10 @@ If a reference is inside of a dynamic expression (e.g. `CallExpression`,
Examples of **incorrect** code for this rule:

```js
/*eslint no-unmodified-loop-condition: "error"*/

var node = something;

while (node) {
doSomething(node);
}
Expand All @@ -46,6 +50,8 @@ while (node !== root) {
Examples of **correct** code for this rule:

```js
/*eslint no-unmodified-loop-condition: "error"*/

while (node) {
doSomething(node);
node = node.parent;
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/prefer-object-spread.md
Expand Up @@ -9,6 +9,7 @@ Introduced in ES2018, object spread is a declarative alternative which may perfo
Examples of **incorrect** code for this rule:

```js
/*eslint prefer-object-spread: "error"*/

Object.assign({}, foo)

Expand All @@ -31,6 +32,7 @@ Object.assign({ foo: bar });
Examples of **correct** code for this rule:

```js
/*eslint prefer-object-spread: "error"*/

Object.assign(...foo);

Expand Down
4 changes: 4 additions & 0 deletions docs/rules/valid-typeof.md
Expand Up @@ -37,6 +37,8 @@ typeof bar === typeof qux
Examples of **incorrect** code with the `{ "requireStringLiterals": true }` option:

```js
/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/

typeof foo === undefined
typeof bar == Object
typeof baz === "strnig"
Expand All @@ -48,6 +50,8 @@ typeof foo == 5
Examples of **correct** code with the `{ "requireStringLiterals": true }` option:

```js
/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/

typeof foo === "undefined"
typeof bar == "object"
typeof baz === "string"
Expand Down