react/jsx-boolean-value
eslint-plugin-react
Safe autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-boolean-value": "error",
},
},
];var Hello = <Hello personal={true} />;var Hello = <Hello personal />;var Hello = <Hello personal={false} />;var Hello = <Hello personal />;var Hello = <Hello personal={true} />;var Hello = <Hello />;Examples from the ESLint documentation.
react/jsx-boolean-value
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/jsx-boolean-value": "error",
},
},
];react/jsx-boolean-value
react plugin · style
{
"plugins": [
"react"
],
"rules": {
"react/jsx-boolean-value": "error"
}
}style/noImplicitBoolean
style · since 1.0.0
{
"linter": {
"rules": {
"style": {
"noImplicitBoolean": "error"
}
}
}
}Enforce a specific function type for function components
Enforces where React component static properties should be positioned.
Disallow usage of setState in componentWillUpdate
Enforce ES5 or ES6 class for React Components
Enforce class component state initialization style