From e6985f259fb97a06360ac8df42c8456785b8b8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Fri, 3 May 2024 12:17:31 +0900 Subject: [PATCH] fix: disable some unicron rules --- src/configs/unicorn.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/configs/unicorn.ts b/src/configs/unicorn.ts index e7d8e57..f15dd20 100644 --- a/src/configs/unicorn.ts +++ b/src/configs/unicorn.ts @@ -12,7 +12,8 @@ export const unicorn: FlatESLintConfigItem[] = [ 'unicorn/custom-error-definition': 'error', 'unicorn/error-message': 'error', 'unicorn/escape-case': 'error', - 'unicorn/explicit-length-check': 'error', + // disabled for better bundle size + // 'unicorn/explicit-length-check': 'error', 'unicorn/filename-case': [ 'error', { @@ -21,7 +22,8 @@ export const unicorn: FlatESLintConfigItem[] = [ }, ], 'unicorn/new-for-builtins': 'error', - 'unicorn/no-array-callback-reference': 'error', + // disabled for better bundle size + // 'unicorn/no-array-callback-reference': 'error', 'unicorn/no-array-method-this-argument': 'error', 'unicorn/no-array-push-push': 'error', 'unicorn/no-await-in-promise-methods': 'error', @@ -66,7 +68,8 @@ export const unicorn: FlatESLintConfigItem[] = [ 'unicorn/prefer-string-slice': 'error', 'unicorn/prefer-string-starts-ends-with': 'error', 'unicorn/prefer-string-trim-start-end': 'error', - 'unicorn/prefer-top-level-await': 'error', + // top level await is not supported in all environments + // 'unicorn/prefer-top-level-await': 'error', 'unicorn/prefer-type-error': 'error', 'unicorn/throw-new-error': 'error', },