@lumelabs/eslint-config
v0.4.0
Published
Opinionated, batteries-included ESLint 9 (flat config) for TypeScript projects — frontend and backend.
Maintainers
Readme
@lumelabs/eslint-config
⚠️ Experimental / Internal Use
Primarily intended for personal and internal use. It may change, break, or be restructured at any time. Don't rely on it for public projects unless you're prepared to maintain your own fork. Issues/feature requests may be closed without response.
Opinionated, batteries-included ESLint 9 (flat config) for JavaScript and TypeScript projects — both frontend (React) and backend. Designed for modern setups using Vite/Webpack and Prettier. It prioritizes practical correctness over ideology and avoids rules that create noise or force unnatural code.
Two entry points, matching the project you're linting:
@lumelabs/eslint-config— plain JavaScript (+ React/a11y/import). Zero setup.@lumelabs/eslint-config/typescript— everything above, plus the full TypeScript rule set (syntactic and type-aware). Requires a realtsconfig.json.
Features
- ESLint 9 flat config (
eslint.config.js) - Batteries included —
eslintitself and every plugin are bundled as dependencies. Install one package; you don't addeslintor any plugin yourself. - Two clear entry points — plain JS by default, or the full TypeScript rule set
(including type-aware rules like
no-misused-promises,switch-exhaustiveness-check) via/typescript. No mixing syntactic and type-aware TS rules across configs to reason about. - React + React Hooks (incl. the React Compiler rules, tuned to warn) + JSX a11y
eslint-plugin-import-xrules (named-exports enforced; default exports disallowed)- Prettier-compatible — all formatting rules are turned off; Prettier owns formatting
- Jest globals auto-enabled for test files only
Requirements
- ESLint 9 — bundled with this package; do not install
eslintseparately in your project. - TypeScript (only if using the
/typescriptentry) — provided by your project (declared as an optional peer dependency), with a realtsconfig.jsonin the project. - Node.js 18.18+ / 20+ (per ESLint 9).
Installation
npm install --save-dev @lumelabs/eslint-configThat's it — no other ESLint packages to install.
Usage
Create eslint.config.js (ESM) in your project root:
import lumelabs from "@lumelabs/eslint-config"
export default lumelabsOr eslint.config.cjs (CommonJS):
const lumelabs = require("@lumelabs/eslint-config")
module.exports = lumelabsTypeScript projects
The default export (.) is plain JavaScript — no TypeScript parser or plugin at all —
so it works with zero setup. For TypeScript projects, use the /typescript entry instead.
It layers on the full typescript-eslint rule set — syntactic rules (consistent-type-imports,
no-unused-vars, …) and type-aware rules (no-misused-promises, switch-exhaustiveness-check,
await-thenable, …) together, as one config. It requires your project to have a real
tsconfig.json (auto-discovered via projectService):
import lumelabs from "@lumelabs/eslint-config/typescript"
export default lumelabsPlain JS/config files within a TypeScript project automatically have type-checking turned back off, so they never error.
Overriding rules per project
The export is a flat-config array — spread it and append your own config objects:
import lumelabs from "@lumelabs/eslint-config"
export default [
...lumelabs,
{
rules: {
// e.g. relax the named-exports rule for a framework that needs default exports
"import-x/no-default-export": "off",
},
},
]Notes
- Named exports are enforced (
import-x/no-default-export).*.cjsfiles are ignored, so CommonJS config files are unaffected. For frameworks that require default exports (e.g. Next.js pages), override the rule for the relevant paths as shown above. *.stories.*and*.cjsare not linted by default.- React Compiler rules (
react-hooks/*) are enabled as warnings (not errors), so they nudge rather than block. The compiler-infrastructure rules are off until you adopt the React Compiler — flip them on per-project when you do. - Bumping ESLint (e.g. to v10) is centralized here: update this package and republish, and every project follows on its next install.
