From cdd7d3a66d2720a7221667b04fd36fea7a3dbe82 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 9 Mar 2020 21:56:04 +0100 Subject: [PATCH] tools: remove obsolete no-restricted-syntax eslint rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These rules only apply for the test folder and will already be checked for. PR-URL: https://github.com/nodejs/node/pull/32161 Refs: https://github.com/nodejs/node/pull/32078 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Juan José Arboleda Reviewed-By: Michaël Zasso --- .eslintrc.js | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ba94036b0f50bc..14c53277a19a47 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -189,34 +189,6 @@ module.exports = { // as well to lib/.eslintrc.yaml. 'no-restricted-syntax': [ 'error', - { - selector: "CallExpression[callee.property.name='deepStrictEqual'][arguments.2.type='Literal']", - message: 'Do not use a literal for the third argument of assert.deepStrictEqual()', - }, - { - selector: "CallExpression[callee.property.name='doesNotThrow']", - message: 'Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead.', - }, - { - selector: "CallExpression[callee.property.name='doesNotReject']", - message: 'Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead.', - }, - { - selector: "CallExpression[callee.property.name='rejects'][arguments.length<2]", - message: '`assert.rejects()` must be invoked with at least two arguments.', - }, - { - selector: "CallExpression[callee.property.name='strictEqual'][arguments.2.type='Literal']", - message: 'Do not use a literal for the third argument of assert.strictEqual()', - }, - { - selector: "CallExpression[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.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.', @@ -229,22 +201,6 @@ module.exports = { selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]', message: 'Use `new` keyword when throwing an `Error`.', }, - { - selector: "CallExpression[callee.property.name='notDeepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])", - message: 'The first argument should be the `actual`, not the `expected` value.', - }, - { - selector: "CallExpression[callee.property.name='notStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])", - message: 'The first argument should be the `actual`, not the `expected` value.', - }, - { - selector: "CallExpression[callee.property.name='deepStrictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])", - message: 'The first argument should be the `actual`, not the `expected` value.', - }, - { - selector: "CallExpression[callee.property.name='strictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])", - message: 'The first argument should be the `actual`, not the `expected` value.', - }, { selector: "CallExpression[callee.name='isNaN']", message: 'Use Number.isNaN() instead of the global isNaN() function.',