react/boolean-prop-naming
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/boolean-prop-naming": "error",
},
},
];var Hello = createReactClass({
propTypes: {
enabled: PropTypes.bool
},
render: function() { return <div />; };
});type Props = {
enabled: boolean
}
const Hello = (props: Props) => <div />;var Hello = createReactClass({
propTypes: {
isEnabled: PropTypes.bool
},
render: function() { return <div />; };
});type Props = {
isEnabled: boolean
}
const Hello = (props: Props) => <div />Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
react/boolean-prop-naming
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/boolean-prop-naming": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
Require or prevent a new line after jsx elements and expressions.
Disallow adjacent inline elements not separated by whitespace.
Enforce React components to have a shouldComponentUpdate method