Skip to content

New boolean-prop-naming rule for enforcing the naming of booleans#1264

Merged
lencioni merged 1 commit intojsx-eslint:masterfrom
EvHaus:boolean-prop-naming
Jun 27, 2017
Merged

New boolean-prop-naming rule for enforcing the naming of booleans#1264
lencioni merged 1 commit intojsx-eslint:masterfrom
EvHaus:boolean-prop-naming

Conversation

@EvHaus
Copy link
Copy Markdown
Collaborator

@EvHaus EvHaus commented Jun 19, 2017

At my workplace, we prefer to name our boolean props as "isSomething" or "hasWhatever". This is an ESLint rule which allows devs to specify a Regex pattern for how they want their boolean props named.

Tested with createReactClass, ES6 components, stateless components and Flowtype.

I support, in the future, this rule can be expanded to support naming rules for ANY props, but that felt like overkill for the time being. Hopefully this rule will be useful as is.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants