Skip to content

react

React components: the recommended React and hooks rules as errors, and react-refresh rules, so Fast Refresh keeps component state. It requires javascript. Guide: React.

A scope has a dependency on react. Also when nextjs, react-dom, or react-native requires it.

Lint rules Files Why
gspot/no-trivial-functions **/*.tsx, **/*.jsx A short component is normal React code, even alone in its file.
@eslint-react/error-boundaries, @eslint-react/exhaustive-deps, @eslint-react/purity, @eslint-react/rules-of-hooks, @eslint-react/set-state-in-effect, @eslint-react/set-state-in-render, @eslint-react/static-components, @eslint-react/unsupported-syntax, @eslint-react/use-memo All files in the scope eslint-plugin-react-hooks reports the same hook mistakes under its react-hooks/ names.
Setting Value
javascript.import_extension "extensionless"
Rule file Installed when
.gspot/rules/REACT.md Always
Tool Version
eslint-plugin-react-hooks 7.1.1
@eslint-react/eslint-plugin 5.28.0
eslint-plugin-react-refresh 0.5.7