mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
ad10cc57ee
This rule is no longer needed. ESLint's built in no-buffer-constructor rule is enabled instead. PR-URL: https://github.com/nodejs/node/pull/25261 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
49 lines
2.4 KiB
YAML
49 lines
2.4 KiB
YAML
rules:
|
|
prefer-object-spread: error
|
|
no-buffer-constructor: error
|
|
no-restricted-syntax:
|
|
# Config copied from .eslintrc.js
|
|
- error
|
|
- 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()"
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']"
|
|
message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]"
|
|
message: "assert.rejects() must be invoked with at least two arguments."
|
|
- 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()"
|
|
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])"
|
|
message: "Use an object as second argument of assert.throws()"
|
|
- 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."
|
|
# Custom rules in tools/eslint-rules
|
|
node-core/require-globals: error
|
|
node-core/no-let-in-for-declaration: error
|
|
node-core/lowercase-name-for-primitive: error
|
|
node-core/non-ascii-character: error
|
|
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
|
|
internalBinding: false
|