2016-02-22 23:24:38 +01:00
|
|
|
rules:
|
2018-12-18 02:28:09 +01:00
|
|
|
prefer-object-spread: error
|
2018-03-15 14:22:43 +01:00
|
|
|
no-restricted-syntax:
|
|
|
|
# Config copied from .eslintrc.js
|
|
|
|
- error
|
2018-07-31 01:33:41 +02:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='deepStrictEqual'][arguments.2.type='Literal']"
|
|
|
|
message: "Do not use a literal for the third argument of assert.deepStrictEqual()"
|
2018-03-15 14:22:43 +01:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']"
|
|
|
|
message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
|
2018-04-09 00:12:48 +02:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]"
|
|
|
|
message: "assert.rejects() must be invoked with at least two arguments."
|
2018-07-31 01:33:41 +02:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='strictEqual'][arguments.2.type='Literal']"
|
|
|
|
message: "Do not use a literal for the third argument of assert.strictEqual()"
|
2018-03-15 14:22:43 +01:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])"
|
2018-04-09 00:12:48 +02:00
|
|
|
message: "Use an object as second argument of assert.throws()"
|
2018-03-15 14:22:43 +01:00
|
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]"
|
|
|
|
message: "assert.throws() must be invoked with at least two arguments."
|
|
|
|
- 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."
|
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/buffer-constructor: error
|
|
|
|
node-core/no-let-in-for-declaration: error
|
|
|
|
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
|