Browse Source

tools: remove legacy indentation linting

All linting now uses the current ESLint 4.3.0 indentation linting.
Remove legacy indentation rules.

Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/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>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
62de339327
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 13
      .eslintrc.yaml
  2. 34
      doc/api/errors.md
  3. 6
      doc/api/process.md
  4. 10
      test/.eslintrc.yaml
  5. 12
      tools/.eslintrc.yaml

13
.eslintrc.yaml

@ -99,16 +99,11 @@ rules:
func-call-spacing: 2 func-call-spacing: 2
func-name-matching: 2 func-name-matching: 2
func-style: [2, declaration, {allowArrowFunctions: true}] func-style: [2, declaration, {allowArrowFunctions: true}]
# indent: [2, 2, {ArrayExpression: first, indent: [2, 2, {ArrayExpression: first,
# CallExpression: {arguments: first},
# FunctionDeclaration: {parameters: first},
# FunctionExpression: {parameters: first},
# MemberExpression: off,
# ObjectExpression: first,
# SwitchCase: 1}]
indent-legacy: [2, 2, {ArrayExpression: first,
CallExpression: {arguments: first}, CallExpression: {arguments: first},
MemberExpression: 1, FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first},
MemberExpression: off,
ObjectExpression: first, ObjectExpression: first,
SwitchCase: 1}] SwitchCase: 1}]
key-spacing: [2, {mode: minimum}] key-spacing: [2, {mode: minimum}]

34
doc/api/errors.md

@ -316,20 +316,20 @@ function makeFaster() {
} }
makeFaster(); // will throw: makeFaster(); // will throw:
// /home/gbusey/file.js:6 // /home/gbusey/file.js:6
// throw new Error('oh no!'); // throw new Error('oh no!');
// ^ // ^
// Error: oh no! // Error: oh no!
// at speedy (/home/gbusey/file.js:6:11) // at speedy (/home/gbusey/file.js:6:11)
// at makeFaster (/home/gbusey/file.js:5:3) // at makeFaster (/home/gbusey/file.js:5:3)
// at Object.<anonymous> (/home/gbusey/file.js:10:1) // at Object.<anonymous> (/home/gbusey/file.js:10:1)
// at Module._compile (module.js:456:26) // at Module._compile (module.js:456:26)
// at Object.Module._extensions..js (module.js:474:10) // at Object.Module._extensions..js (module.js:474:10)
// at Module.load (module.js:356:32) // at Module.load (module.js:356:32)
// at Function.Module._load (module.js:312:12) // at Function.Module._load (module.js:312:12)
// at Function.Module.runMain (module.js:497:10) // at Function.Module.runMain (module.js:497:10)
// at startup (node.js:119:16) // at startup (node.js:119:16)
// at node.js:906:3 // at node.js:906:3
``` ```
The location information will be one of: The location information will be one of:
@ -360,7 +360,7 @@ For example:
```js ```js
require('net').connect(-1); require('net').connect(-1);
// throws "RangeError: "port" option should be >= 0 and < 65536: -1" // throws "RangeError: "port" option should be >= 0 and < 65536: -1"
``` ```
Node.js will generate and throw `RangeError` instances *immediately* as a form Node.js will generate and throw `RangeError` instances *immediately* as a form
@ -377,7 +377,7 @@ will do so.
```js ```js
doesNotExist; doesNotExist;
// throws ReferenceError, doesNotExist is not a variable in this program. // throws ReferenceError, doesNotExist is not a variable in this program.
``` ```
Unless an application is dynamically generating and running code, Unless an application is dynamically generating and running code,
@ -411,7 +411,7 @@ string would be considered a TypeError.
```js ```js
require('url').parse(() => { }); require('url').parse(() => { });
// throws TypeError, since it expected a string // throws TypeError, since it expected a string
``` ```
Node.js will generate and throw `TypeError` instances *immediately* as a form Node.js will generate and throw `TypeError` instances *immediately* as a form

6
doc/api/process.md

@ -320,11 +320,11 @@ custom or application specific warnings.
```js ```js
// Emit a warning using a string... // Emit a warning using a string...
process.emitWarning('Something happened!'); process.emitWarning('Something happened!');
// Prints: (node 12345) Warning: Something happened! // Prints: (node 12345) Warning: Something happened!
// Emit a warning using an object... // Emit a warning using an object...
process.emitWarning('Something Happened!', 'CustomWarning'); process.emitWarning('Something Happened!', 'CustomWarning');
// Prints: (node 12345) CustomWarning: Something happened! // Prints: (node 12345) CustomWarning: Something happened!
// Emit a warning using a custom Error object... // Emit a warning using a custom Error object...
class CustomWarning extends Error { class CustomWarning extends Error {
@ -336,7 +336,7 @@ class CustomWarning extends Error {
} }
const myWarning = new CustomWarning('Something happened!'); const myWarning = new CustomWarning('Something happened!');
process.emitWarning(myWarning); process.emitWarning(myWarning);
// Prints: (node 12345) CustomWarning: Something happened! // Prints: (node 12345) CustomWarning: Something happened!
``` ```
#### Emitting custom deprecation warnings #### Emitting custom deprecation warnings

10
test/.eslintrc.yaml

@ -1,16 +1,6 @@
## Test-specific linter rules ## Test-specific linter rules
rules: rules:
# Stylistic Issues
# http://eslint.org/docs/rules/#stylistic-issues
indent: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first},
MemberExpression: off,
ObjectExpression: first,
SwitchCase: 1}]
indent-legacy: off
# ECMAScript 6 # ECMAScript 6
# http://eslint.org/docs/rules/#ecmascript-6 # http://eslint.org/docs/rules/#ecmascript-6
no-var: 2 no-var: 2

12
tools/.eslintrc.yaml

@ -1,12 +0,0 @@
## Tools-specific linter rules
rules:
# Stylistic Issues
# http://eslint.org/docs/rules/#stylistic-issues
indent: [2, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first},
MemberExpression: off,
ObjectExpression: first,
SwitchCase: 1}]
Loading…
Cancel
Save