Rules
All ESLint rules provided by eslint-plugin-react-features
51 Rules Available
React best practices and feature rules.
All Rules
| Rule | 🧠 | 💼 | 🔧 | 💡 | ⚠️ | Docs |
|---|---|---|---|---|---|---|
| checked-requires-onchange-or-readonly Ensure controlled inputs have onChange or readOnly | 🟢 | |||||
| default-props-match-prop-types Validate default props match prop types | 🟢 | |||||
| display-name Enforce component display names | 🟢 | |||||
| hooks-exhaustive-deps Enforce exhaustive dependencies in React hooks to prevent stale closures | 🟢 | |||||
| jsx-handler-names Enforce event handler naming conventions | 🟢 | |||||
| jsx-key Detect missing or problematic React keys that could break reconciliation | 🟢 | |||||
| jsx-max-depth Limit JSX nesting depth | 🟢 | |||||
| jsx-no-bind Prevent .bind() in JSX | 🟢 | |||||
| jsx-no-duplicate-props Prevent duplicate props in JSX | 🟢 | |||||
| jsx-no-literals Prevent string literals in JSX | 🟢 | |||||
| jsx-no-script-url Forbid javascript: URLs | 🟢 | |||||
| jsx-no-target-blank Forbid target="_blank" without rel="noopener noreferrer" | 🟢 | |||||
| no-access-state-in-setstate Disallow accessing this.state inside setState calls | 🟢 | |||||
| no-adjacent-inline-elements Prevent adjacent inline elements | 🟢 | |||||
| no-arbitrary-token-class No Tailwind arbitrary values when a token exists for that property (R19) | 🟢 | |||||
| no-arrow-function-lifecycle Prevent arrow functions in lifecycle methods | 🟢 | |||||
| no-children-prop Disallow passing children as props | 🟢 | |||||
| no-danger Disallow dangerouslySetInnerHTML usage | 🟢 | |||||
| no-danger-with-children Prevent using both children and dangerouslySetInnerHTML | 🟢 | |||||
| no-default-test-id data-testid must be consumer-provided — no runtime default value (R5) | 🟢 | |||||
| no-deprecated Prevent using deprecated React methods | 🟢 | |||||
| no-did-mount-set-state Prevent setState in componentDidMount | 🟢 | |||||
| no-did-update-set-state Prevent setState in componentDidUpdate | 🟢 | |||||
| no-direct-mutation-state Prevent direct mutation of this.state that breaks React reconciliation | 🟢 | |||||
| no-find-dom-node Prevent using findDOMNode | 🟢 | |||||
| no-inline-style No inline `style={{}}` except for CSS-variable assignment (R18) | 🟢 | |||||
| no-invalid-html-attribute Prevent invalid HTML attributes | 🟢 | |||||
| no-is-mounted Prevent isMounted anti-pattern | 🟢 | |||||
| no-is-prefix-prop Boolean props must not be prefixed with `is` (R8) | 🟢 | |||||
| no-kind-prop-discriminator Ban `type`/`kind` string-union props that select between rendered trees (R11) | 🟢 | |||||
| no-multi-comp Prevent multiple components per file | 🟢 | |||||
| no-namespace Prevent namespace imports | 🟢 | |||||
| no-object-type-as-default-prop Prevent object types as default props | 🟢 | |||||
| no-raw-color-literal No raw hex / rgb / hsl / oklch color literals in source — use design tokens (R19) | 🟢 | |||||
| no-redundant-should-component-update Prevent redundant shouldComponentUpdate | 🟢 | |||||
| no-render-return-value Prevent using render return value | 🟢 | |||||
| no-set-state Disallow usage of setState to encourage functional components with hooks | 🟢 | |||||
| no-string-refs Disallow string refs | 🟢 | |||||
| no-this-in-sfc Disallow this from being used in stateless functional components | 🟢 | |||||
| no-typos Catch common typos | 🟢 | |||||
| no-unescaped-entities Prevent unescaped entities | 🟢 | |||||
| no-unknown-property Disallow unknown DOM properties | 🟢 | |||||
| no-unnecessary-rerenders Detects prevented re-renders in React | 🟢 | |||||
| no-unsafe Prevent usage of unsafe lifecycle methods | 🟢 | |||||
| no-wrapper-sub-component Ban pure-passthrough wrapper sub-components — slot the primitive directly (R12) | 🟢 | |||||
| prefer-es6-class Prefer ES6 classes over createClass | 🟢 | |||||
| prefer-stateless-function Prefer stateless functions | 🟢 | |||||
| prop-types Enforce prop types usage | 🟢 | |||||
| react-class-to-hooks Suggest migrating React class components to hooks with detailed migration path | 🟢 | |||||
| react-in-jsx-scope Ensure React is in scope | 🟢 | |||||
| react-no-inline-functions Prevent inline functions in React renders with performance metrics | 🟢 | |||||
| react-render-optimization Detects unnecessary re-renders and expensive computations in React | 🟢 | |||||
| require-data-slot Named composition parts must carry data-slot (R6) | 🟢 | |||||
| require-default-props Require default props | 🟢 | |||||
| require-optimization Require performance optimizations for React components based on usage patterns | 🟢 | |||||
| require-render-return Require render methods to return | 🟢 | |||||
| required-attributes Enforce required attributes on React components with customizable ignore lists | 🟢 | |||||
| sort-comp Enforce component method ordering | 🟢 | |||||
| state-in-constructor Enforce state initialization in constructor | 🟢 | |||||
| static-property-placement Enforce static property placement | 🟢 | |||||
| void-dom-elements-no-children Prevent void DOM elements from having children | 🟢 |
Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.