@octoguild/eslint-config-react
v2.0.2
Published
`npm i @octoguild/eslint-config-react -D`
Readme
Install
npm i @octoguild/eslint-config-react -D
or
yarn add @octoguild/eslint-config-react --dev
Usage (ESLint 9 flat config)
This package is ESM ("type": "module"). The default export is a flat config array (includes pragma-auto rules).
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@octoguild/eslint-config-react'
const tsconfigRootDir = path.dirname(fileURLToPath(import.meta.url))
export default [
...react,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir,
},
},
},
]Pragma presets
- Default (
@octoguild/eslint-config-react) — pragma-auto:@emotion/jsx-importoff,react/no-unknown-propertyignorescss. @octoguild/eslint-config-react/pragma-manual— ESM module that default-exports arulesobject (@emotion/jsx-import: error). Import it and add{ rules: … }to your flat config when you want manual pragma instead of the default; you will usually mirrorreact/index.jsbut swap the pragma-auto import for pragma-manual.
