feat: ban new Array (#209)

This commit is contained in:
曾明健 2023-07-04 16:52:53 +08:00 committed by GitHub
parent d4a9ebcc17
commit be5bc8009c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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',