tools: eslint - use error and off

PR-URL: https://github.com/nodejs/node/pull/14061
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Refael Ackermann 2017-07-03 12:51:45 -04:00
parent 8520e6f280
commit 46d7cb88c7
No known key found for this signature in database
GPG Key ID: CD704BD80FDDDB64
6 changed files with 138 additions and 138 deletions

View File

@ -13,39 +13,39 @@ parserOptions:
rules: rules:
# Possible Errors # Possible Errors
# http://eslint.org/docs/rules/#possible-errors # http://eslint.org/docs/rules/#possible-errors
no-control-regex: 2 no-control-regex: error
no-debugger: 2 no-debugger: error
no-dupe-args: 2 no-dupe-args: error
no-dupe-keys: 2 no-dupe-keys: error
no-duplicate-case: 2 no-duplicate-case: error
no-empty-character-class: 2 no-empty-character-class: error
no-ex-assign: 2 no-ex-assign: error
no-extra-boolean-cast: 2 no-extra-boolean-cast: error
no-extra-parens: [2, functions] no-extra-parens: [error, functions]
no-extra-semi: 2 no-extra-semi: error
no-func-assign: 2 no-func-assign: error
no-invalid-regexp: 2 no-invalid-regexp: error
no-irregular-whitespace: 2 no-irregular-whitespace: error
no-obj-calls: 2 no-obj-calls: error
no-template-curly-in-string: 2 no-template-curly-in-string: error
no-unexpected-multiline: 2 no-unexpected-multiline: error
no-unreachable: 2 no-unreachable: error
no-unsafe-negation: 2 no-unsafe-negation: error
use-isnan: 2 use-isnan: error
valid-typeof: 2 valid-typeof: error
# Best Practices # Best Practices
# http://eslint.org/docs/rules/#best-practices # http://eslint.org/docs/rules/#best-practices
dot-location: [2, property] dot-location: [error, property]
eqeqeq: [2, smart] eqeqeq: [error, smart]
no-fallthrough: 2 no-fallthrough: error
no-global-assign: 2 no-global-assign: error
no-multi-spaces: [2, {ignoreEOLComments: true}] no-multi-spaces: [error, {ignoreEOLComments: true}]
no-octal: 2 no-octal: error
no-proto: 2 no-proto: error
no-redeclare: 2 no-redeclare: error
no-restricted-properties: no-restricted-properties:
- 2 - error
- object: assert - object: assert
property: deepEqual property: deepEqual
message: Use assert.deepStrictEqual(). message: Use assert.deepStrictEqual().
@ -59,71 +59,71 @@ rules:
message: __defineGetter__ is deprecated. message: __defineGetter__ is deprecated.
- property: __defineSetter__ - property: __defineSetter__
message: __defineSetter__ is deprecated. message: __defineSetter__ is deprecated.
no-self-assign: 2 no-self-assign: error
no-throw-literal: 2 no-throw-literal: error
no-unused-labels: 2 no-unused-labels: error
no-useless-call: 2 no-useless-call: error
no-useless-concat: 2 no-useless-concat: error
no-useless-escape: 2 no-useless-escape: error
no-useless-return: 2 no-useless-return: error
no-void: 2 no-void: error
no-with: 2 no-with: error
# Strict Mode # Strict Mode
# http://eslint.org/docs/rules/#strict-mode # http://eslint.org/docs/rules/#strict-mode
strict: [2, global] strict: [error, global]
# Variables # Variables
# http://eslint.org/docs/rules/#variables # http://eslint.org/docs/rules/#variables
no-delete-var: 2 no-delete-var: error
no-undef: 2 no-undef: error
no-unused-vars: [2, {args: none}] no-unused-vars: [error, {args: none}]
no-use-before-define: [2, {classes: true, no-use-before-define: [error, {classes: true,
functions: false, functions: false,
variables: false}] variables: false}]
# Node.js and CommonJS # Node.js and CommonJS
# http://eslint.org/docs/rules/#nodejs-and-commonjs # http://eslint.org/docs/rules/#nodejs-and-commonjs
no-mixed-requires: 2 no-mixed-requires: error
no-new-require: 2 no-new-require: error
no-path-concat: 2 no-path-concat: error
no-restricted-modules: [2, sys] no-restricted-modules: [error, sys]
# Stylistic Issues # Stylistic Issues
# http://eslint.org/docs/rules/#stylistic-issues # http://eslint.org/docs/rules/#stylistic-issues
block-spacing: 2 block-spacing: error
brace-style: [2, 1tbs, {allowSingleLine: true}] brace-style: [error, 1tbs, {allowSingleLine: true}]
comma-dangle: [2, only-multiline] comma-dangle: [error, only-multiline]
comma-spacing: 2 comma-spacing: error
comma-style: 2 comma-style: error
computed-property-spacing: 2 computed-property-spacing: error
eol-last: 2 eol-last: error
func-call-spacing: 2 func-call-spacing: error
func-name-matching: 2 func-name-matching: error
func-style: [2, declaration, {allowArrowFunctions: true}] func-style: [error, declaration, {allowArrowFunctions: true}]
# indent: [2, 2, {ArrayExpression: first, # indent: [error, error, {ArrayExpression: first,
# CallExpression: {arguments: first}, # CallExpression: {arguments: first},
# FunctionDeclaration: {parameters: first}, # FunctionDeclaration: {parameters: first},
# FunctionExpression: {parameters: first}, # FunctionExpression: {parameters: first},
# MemberExpression: off, # MemberExpression: off,
# ObjectExpression: first, # ObjectExpression: first,
# SwitchCase: 1}] # SwitchCase: 1}]
indent-legacy: [2, 2, {ArrayExpression: first, indent-legacy: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first}, CallExpression: {arguments: first},
MemberExpression: 1, MemberExpression: 1,
ObjectExpression: first, ObjectExpression: first,
SwitchCase: 1}] SwitchCase: 1}]
key-spacing: [2, {mode: minimum}] key-spacing: [error, {mode: minimum}]
keyword-spacing: 2 keyword-spacing: error
linebreak-style: [2, unix] linebreak-style: [error, unix]
max-len: [2, {code: 80, max-len: [error, {code: 80,
ignoreRegExpLiterals: true, ignoreRegExpLiterals: true,
ignoreUrls: true, ignoreUrls: true,
tabWidth: 2}] tabWidth: 2}]
new-parens: 2 new-parens: error
no-mixed-spaces-and-tabs: 2 no-mixed-spaces-and-tabs: error
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}] no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}]
no-restricted-syntax: [2, { no-restricted-syntax: [error, {
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]", selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
message: "setTimeout() must be invoked with at least two arguments." message: "setTimeout() must be invoked with at least two arguments."
}, { }, {
@ -133,43 +133,43 @@ rules:
selector: "ThrowStatement > CallExpression[callee.name=/Error$/]", selector: "ThrowStatement > CallExpression[callee.name=/Error$/]",
message: "Use new keyword when throwing an Error." message: "Use new keyword when throwing an Error."
}] }]
no-tabs: 2 no-tabs: error
no-trailing-spaces: 2 no-trailing-spaces: error
one-var-declaration-per-line: 2 one-var-declaration-per-line: error
operator-linebreak: [2, after] operator-linebreak: [error, after]
quotes: [2, single, avoid-escape] quotes: [error, single, avoid-escape]
semi: 2 semi: error
semi-spacing: 2 semi-spacing: error
space-before-blocks: [2, always] space-before-blocks: [error, always]
space-before-function-paren: [2, { space-before-function-paren: [error, {
"anonymous": "never", "anonymous": "never",
"named": "never", "named": "never",
"asyncArrow": "always" "asyncArrow": "always"
}] }]
space-in-parens: [2, never] space-in-parens: [error, never]
space-infix-ops: 2 space-infix-ops: error
space-unary-ops: 2 space-unary-ops: error
unicode-bom: 2 unicode-bom: error
# ECMAScript 6 # ECMAScript 6
# http://eslint.org/docs/rules/#ecmascript-6 # http://eslint.org/docs/rules/#ecmascript-6
arrow-parens: [2, always] arrow-parens: [error, always]
arrow-spacing: [2, {before: true, after: true}] arrow-spacing: [error, {before: true, after: true}]
constructor-super: 2 constructor-super: error
no-class-assign: 2 no-class-assign: error
no-confusing-arrow: 2 no-confusing-arrow: error
no-const-assign: 2 no-const-assign: error
no-dupe-class-members: 2 no-dupe-class-members: error
no-new-symbol: 2 no-new-symbol: error
no-this-before-super: 2 no-this-before-super: error
prefer-const: [2, {ignoreReadBeforeAssign: true}] prefer-const: [error, {ignoreReadBeforeAssign: true}]
rest-spread-spacing: 2 rest-spread-spacing: error
template-curly-spacing: 2 template-curly-spacing: error
# Custom rules in tools/eslint-rules # Custom rules in tools/eslint-rules
align-multiline-assignment: 2 align-multiline-assignment: error
assert-throws-arguments: [2, { requireTwo: true }] assert-throws-arguments: [error, { requireTwo: true }]
no-unescaped-regexp-dot: 2 no-unescaped-regexp-dot: error
# Global scoped method and vars # Global scoped method and vars
globals: globals:

