Skip to content

Commit

Permalink
fix(eslint): boolean prop naming (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensacks authored May 7, 2020
1 parent d923c25 commit a1f672c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ module.exports = {
// Requiring true to be set as the value will help future-proof our code.
'react/jsx-boolean-value': ['error', 'always'],

// Expand the acceptable boolean names to include
// "is", "has", "can", "show" and "hide", as well as "show" and "hide" on their own
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
'react/boolean-prop-naming': [
'error',
{
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^((is|has|can|show|hide)[A-Z]([A-Za-z0-9]?)+|(show|hide))',
},
],

// don't require trailing commas for multi-line function calls
// airbnb config assumes you're transpiling with https://npmjs.com/babel-preset-airbnb
// which includes trailing function commas.
Expand Down

0 comments on commit a1f672c

Please sign in to comment.