From be5bc8009ccafc426c8e2a688d87f41e12709664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=98=8E=E5=81=A5?= Date: Tue, 4 Jul 2023 16:52:53 +0800 Subject: [PATCH] feat: ban `new Array` (#209) --- packages/eslint-config-basic/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/eslint-config-basic/index.js b/packages/eslint-config-basic/index.js index 69d5d1d..fbfbf2c 100644 --- a/packages/eslint-config-basic/index.js +++ b/packages/eslint-config-basic/index.js @@ -368,6 +368,8 @@ module.exports = { 'unicorn/prefer-node-protocol': 'error', // Prefer using number properties like `Number.isNaN` rather than `isNaN` 'unicorn/prefer-number-properties': 'error', + // Ban `new Array` as `Array` constructor's params are ambiguous + 'unicorn/no-new-array': 'error', 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }], 'eslint-comments/disable-enable-pair': 'off',