Skip to content

Commit

Permalink
fix: allow disabled as a boolean variable name exception
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SimeonC committed Nov 30, 2023
1 parent 753e18d commit 7584016
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/eslint-config/src/rules/namingConvention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('|')})`;
})(),
Expand Down

0 comments on commit 7584016

Please sign in to comment.