View File

@ -3,11 +3,11 @@
rules: rules:
# Stylistic Issues # Stylistic Issues
# http://eslint.org/docs/rules/#stylistic-issues # http://eslint.org/docs/rules/#stylistic-issues
indent: [2, 2, {ArrayExpression: first, indent: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first}, CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first}, FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first}, FunctionExpression: {parameters: first},
MemberExpression: off, MemberExpression: off,
ObjectExpression: first, ObjectExpression: first,
SwitchCase: 1}] SwitchCase: 1}]
indent-legacy: 0 indent-legacy: off

View File

@ -1,22 +1,22 @@
## Docs-specific linter rules ## Docs-specific linter rules
rules: rules:
object-curly-spacing: [2, always] object-curly-spacing: [error, always]
# ease some restrictions in doc examples # ease some restrictions in doc examples
no-restricted-properties: 0 no-restricted-properties: off
no-undef: 0 no-undef: off
no-unused-vars: 0 no-unused-vars: off
strict: 0 strict: off
# add new ECMAScript features gradually # add new ECMAScript features gradually
no-var: 2 no-var: error
prefer-const: 2 prefer-const: error
prefer-rest-params: 2 prefer-rest-params: error
# use stricter indent over indent-legacy # use stricter indent over indent-legacy
indent-legacy: 0 indent-legacy: off
indent: [2, 2, {ArrayExpression: first, indent: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first}, CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first}, FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first}, FunctionExpression: {parameters: first},

