Open
Description
It seems that the boolean-prop-naming
rule does not enforce any default config (especially for rule
as the docs mention here)
Sample code:
import * as React from 'react';
import PropTypes from 'prop-types';
class ReactClassComponent extends React.Component {
static propTypes = {
error: PropTypes.bool,
hasError: PropTypes.bool,
isOptional: PropTypes.bool,
optional: PropTypes.bool,
};
render() {
return null;
}
}
Sample eslint configuration:
plugins: ['react'],
rules: {
'react/boolean-prop-naming': ['error'],
},
Running eslint .
gives no errors.
However switching the rule config to ['error', { rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+' }]
will throw linting error for the sample code above.