From 7584016c12a57fbe7e0a9b76c64e1a437df3b6b5 Mon Sep 17 00:00:00 2001 From: SimeonC <1085899+SimeonC@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:09:40 +0900 Subject: [PATCH] fix: allow `disabled` as a boolean variable name exception Commonly we have boolean props that want to be called `disabled` but according to rules we need to make these `isDisabled` or similar. This is a common conventional name and thus should be allowed. --- packages/eslint-config/src/rules/namingConvention.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config/src/rules/namingConvention.ts b/packages/eslint-config/src/rules/namingConvention.ts index 943c4e5e..596c0e94 100644 --- a/packages/eslint-config/src/rules/namingConvention.ts +++ b/packages/eslint-config/src/rules/namingConvention.ts @@ -54,7 +54,9 @@ export const namingRules: Linter.RulesRecord = { 'will', 'allow', ]; - return `^(${booleanValues.join('|')})|^[a-z]+(${booleanValues + return `^(disabled$|${booleanValues.join( + '|', + )})|^[a-z]+(${booleanValues .map((name) => `${name[0].toUpperCase()}${name.substring(1)}`) .join('|')})`; })(),