Skip to content

Commit 62de339

Browse files
TrottMylesBorins
authored andcommitted
tools: remove legacy indentation linting
All linting now uses the current ESLint 4.3.0 indentation linting. Remove legacy indentation rules. Backport-PR-URL: #14835 PR-URL: #14515 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
1 parent a3cd733 commit 62de339

20 files changed

+59
-86
lines changed

.eslintrc.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,13 @@ rules:
9999
func-call-spacing: 2
100100
func-name-matching: 2
101101
func-style: [2, declaration, {allowArrowFunctions: true}]
102-
# indent: [2, 2, {ArrayExpression: first,
103-
# CallExpression: {arguments: first},
104-
# FunctionDeclaration: {parameters: first},
105-
# FunctionExpression: {parameters: first},
106-
# MemberExpression: off,
107-
# ObjectExpression: first,
108-
# SwitchCase: 1}]
109-
indent-legacy: [2, 2, {ArrayExpression: first,
110-
CallExpression: {arguments: first},
111-
MemberExpression: 1,
112-
ObjectExpression: first,
113-
SwitchCase: 1}]
102+
indent: [2, 2, {ArrayExpression: first,
103+
CallExpression: {arguments: first},
104+
FunctionDeclaration: {parameters: first},
105+
FunctionExpression: {parameters: first},
106+
MemberExpression: off,
107+
ObjectExpression: first,
108+
SwitchCase: 1}]
114109
key-spacing: [2, {mode: minimum}]
115110
keyword-spacing: 2
116111
linebreak-style: [2, unix]

benchmark/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ example, buffers/buffer-read.js has the following configuration:
3737
<!-- eslint-disable strict, no-undef, no-unused-vars -->
3838
```js
3939
var bench = common.createBenchmark(main, {
40-
noAssert: [false, true],
41-
buffer: ['fast', 'slow'],
42-
type: ['UInt8', 'UInt16LE', 'UInt16BE',
43-
'UInt32LE', 'UInt32BE',
44-
'Int8', 'Int16LE', 'Int16BE',
45-
'Int32LE', 'Int32BE',
46-
'FloatLE', 'FloatBE',
47-
'DoubleLE', 'DoubleBE'],
48-
millions: [1]
40+
noAssert: [false, true],
41+
buffer: ['fast', 'slow'],
42+
type: ['UInt8', 'UInt16LE', 'UInt16BE',
43+
'UInt32LE', 'UInt32BE',
44+
'Int8', 'Int16LE', 'Int16BE',
45+
'Int32LE', 'Int32BE',
46+
'FloatLE', 'FloatBE',
47+
'DoubleLE', 'DoubleBE'],
48+
millions: [1]
4949
});
5050
```
5151
The runner takes one item from each of the property array value to build a list

