0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 12:10:08 +01:00
nodejs/tools/eslint-rules
Leko cef144421c tools: add new ESLint rule: prefer-primordials
I added a new custom ESLint rule to fix these problems.

We have a lot of replaceable codes with primordials.
Accessing built-in objects is restricted by existing rule
(no-restricted-globals), but accessing property in the built-in objects
is not restricted right now. We manually review codes that can be
replaced by primordials, but there's a lot of code that actually needs
to be fixed. We have often made pull requests to replace the primordials
with.

Restrict accessing global built-in objects such as `Promise`.
Restrict calling static methods such as `Array.from` or `Symbol.for`.
Don't restrict prototype methods to prevent false-positive.

PR-URL: https://github.com/nodejs/node/pull/35448
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2020-11-07 18:28:14 +08:00
..
alphabetize-errors.js
async-iife-no-unused-result.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
crypto-check.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
documented-errors.js
eslint-check.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
inspector-check.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
lowercase-name-for-primitive.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
no-duplicate-requires.js
no-unescaped-regexp-dot.js
non-ascii-character.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
prefer-assert-iferror.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
prefer-assert-methods.js tools: add meta.fixable to fixable lint rules 2020-08-03 08:48:32 -04:00
prefer-common-mustnotcall.js
prefer-common-mustsucceed.js test: add common.mustSucceed 2020-10-17 00:48:26 +02:00
prefer-primordials.js tools: add new ESLint rule: prefer-primordials 2020-11-07 18:28:14 +08:00
prefer-util-format-errors.js
require-common-first.js
required-modules.js
rules-utils.js