@alldev/eslint-config
v0.1.1
Published
Shared ESLint flat config: TypeScript, Airbnb, Stylistic, JSON, CSS
Maintainers
Readme
@alldev/eslint-config
Shared ESLint flat config for Alldev projects: TypeScript (typescript-eslint recommended), Airbnb (flat), Stylistic, JSON, and CSS.
Requirements
- Node.js 18+ (or whatever your apps already use).
- ESLint 9 (
eslint@^9). - TypeScript as a dev dependency (
typescriptsatisfies thetypescript-eslinttoolchain, even if the repo is mostly JavaScript).
Install
In the project root (app, package, or worker):
pnpm add -D eslint typescript @alldev/eslint-confignpm install --save-dev eslint typescript @alldev/eslint-configyarn add -D eslint typescript @alldev/eslint-configeslint-flat-config-airbnb already pulls in plugins such as React, React Hooks, import, and jsx-a11y; you do not need to duplicate those in each repo unless you want extra plugins locally.
Use in a project
Add eslint.config.mjs (or eslint.config.js if the project is ESM-ready) at the repository root of that project—same level as its package.json. Do not copy rule lists from this package; import the preset and only add local overrides when needed.
Default (use shared rules as-is)
// eslint.config.mjs
import eslintconfig from "@alldev/eslint-config";
export default eslintconfig;The package already calls defineConfig, so the default export is ready for ESLint.
With local overrides
// eslint.config.mjs
import eslintconfig from "@alldev/eslint-config";
export default [
...eslintconfig,
{
files: ["**/*.ts", "**/*.tsx"],
rules: {
// project-specific only
},
},
];If your default export is a single config object/array from defineConfig, spreading works the same as with any flat-config array.
Scripts
Add something like:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Point ESLint at the right roots if you use monorepos (eslint packages/foo or eslint . from each package root with its own eslint.config.mjs).
What this config covers
- Ignores:
node_modules,dist,build,.next,.wrangler,coverage. - JS/TS/JSX/TSX:
typescript-eslintrecommended + Airbnb flat + shared globals (browser + node) + Stylistic and import/React-related tweaks (seeindex.jsin this repo). - JSON / JSONC / JSON5:
@eslint/jsonrecommended. - CSS:
@eslint/cssrecommended.
Updating rules
Change rules in index.js in this package, bump version in package.json, publish, then bump @alldev/eslint-config in each consumer and reinstall.
License
MIT
