2016-02-22 23:24:38 +01:00
|
|
|
rules:
|
2018-12-18 02:28:09 +01:00
|
|
|
prefer-object-spread: error
|
2018-12-29 00:04:00 +01:00
|
|
|
no-buffer-constructor: error
|
2019-03-31 13:30:12 +02:00
|
|
|
no-restricted-globals: ["error", "JSON", "Math", "Reflect"]
|
2018-03-15 14:22:43 +01:00
|
|
|
no-restricted-syntax:
|
|
|
|
# Config copied from .eslintrc.js
|
|
|
|
- error
|
2019-03-10 15:37:51 +01:00
|
|
|
- selector: "CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])"
|
|
|
|
message: "Please only use simple assertions in ./lib"
|
2018-03-15 14:22:43 +01:00
|
|
|
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]"
|
|
|
|
message: "setTimeout() must be invoked with at least two arguments."
|
|
|
|
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
|
|
|
|
message: "setInterval() must be invoked with at least 2 arguments."
|
|
|
|
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"
|
|
|
|
message: "Use new keyword when throwing an Error."
|
|
|
|
# Config specific to lib
|
|
|
|
- selector: "NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError)$/])"
|
|
|
|
message: "Use an error exported by the internal/errors module."
|
2019-03-18 03:47:55 +01:00
|
|
|
- selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']"
|
|
|
|
message: "Please use `require('internal/errors').hideStackFrames()` instead."
|
2016-02-22 23:24:38 +01:00
|
|
|
# Custom rules in tools/eslint-rules
|
2018-05-07 02:18:23 +02:00
|
|
|
node-core/require-globals: error
|
2018-02-04 20:38:18 +01:00
|
|
|
node-core/lowercase-name-for-primitive: error
|
|
|
|
node-core/non-ascii-character: error
|
2018-03-02 04:04:59 +01:00
|
|
|
globals:
|
|
|
|
CHECK: false
|
|
|
|
CHECK_EQ: false
|
|
|
|
CHECK_GE: false
|
|
|
|
CHECK_GT: false
|
|
|
|
CHECK_LE: false
|
|
|
|
CHECK_LT: false
|
|
|
|
CHECK_NE: false
|
|
|
|
DCHECK: false
|
|
|
|
DCHECK_EQ: false
|
|
|
|
DCHECK_GE: false
|
|
|
|
DCHECK_GT: false
|
|
|
|
DCHECK_LE: false
|
|
|
|
DCHECK_LT: false
|
|
|
|
DCHECK_NE: false
|
2018-09-22 16:49:52 +02:00
|
|
|
internalBinding: false
|
2019-01-30 15:21:07 +01:00
|
|
|
primordials: false
|