diff --git a/docs/rules/no-unmodified-loop-condition.md b/docs/rules/no-unmodified-loop-condition.md index 688c350d2da..7d9bceeedef 100644 --- a/docs/rules/no-unmodified-loop-condition.md +++ b/docs/rules/no-unmodified-loop-condition.md @@ -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); } @@ -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; diff --git a/docs/rules/prefer-object-spread.md b/docs/rules/prefer-object-spread.md index 95a646068f8..50d721b79ad 100644 --- a/docs/rules/prefer-object-spread.md +++ b/docs/rules/prefer-object-spread.md @@ -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) @@ -31,6 +32,7 @@ Object.assign({ foo: bar }); Examples of **correct** code for this rule: ```js +/*eslint prefer-object-spread: "error"*/ Object.assign(...foo); diff --git a/docs/rules/valid-typeof.md b/docs/rules/valid-typeof.md index b1884a874a9..825e3bfae13 100644 --- a/docs/rules/valid-typeof.md +++ b/docs/rules/valid-typeof.md @@ -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" @@ -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"