eslint-plugin-react-features
React best practices and feature rules.
React Best Practices
Enforce React best practices and feature patterns for maintainable applications.
Install
npm install -D oxlint-plugin-react-features{ "jsPlugins": ["oxlint-plugin-react-features"], "rules": { "react-features/hooks-exhaustive-deps": "warn", "react-features/jsx-key": "error", "react-features/jsx-no-duplicate-props": "error", "react-features/jsx-no-script-url": "error", "react-features/jsx-no-target-blank": "error", "react-features/no-children-prop": "warn", "react-features/no-danger": "warn", "react-features/no-danger-with-children": "error", "react-features/no-deprecated": "warn", "react-features/no-string-refs": "error", "react-features/no-unknown-property": "error" }}import { defineConfig } from 'vite-plus';export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-react-features'], rules: { 'react-features/hooks-exhaustive-deps': 'warn', 'react-features/jsx-key': 'error', 'react-features/jsx-no-duplicate-props': 'error', 'react-features/jsx-no-script-url': 'error', 'react-features/jsx-no-target-blank': 'error', 'react-features/no-children-prop': 'warn', 'react-features/no-danger': 'warn', 'react-features/no-danger-with-children': 'error', 'react-features/no-deprecated': 'warn', 'react-features/no-string-refs': 'error', 'react-features/no-unknown-property': 'error', }, },});oxlint-plugin-react-features re-exports eslint-plugin-react-features/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.
Live from GitHub
This content is fetched directly from README.md on GitHub and cached for 1 hour.
β If this plugin caught a real bug for you, star the repo β it's the signal that keeps these rules maintained.
Description
This plugin provides Advanced React patterns, hook usage, and best practices enforcement.
- Why β a linter nobody reads protects nothing. We would rather miss a finding than spend your attention on one that was never real.
- How β evidence, not names. A rule fires on what the code does, resolved through the AST and ESLint's own scope analysis.
- What β every finding carries its fix, in prose for a human and as structured JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.
That trade costs recall, and we measure it: methodology Β· results Β· a false positive is a bug.
Getting Started
- To check out the guide, visit eslint.interlace.tools. π
oxlint / Vite+ β the same rules under the same react-features/<rule> IDs, without ESLint:
npm install oxlint-plugin-react-features --save-dev// .oxlintrc.json
{ "jsPlugins": ["oxlint-plugin-react-features"] }// vite.config.ts
import { defineConfig } from 'vite-plus';
export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-react-features'] } });ESLint:
npm install eslint-plugin-react-features --save-devβοΈ Configuration Presets
| Preset | Description |
|---|---|
recommended | Recommended React patterns and performance rules |
π¦ Compatibility
| Package | Version |
|---|---|
| ESLint | ^8.40.0 || ^9.0.0 || ^10.0.0 |
| Node.js | >=18.0.0 |
See the ESLint Version Support Policy β current ecosystem share data, the 20% gate, and the forward-looking exception that covers v10.
Rules
Legend
| Icon | Description |
|---|---|
| πΌ | Recommended: Included in the recommended preset. |
| β οΈ | Warns: Set to warn in recommended preset. |
| π§ | Auto-fixable: Automatically fixable by the --fix CLI option. |
| π‘ | Suggestions: Providing code suggestions in IDE. |
| π« | Deprecated: This rule is deprecated. |
| π’ | Type-unaware: AST-only, runs in oxlint JS-plugin tier. |
| π‘ | Type-aware (refining): pure-AST primary path; types refine precision. |
| π | Type-aware (graceful): requires TS program; silent without it. |
| Rule | CWE | OWASP | CVSS | Description | π§ | πΌ | β οΈ | π§ | π‘ | π« |
|---|---|---|---|---|---|---|---|---|---|---|
| checked-requires-onchange-or-readonly | checked-requires-onchange-or-readonly rule | π’ | π‘ | |||||||
| default-props-match-prop-types | default-props-match-prop-types rule | π’ | π‘ | |||||||
| display-name | display-name rule | π’ | π‘ | |||||||
| hooks-exhaustive-deps | hooks-exhaustive-deps rule | π’ | β οΈ | π‘ | ||||||
| jsx-handler-names | jsx-handler-names rule | π’ | π‘ | |||||||
| jsx-key | jsx-key rule | π’ | πΌ | π‘ | ||||||
| jsx-max-depth | jsx-max-depth rule | π’ | π‘ | |||||||
| jsx-no-bind | jsx-no-bind rule | π’ | π‘ | |||||||
| jsx-no-duplicate-props | Prevent duplicate props in JSX elements. This rule is part of eslint-plugin-react-features and provides LLMβ¦ | π’ | πΌ | π‘ | ||||||
| jsx-no-literals | jsx-no-literals rule | π’ | π‘ | |||||||
| jsx-no-script-url | Prevent javascript: URLs in JSX. This rule is part of eslint-plugin-react-features and provides LLM-optimizβ¦ | π’ | πΌ | π‘ | ||||||
| jsx-no-target-blank | Require rel='noopener noreferrer' with target='_blank'. This rule is part of eslint-plugin-react-features aβ¦ | π’ | πΌ | π‘ | ||||||
| no-access-state-in-setstate | no-access-state-in-setstate rule | π’ | π‘ | |||||||
| no-adjacent-inline-elements | no-adjacent-inline-elements rule | π’ | π‘ | |||||||
| no-arbitrary-token-class | π’ | |||||||||
| no-arrow-function-lifecycle | no-arrow-function-lifecycle rule | π’ | π‘ | |||||||
| no-children-prop | no-children-prop rule | π’ | β οΈ | π‘ | ||||||
| no-danger | CWE-79 | no-danger rule | π’ | β οΈ | π‘ | |||||
| no-danger-with-children | Prevent using children and dangerouslySetInnerHTML together. This rule is part of eslint-plugin-react-featuβ¦ | π’ | πΌ | π‘ | ||||||
| no-default-test-id | π’ | |||||||||
| no-deprecated | Warn about using deprecated React APIs. This rule is part of eslint-plugin-react-features and provides LLM-β¦ | π’ | β οΈ | π‘ | ||||||
| no-did-mount-set-state | no-did-mount-set-state rule | π’ | π‘ | |||||||
| no-did-update-set-state | no-did-update-set-state rule | π’ | π‘ | |||||||
| no-direct-mutation-state | no-direct-mutation-state rule | π’ | π‘ | |||||||
| no-find-dom-node | Prevent using findDOMNode. This rule is part of eslint-plugin-react-features and provides LLM-optimized errβ¦ | π’ | π‘ | |||||||
| no-inline-style | π’ | |||||||||
| no-invalid-html-attribute | no-invalid-html-attribute rule | π’ | π‘ | |||||||
| no-is-mounted | no-is-mounted rule | π’ | π‘ | |||||||
| no-is-prefix-prop | π’ | |||||||||
| no-kind-prop-discriminator | π’ | |||||||||
| no-multi-comp | no-multi-comp rule | π’ | π‘ | |||||||
| no-namespace | no-namespace rule | π’ | π‘ | |||||||
| no-object-type-as-default-prop | no-object-type-as-default-prop rule | π’ | π‘ | |||||||
| no-raw-color-literal | π’ | |||||||||
| no-redundant-should-component-update | no-redundant-should-component-update rule | π’ | π‘ | |||||||
| no-render-return-value | no-render-return-value rule | π’ | π‘ | |||||||
| no-set-state | no-set-state rule | π’ | π‘ | |||||||
| no-string-refs | no-string-refs rule | π’ | πΌ | π‘ | ||||||
| no-this-in-sfc | no-this-in-sfc rule | π’ | π‘ | |||||||
| no-typos | no-typos rule | π’ | π‘ | |||||||
| no-unescaped-entities | no-unescaped-entities rule | π’ | π‘ | |||||||
| no-unknown-property | no-unknown-property rule | π’ | πΌ | π‘ | ||||||
| no-unnecessary-rerenders | no-unnecessary-rerenders rule | π’ | π‘ | |||||||
| no-unsafe | Warn about UNSAFE_ lifecycle methods. This rule is part of eslint-plugin-react-features and provides LLM-opβ¦ | π’ | π‘ | |||||||
| no-wrapper-sub-component | π’ | |||||||||
| prefer-es6-class | prefer-es6-class rule | π’ | π‘ | |||||||
| prefer-stateless-function | prefer-stateless-function rule | π’ | π‘ | |||||||
| prop-types | prop-types rule | π’ | π‘ | |||||||
| react-class-to-hooks | react-class-to-hooks rule | π’ | π‘ | |||||||
| react-in-jsx-scope | react-in-jsx-scope rule | π’ | π‘ | |||||||
| react-no-inline-functions | react-no-inline-functions rule | π’ | π‘ | |||||||
| react-render-optimization | react-render-optimization rule | π’ | π‘ | |||||||
| require-data-slot | π’ | |||||||||
| require-default-props | require-default-props rule | π’ | π‘ | |||||||
| require-optimization | require-optimization rule | π’ | π‘ | |||||||
| require-render-return | require-render-return rule | π’ | π‘ | |||||||
| required-attributes | required-attributes rule | π’ | π‘ | |||||||
| sort-comp | sort-comp rule | π’ | π‘ | |||||||
| state-in-constructor | state-in-constructor rule | π’ | π‘ | |||||||
| static-property-placement | static-property-placement rule | π’ | π‘ | |||||||
| void-dom-elements-no-children | Prevent void DOM elements from receiving children. This rule is part of eslint-plugin-react-features and prβ¦ | π’ | π‘ |
π Related ESLint Plugins
Part of the Interlace ESLint ecosystem β AI-native rules with LLM-optimized error messages:
Security
Code quality
| Plugin | Downloads | Description |
|---|---|---|
eslint-plugin-cli-floor | CLI floor for commander, yargs and burgee. | |
eslint-plugin-conventions | Team-specific habits and styles. | |
eslint-plugin-import-next | Fast cycle + import-graph analysis. | |
eslint-plugin-maintainability | Cognitive load and clean-code patterns. | |
eslint-plugin-modernization | ESNext migration + syntax evolution. | |
eslint-plugin-modularity | Structural integrity and DDD patterns. | |
eslint-plugin-operability | Production readiness and resource health. | |
eslint-plugin-react-a11y | React accessibility / WCAG. | |
eslint-plugin-reliability | Runtime stability and error safety. |
β Support & follow
If this plugin caught a real bug for you, star the repo β stars are the signal that keeps the Interlace ESLint ecosystem maintained β and follow the writeups on Dev.to for the benchmarks and security research behind these rules.
π License
MIT Β© Ofri Peretz
View README.md on GitHub β
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.