This is my personal very opinionated ESLint configuration. Use it if you would like, but it's definitely not for everyone. The main reason I made this was so that I didn't have to keep setting up ESLint for every side project.
pnpm add -D @bosh-code/eslint-plugin// eslint.config.js
import { config as bosh } from "@bosh-code/eslint-plugin"
export default [
...bosh.configs.base, // Core JS/TS rules, general shared configs, and language setup
...bosh.configs.ts, // TypeScript rules
...bosh.configs.react, // React/Preact + .[j|t]sx file rules
...bosh.configs.node, // Node.js Rules
...bosh.configs.recommended, // Combination of configs.base and configs.ts
]import { config as bosh } from "@bosh-code/eslint-plugin"
import { createImportSortRule } from "eslint-plugin-bosh/utils"
export default [
...bosh.configs.base,
...bosh.configs.ts,
...bosh.configs.react,
{
rules: {
"bosh/invalid-hook-extension": "error",
"simple-import-sort/imports": createImportSortRule({
firstGroup: ["react", "^@?\\w"],
internalGroups: [
"^(@/components)(/.*|$)",
"^(@/hooks)(/.*|$)",
"^(@/lib)(/.*|$)",
],
}),
},
},
]base- Core JavaScript rules, import sorting, unicorn, sonarjsts- TypeScript-specific rulesreact- React, JSX, accessibility, performance rulesnode- Node.js environment globalsrecommended- Combination of the base and ts configs
- eslint-config-canonical has a lot of nice rules, have a look there for inspiration
- ESLint Stylistic
- Testing, jest/vitest?
- Prettier, in this repo and in eslint config.
- JSON linting
- YAML linting
- JS config
- JS Flow config?
- more rules