Skip to content

React

Use React support from the lean v3 composer. Install the @santi020k/eslint-config-react package.

bash
pnpm add -D @santi020k/eslint-config-basic @santi020k/eslint-config-react eslint
import { defineConfig } from '@santi020k/eslint-config-basic'
export default await defineConfig({
frameworks: {
react: true
},
typescript: true
})

With the required config packages installed, the one-line recommended entry auto-detects the framework; custom configs can use defineConfig() without a frameworks object.

  • React component and Hooks rules.
  • Composition through the same @santi020k/eslint-config-basic entry point as every other framework.
  • Compatibility with advanced overrides if you pass a custom config array or factory instead of true.
  • This framework package is a public, optional dependency in v3; the basic composer loads it only when enabled.

  • @eslint-react/no-nested-component-definitions has no component-slot option. Hoist a slot component when it does not need owner state. If a library API requires an inline component map that intentionally captures that state, keep the exception to the adapter file instead of disabling the rule for the application:

    export default await defineConfig({}, {
    files: ['src/components/ui/calendar.tsx'],
    rules: {
    '@eslint-react/no-nested-component-definitions': 'off'
    }
    })
  • For the archived v1 setup, see the v1 React guide.

Did this page help?

Your answer stays in this browser. Share details on GitHub to help improve the docs.