benchmark/buffers/buffer-compare-offset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function main(conf) {
5050
const iter = (conf.millions >>> 0) * 1e6;
5151
const size = (conf.size >>> 0);
5252
const method = conf.method === 'slice' ?
53-
compareUsingSlice : compareUsingOffset;
53+
compareUsingSlice : compareUsingOffset;
5454
method(Buffer.alloc(size, 'a'),
5555
Buffer.alloc(size, 'b'),
5656
size >> 1,

benchmark/child_process/child-process-read-ipc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (process.argv[2] === 'child') {
2626

2727
const options = { 'stdio': ['ignore', 1, 2, 'ipc'] };
2828
const child = spawn(process.argv[0],
29-
[process.argv[1], 'child', len], options);
29+
[process.argv[1], 'child', len], options);
3030

3131
var bytes = 0;
3232
child.on('message', function(msg) {

doc/api/errors.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -316,20 +316,20 @@ function makeFaster() {
316316
}
317317

318318
makeFaster(); // will throw:
319-
// /home/gbusey/file.js:6
320-
// throw new Error('oh no!');
321-
// ^
322-
// Error: oh no!
323-
// at speedy (/home/gbusey/file.js:6:11)
324-
// at makeFaster (/home/gbusey/file.js:5:3)
325-
// at Object.<anonymous> (/home/gbusey/file.js:10:1)
326-
// at Module._compile (module.js:456:26)
327-
// at Object.Module._extensions..js (module.js:474:10)
328-
// at Module.load (module.js:356:32)
329-
// at Function.Module._load (module.js:312:12)
330-
// at Function.Module.runMain (module.js:497:10)
331-
// at startup (node.js:119:16)
332-
// at node.js:906:3
319+
// /home/gbusey/file.js:6
320+
// throw new Error('oh no!');
321+
// ^
322+
// Error: oh no!
323+
// at speedy (/home/gbusey/file.js:6:11)
324+
// at makeFaster (/home/gbusey/file.js:5:3)
325+
// at Object.<anonymous> (/home/gbusey/file.js:10:1)
326+
// at Module._compile (module.js:456:26)
327+
// at Object.Module._extensions..js (module.js:474:10)
328+
// at Module.load (module.js:356:32)
329+
// at Function.Module._load (module.js:312:12)
330+
// at Function.Module.runMain (module.js:497:10)
331+
// at startup (node.js:119:16)
332+
// at node.js:906:3
333333
```
334334

335335
The location information will be one of:
@@ -360,7 +360,7 @@ For example:
360360

361361
```js
362362
require('net').connect(-1);
363-
// throws "RangeError: "port" option should be >= 0 and < 65536: -1"
363+
// throws "RangeError: "port" option should be >= 0 and < 65536: -1"
364364
```
365365

366366
Node.js will generate and throw `RangeError` instances *immediately* as a form
@@ -377,7 +377,7 @@ will do so.
377377

378378
```js
379379
doesNotExist;
380-
// throws ReferenceError, doesNotExist is not a variable in this program.
380+
// throws ReferenceError, doesNotExist is not a variable in this program.
381381
```
382382

383383
Unless an application is dynamically generating and running code,
@@ -411,7 +411,7 @@ string would be considered a TypeError.
411411

412412
```js
413413
require('url').parse(() => { });
414-
// throws TypeError, since it expected a string
414+
// throws TypeError, since it expected a string
415415
```
416416

417417
Node.js will generate and throw `TypeError` instances *immediately* as a form

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ support. If `filename` is provided, it will be provided as a `Buffer` if
137137
fs.watch('./tmp', {encoding: 'buffer'}, (eventType, filename) => {
138138
if (filename)
139139
console.log(filename);
140-
// Prints: <Buffer ...>
140+
// Prints: <Buffer ...>
141141
});
142142
```
143143

doc/api/net.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ double-backslashes, such as:
221221

222222
```js
223223
net.createServer().listen(
224-
path.join('\\\\?\\pipe', process.cwd(), 'myctl'));
224+
path.join('\\\\?\\pipe', process.cwd(), 'myctl'));
225225
```
226226

227227
The parameter `backlog` behaves the same as in

doc/api/process.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ custom or application specific warnings.
320320
```js
321321
// Emit a warning using a string...
322322
process.emitWarning('Something happened!');
323-
// Prints: (node 12345) Warning: Something happened!
323+
// Prints: (node 12345) Warning: Something happened!
324324

325325
// Emit a warning using an object...
326326
process.emitWarning('Something Happened!', 'CustomWarning');
327-
// Prints: (node 12345) CustomWarning: Something happened!
327+
// Prints: (node 12345) CustomWarning: Something happened!
328328

329329
// Emit a warning using a custom Error object...
330330
class CustomWarning extends Error {
@@ -336,7 +336,7 @@ class CustomWarning extends Error {
336336
}
337337
const myWarning = new CustomWarning('Something happened!');
338338
process.emitWarning(myWarning);
339-
// Prints: (node 12345) CustomWarning: Something happened!
339+
// Prints: (node 12345) CustomWarning: Something happened!
340340
```
341341

342342
#### Emitting custom deprecation warnings

lib/_debugger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ Interface.prototype.scripts = function() {
12061206
script.name === client.currentScript ||
12071207
!script.isNative) {
12081208
scripts.push(
1209-
(script.name === client.currentScript ? '* ' : ' ') +
1209+
(script.name === client.currentScript ? '* ' : ' ') +
12101210
id + ': ' +
12111211
path.basename(script.name)
12121212
);

lib/_stream_readable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,8 @@ function fromListPartial(n, list, hasStrings) {
877877
} else {
878878
// result spans more than one buffer
879879
ret = (hasStrings
880-
? copyFromBufferString(n, list)
881-
: copyFromBuffer(n, list));
880+
? copyFromBufferString(n, list)
881+
: copyFromBuffer(n, list));
882882
}
883883
return ret;
884884
}

0 commit comments

Comments
 (0)