diff --git a/docs/src/rules/accessor-pairs.md b/docs/src/rules/accessor-pairs.md index b84205d34935..776b116e6d28 100644 --- a/docs/src/rules/accessor-pairs.md +++ b/docs/src/rules/accessor-pairs.md @@ -17,7 +17,7 @@ Here are some examples: ```js // Bad -var o = { +const o = { set a(value) { this.val = value; } @@ -25,7 +25,7 @@ var o = { // Good -var o = { +const p = { set a(value) { this.val = value; }, @@ -61,15 +61,15 @@ Examples of **incorrect** code for the default `{ "setWithoutGet": true }` optio ```js /*eslint accessor-pairs: "error"*/ -var o = { +const q = { set a(value) { this.val = value; } }; -var o = {d: 1}; -Object.defineProperty(o, 'c', { +const r = {d: 1}; +Object.defineProperty(r, 'c', { set: function(value) { this.val = value; } @@ -85,7 +85,7 @@ Examples of **correct** code for the default `{ "setWithoutGet": true }` option: ```js /*eslint accessor-pairs: "error"*/ -var o = { +const s = { set a(value) { this.val = value; }, @@ -94,8 +94,8 @@ var o = { } }; -var o = {d: 1}; -Object.defineProperty(o, 'c', { +const t = {d: 1}; +Object.defineProperty(t, 'c', { set: function(value) { this.val = value; }, @@ -117,27 +117,27 @@ Examples of **incorrect** code for the `{ "getWithoutSet": true }` option: ```js /*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/ -var o = { +const u = { set a(value) { this.val = value; } }; -var o = { +const v = { get a() { return this.val; } }; -var o = {d: 1}; -Object.defineProperty(o, 'c', { +const w = {d: 1}; +Object.defineProperty(w, 'c', { set: function(value) { this.val = value; } }); -var o = {d: 1}; -Object.defineProperty(o, 'c', { +const x = {d: 1}; +Object.defineProperty(x, 'c', { get: function() { return this.val; } @@ -152,7 +152,7 @@ Examples of **correct** code for the `{ "getWithoutSet": true }` option: ```js /*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/ -var o = { +const y = { set a(value) { this.val = value; }, @@ -161,8 +161,8 @@ var o = { } }; -var o = {d: 1}; -Object.defineProperty(o, 'c', { +const z = {d: 1}; +Object.defineProperty(z, 'c', { set: function(value) { this.val = value; }, @@ -281,14 +281,14 @@ might not report a missing pair for a getter/setter that has a computed key, lik ```js /*eslint accessor-pairs: "error"*/ -var a = 1; +const z = 1; // no warnings -var o = { - get [a++]() { +const a = { + get [z++]() { return this.val; }, - set [a++](value) { + set [z++](value) { this.val = value; } }; @@ -301,7 +301,7 @@ might not report a missing pair for a getter/setter, like in the following examp /*eslint accessor-pairs: "error"*/ // no warnings -var o = { +const b = { get a() { return this.val; }, diff --git a/docs/src/rules/array-bracket-newline.md b/docs/src/rules/array-bracket-newline.md index 900fea16fb09..2c1c573c8014 100644 --- a/docs/src/rules/array-bracket-newline.md +++ b/docs/src/rules/array-bracket-newline.md @@ -35,12 +35,12 @@ Examples of **incorrect** code for this rule with the `"always"` option: ```js /*eslint array-bracket-newline: ["error", "always"]*/ -var a = []; -var b = [1]; -var c = [1, 2]; -var d = [1, +const a = []; +const b = [1]; +const c = [1, 2]; +const d = [1, 2]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; ``` @@ -54,19 +54,19 @@ Examples of **correct** code for this rule with the `"always"` option: ```js /*eslint array-bracket-newline: ["error", "always"]*/ -var a = [ +const a = [ ]; -var b = [ +const b = [ 1 ]; -var c = [ +const c = [ 1, 2 ]; -var d = [ +const d = [ 1, 2 ]; -var e = [ +const e = [ function foo() { dosomething(); } @@ -84,19 +84,19 @@ Examples of **incorrect** code for this rule with the `"never"` option: ```js /*eslint array-bracket-newline: ["error", "never"]*/ -var a = [ +const a = [ ]; -var b = [ +const b = [ 1 ]; -var c = [ +const c = [ 1, 2 ]; -var d = [ +const d = [ 1, 2 ]; -var e = [ +const e = [ function foo() { dosomething(); } @@ -112,12 +112,12 @@ Examples of **correct** code for this rule with the `"never"` option: ```js /*eslint array-bracket-newline: ["error", "never"]*/ -var a = []; -var b = [1]; -var c = [1, 2]; -var d = [1, +const a = []; +const b = [1]; +const c = [1, 2]; +const d = [1, 2]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; ``` @@ -133,15 +133,15 @@ Examples of **incorrect** code for this rule with the `"consistent"` option: ```js /*eslint array-bracket-newline: ["error", "consistent"]*/ -var a = [1 +const a = [1 ]; -var b = [ +const b = [ 1]; -var c = [function foo() { +const c = [function foo() { dosomething(); } ] -var d = [ +const d = [ function foo() { dosomething(); }] @@ -156,17 +156,17 @@ Examples of **correct** code for this rule with the `"consistent"` option: ```js /*eslint array-bracket-newline: ["error", "consistent"]*/ -var a = []; -var b = [ +const a = []; +const b = [ ]; -var c = [1]; -var d = [ +const c = [1]; +const d = [ 1 ]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; -var f = [ +const f = [ function foo() { dosomething(); } @@ -184,17 +184,17 @@ Examples of **incorrect** code for this rule with the default `{ "multiline": tr ```js /*eslint array-bracket-newline: ["error", { "multiline": true }]*/ -var a = [ +const a = [ ]; -var b = [ +const b = [ 1 ]; -var c = [ +const c = [ 1, 2 ]; -var d = [1, +const d = [1, 2]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; ``` @@ -208,14 +208,14 @@ Examples of **correct** code for this rule with the default `{ "multiline": true ```js /*eslint array-bracket-newline: ["error", { "multiline": true }]*/ -var a = []; -var b = [1]; -var c = [1, 2]; -var d = [ +const a = []; +const b = [1]; +const c = [1, 2]; +const d = [ 1, 2 ]; -var e = [ +const e = [ function foo() { dosomething(); } @@ -233,15 +233,15 @@ Examples of **incorrect** code for this rule with the `{ "minItems": 2 }` option ```js /*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/ -var a = [ +const a = [ ]; -var b = [ +const b = [ 1 ]; -var c = [1, 2]; -var d = [1, +const c = [1, 2]; +const d = [1, 2]; -var e = [ +const e = [ function foo() { dosomething(); } @@ -257,16 +257,16 @@ Examples of **correct** code for this rule with the `{ "minItems": 2 }` option: ```js /*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/ -var a = []; -var b = [1]; -var c = [ +const a = []; +const b = [1]; +const c = [ 1, 2 ]; -var d = [ +const d = [ 1, 2 ]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; ``` @@ -282,15 +282,15 @@ Examples of **incorrect** code for this rule with the `{ "multiline": true, "min ```js /*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/ -var a = [ +const a = [ ]; -var b = [ +const b = [ 1 ]; -var c = [1, 2]; -var d = [1, +const c = [1, 2]; +const d = [1, 2]; -var e = [function foo() { +const e = [function foo() { dosomething(); }]; ``` @@ -304,16 +304,16 @@ Examples of **correct** code for this rule with the `{ "multiline": true, "minIt ```js /*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/ -var a = []; -var b = [1]; -var c = [ +const a = []; +const b = [1]; +const c = [ 1, 2 ]; -var d = [ +const d = [ 1, 2 ]; -var e = [ +const e = [ function foo() { dosomething(); }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: