@dyrkow/eslint-config-react
v1.1.0
Published
React eslint configuration
Maintainers
Readme
@dyrkow/eslint-config-react
ESLint config for React: eslint-plugin-react, eslint-plugin-react-hooks, JSX rules. Prettier-compatible (extends eslint-config-prettier).
Installation
Install the base config and this package. The base is required (peerDependency) and must be listed first in extends. You do not need to install eslint or plugins separately — they come from the base.
pnpm add -D @dyrkow/eslint-config @dyrkow/eslint-config-react
# or: yarn add @dyrkow/eslint-config @dyrkow/eslint-config-react -D
# or: npm i -D @dyrkow/eslint-config @dyrkow/eslint-config-reactConfiguration
Add to .eslintrc.json and extend after the base config. Use this order so formatting is handled by Prettier and conflicts are avoided:
@dyrkow/eslint-config(base, always first)@dyrkow/eslint-config-typescript(if using TypeScript)@dyrkow/eslint-config-react(if using React)@dyrkow/eslint-config-react-native(if using React Native)
Example for React only:
{
"extends": [
"@dyrkow/eslint-config",
"@dyrkow/eslint-config-react"
]
}Example for TypeScript + React:
{
"extends": [
"@dyrkow/eslint-config",
"@dyrkow/eslint-config-typescript",
"@dyrkow/eslint-config-react"
]
}Example for TypeScript + React + React Native:
{
"extends": [
"@dyrkow/eslint-config",
"@dyrkow/eslint-config-typescript",
"@dyrkow/eslint-config-react",
"@dyrkow/eslint-config-react-native"
]
}