View File

@ -1,5 +1,5 @@
rules: rules:
# Custom rules in tools/eslint-rules # Custom rules in tools/eslint-rules
require-buffer: 2 require-buffer: error
buffer-constructor: 2 buffer-constructor: error
no-let-in-for-declaration: 2 no-let-in-for-declaration: error

View File

@ -3,12 +3,12 @@
rules: rules:
# ECMAScript 6 # ECMAScript 6
# http://eslint.org/docs/rules/#ecmascript-6 # http://eslint.org/docs/rules/#ecmascript-6
no-var: 2 no-var: error
prefer-const: 2 prefer-const: error
# Custom rules in tools/eslint-rules # Custom rules in tools/eslint-rules
prefer-assert-iferror: 2 prefer-assert-iferror: error
prefer-assert-methods: 2 prefer-assert-methods: error
prefer-common-mustnotcall: 2 prefer-common-mustnotcall: error
## common module is mandatory in tests ## common module is mandatory in tests
required-modules: [2, common] required-modules: [error, common]

View File

@ -3,11 +3,11 @@
rules: rules:
# Stylistic Issues # Stylistic Issues
# http://eslint.org/docs/rules/#stylistic-issues # http://eslint.org/docs/rules/#stylistic-issues
indent: [2, 2, {ArrayExpression: first, indent: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first}, CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first}, FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first}, FunctionExpression: {parameters: first},
MemberExpression: off, MemberExpression: off,
ObjectExpression: first, ObjectExpression: first,
SwitchCase: 1}] SwitchCase: 1}]
indent-legacy: 0 indent-legacy: off