A dynamic ESLint configuration for multiple frameworks, available as a single dependency.
- Dynamic ESLint rules based on your project's dependencies such as React, TypeScript, Svelte, Vue, and more.
- Installs as a single
devDependency
: No need to install a bunch of internally extended configs - Optionally overrides ESLint formatting with Prettier
Lint rules for a file are determined by its extension and the project's dependencies.
- A file with a
.tsx
extension inside of a project with dependencies ontypescript
,react
, andprettier
will be linted with rules for TypeScript, React, and Prettier; Svelte or Vue rules will not be applied. - A file whose name matches the glob
**/*.{spec,test}.{js?(x),ts?(x)}
inside of a project with a dependency onjest
will be linted with Jest rules.
Beyond framework-specific rules, common lint rules are also sourced from the following configs/plugins:
- confusing-browser-globals
- eslint-config-prettier (only if your project depends on
prettier
) - eslint-plugin-eslint-comments
- eslint-plugin-import
- eslint-plugin-no-use-extend-native
- eslint-plugin-promise
- eslint-plugin-regexp
- eslint-plugin-unicorn
pnpm i -D @phi.school/eslint-config
Extend this package in your local eslint config or package.json
:
ESLint Config:
// .eslintrc.json
{
"extends": ["@phi.school/eslint-config"]
}
package.json:
"eslintConfig": {
"extends": [
"@phi.school/eslint-config"
]
}
- Adopt ESLint's new Flat Config format.
We welcome contributions! For a detailed guide on how to contribute, please refer to the Contributing section in the main README of the repository.
Released under the MIT License. © 2023-Present phi school