From cd2fa0412f3d051a22df2f6c252f03258e319471 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 13 Feb 2018 01:52:02 +0100 Subject: [PATCH] doc: activate `no-multiple-empty-lines` rule This enables the `no-multiple-empty-lines` eslint rule for the docs. PR-URL: https://github.com/nodejs/node/pull/18747 Reviewed-By: Weijia Wang Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Matheus Marchini --- doc/.eslintrc.yaml | 3 +++ doc/api/buffer.md | 8 -------- doc/api/vm.md | 3 --- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/doc/.eslintrc.yaml b/doc/.eslintrc.yaml index 8038836fe310db..c8c1612e3a100b 100644 --- a/doc/.eslintrc.yaml +++ b/doc/.eslintrc.yaml @@ -12,3 +12,6 @@ rules: no-var: error prefer-const: error prefer-rest-params: error + + # Stylistic Issues + no-multiple-empty-lines: [error, {max: 1, maxEOF: 0, maxBOF: 0}] diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 1e5b23cb4b9982..439e9917803814 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -500,7 +500,6 @@ console.log(buf1.toString()); // Prints: this is a tC)st console.log(buf1.toString('ascii')); - const buf2 = new Buffer('7468697320697320612074c3a97374', 'hex'); // Prints: this is a tést @@ -908,7 +907,6 @@ console.log(buf1.toString()); // Prints: this is a tC)st console.log(buf1.toString('ascii')); - const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); // Prints: this is a tést @@ -1364,7 +1362,6 @@ console.log(buf.indexOf(Buffer.from('a buffer example'))); // Prints: 8 console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); // Prints: 4 @@ -1475,7 +1472,6 @@ console.log(buf.lastIndexOf('buffer', 5)); // Prints: -1 console.log(buf.lastIndexOf('buffer', 4)); - const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); // Prints: 6 @@ -1998,7 +1994,6 @@ buf1.swap16(); // Prints: console.log(buf1); - const buf2 = Buffer.from([0x1, 0x2, 0x3]); // Throws an exception: RangeError: Buffer size must be a multiple of 16-bits @@ -2028,7 +2023,6 @@ buf1.swap32(); // Prints: console.log(buf1); - const buf2 = Buffer.from([0x1, 0x2, 0x3]); // Throws an exception: RangeError: Buffer size must be a multiple of 32-bits @@ -2058,7 +2052,6 @@ buf1.swap64(); // Prints: console.log(buf1); - const buf2 = Buffer.from([0x1, 0x2, 0x3]); // Throws an exception: RangeError: Buffer size must be a multiple of 64-bits @@ -2130,7 +2123,6 @@ console.log(buf1.toString('ascii')); // Prints: abcde console.log(buf1.toString('ascii', 0, 5)); - const buf2 = Buffer.from('tést'); // Prints: 74c3a97374 diff --git a/doc/api/vm.md b/doc/api/vm.md index 969f1a79aef661..26ec6d62270aca 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -93,7 +93,6 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); s; `, { context: contextifiedSandbox }); - // Step 2 // // "Link" the imported dependencies of this Module to it. @@ -132,7 +131,6 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); } await bar.link(linker); - // Step 3 // // Instantiate the top-level Module. @@ -142,7 +140,6 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); bar.instantiate(); - // Step 4 // // Evaluate the Module. The evaluate() method returns a Promise with a single