Caution
Do not use this with Prettier! Styling rules are included.
- 882 errored rules.
- 294 rules from eslint-plugin-sonarjs
- 144 rules from @eslint/js
- 116 rules from sindresorhus/eslint-plugin-unicorn
- 103 rules from @typescript/eslint
- 68 rules from @stylistic/eslint-plugin
- 34 rules from jsx-a11y
- 32 rules from eslint-plugin-lodash
- 25 rules from @stylistic/eslint-plugin-ts
- 20 rules from eslint-plugin-n
- 17 rules from eslint-plugin-perfectionist
- 7 rules from eslint-plugin-tailwindcss
- 7 rules from @eslint/markdown
- 5 rules from @tanstack/eslint-plugin-query
- 4 rules from eslint-plugin-barrel-files
- 2 rules from @eslint/json
- 1 rule from eslint-plugin-depend
- 1 rule from @cspell/eslint-plugin
- 1 rule from eslint-plugin-compat
- 1 rule from @tanstack/eslint-plugin-router
- 52 rules for Astro
import astroConfig from "@ethang/eslint-config/config.astro.js";
- 52 rules from eslint-plugin-astro
- 74 rules for React
import reactConfig from "@ethang/eslint-config/config.react.js";
- 71 rules from @eslint-react/eslint-plugin
- 2 rules from eslint-plugin-react-hooks
- 1 rules from eslint-plugin-react-compiler
- 18 rules for Solid
import solidConfig from "@ethang/eslint-config/config.solid.js";
- 18 rules from eslint-plugin-solid
pnpm i -D eslint typescript-eslint @ethang/eslint-config
Requires TypesScript and tsconfig.json at root directory.
In eslint.config.js
import config from "@ethang/eslint-config/eslint.config.js";
import tseslint from "typescript-eslint";
import astroConfig from "@ethang/eslint-config/config.astro.js"; // OPTIONAL
import reactConfig from "@ethang/eslint-config/config.react.js"; // OPTIONAL
export default tseslint.config(
{
ignores: [], // Ignored files apply to all following configs
},
...config,
...astroConfig,
...reactConfig,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Override rules from above configs
},
},
);
Scripts
"scripts": {
"lint": "eslint",
"lint:fix": "eslint . --fix",
}
Browserslist
This config will also lint for browserslist features. Make sure to set this in package.json. More info.
"browserslist": [
"defaults and fully supports es6-module",
"maintained node versions"
]