ESLint
Prerequisites:
The styleguide needs to be installed as a development dependency:
Install ESLint
This styleguide targets ESLint v9+ (flat config):
Configure ESLint
Create an ESLint flat-config file at the repository root.
If your repo is ESM (
"type": "module"), useeslint.config.js.Otherwise, use
eslint.config.mjs.
Node.js projects
React / browser projects
Options
Export | Type | Use when | Notes |
|---|---|---|---|
| function | Node-only repos (backend, packages, scripts) | Canonical usage in our repos (e.g. |
| function | React/Vite/Remix repos | Canonical usage in our repos. |
| function | You want stronger typing for ESLint config | Re-export of |
What these presets do (high level)
Ignore
dist,build,node_modules,coverage.For TypeScript files, set
parserOptions.projectto<repoRoot>/tsconfig.json(so type-aware rules can run).Apply Prettier’s rule overrides via
eslint-config-prettierto avoid formatter/linter conflicts.
Add scripts
Troubleshooting
Type-aware linting is slow: ensure your
tsconfig.jsonis not accidentally including huge globs (likedist/**).Monorepo root issues: use
defineBaseNodeEslintConfig(<rootPath>)/defineReactEslintConfigwith an explicitrepoRoot.