@ethang/eslint-config
v19.8.3
Published
[View Config](https://eslint-config-ethang.pages.dev/rules)
Downloads
4,691
Readme
Opinionated, Strict, Brutal, Unforgiving
[!CAUTION] Do not use this with Prettier! Styling rules are included.
- 887 errored rules.
- 289 rules from eslint-plugin-sonarjs
- 144 rules from @eslint/js
- 113 rules from sindresorhus/eslint-plugin-unicorn
- 103 rules from @typescript/eslint
- 67 rules from @stylistic/eslint-plugin
- 42 rules from eslint-plugin-lodash
- 35 rules from jsx-a11y
- 25 rules from @stylistic/eslint-plugin-ts
- 20 rules from eslint-plugin-n
- 20 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
Add Even More!
- 51 rules for Astro
import astroConfig from "@ethang/eslint-config/config.astro.js";
- 51 rules from eslint-plugin-astro
- 73 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
- 18 rules for Solid
import solidConfig from "@ethang/eslint-config/config.solid.js";
- 18 rules from eslint-plugin-solid
Install
pnpm i -D eslint typescript-eslint @ethang/eslint-config
Requires TypesScript and tsconfig.json at root directory.
Config
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"
]