Opinionated set of ESLint shareable configs by Alex Ilyaev
I manage many projects and find myself copy/pasting configs between projects, which got out of hand pretty quickly.
ai
- eslint:recommended
- Common base rules
ai/typescript
ai/unicorn
ai/import
ai/jest
ai/lodash
ai/promise
ai/react
- eslint-plugin-react
- Setting
react/recommended
andreact/jsx-runtime
- Setting
- eslint-plugin-react-hooks
- eslint-plugin-jsx-a11y
- eslint-plugin-compat
- eslint-plugin-react
ai/jsdoc
ai/eslint-comments
ai/last
- @stylistic/disable-legacy
- Disables styling rules that were deprecated and moved to
@stylistic
- Disables styling rules that were deprecated and moved to
- prettier
- Disables styling rules that are covered by Prettier
- @stylistic/disable-legacy
Required:
pnpm add -D \
prettier \
eslint \
eslint-config-prettier \
@stylistic/eslint-plugin \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint-config-ai
ai/react
:
pnpm add -D \
eslint-plugin-compat \
eslint-plugin-jsx-a11y \
eslint-plugin-react \
eslint-plugin-react-hooks
ai/import
:
pnpm add -D \
eslint-plugin-import \
eslint-import-resolver-typescript
Other:
pnpm add -D \
eslint-plugin-jest \
eslint-plugin-lodash \
eslint-plugin-promise \
eslint-plugin-jsdoc \
eslint-plugin-eslint-comments \
eslint-plugin-unicorn
- If you use npm, replace
pnpm add
withnpm install
Add to your .eslintrc
:
Disables styling rules that are covered by Prettier or deprecated and moved to
@stylistic
Always add
ai/last
as the lastextends
{
"extends": ["ai/last"]
}
This config extends eslint:recommended
and sets up Prettier
{
"extends": ["ai", "ai/last"]
}
You can choose which plugins to add
{
"extends": [
"ai",
"ai/typescript",
"ai/unicorn",
"ai/import",
"ai/jest",
"ai/lodash",
"ai/promise",
"ai/jsdoc",
"ai/eslint-comments",
"ai/last"
]
}
{
"extends": ["ai", "ai/typescript", "ai/react", "ai/last"]
}
{
"extends": ["ai/all"]
}
You can see what's currently configured in these files: