Shareable, composable configuration packages for JavaScript and TypeScript projects — covering ESLint, Jest, Rollup, TypeScript, Prettier, commitlint, and more.
| Package | Description |
|---|---|
@lazyconfig/eslint |
Composable ESLint flat config presets for JS, TS, React, and Node.js |
@lazyconfig/jest |
Composable Jest presets for JS and TypeScript projects |
@lazyconfig/rollup |
Declarative, format-aware Rollup configuration with opt-in plugins |
@lazyconfig/tsconfig |
TypeScript configuration presets for libraries and Node.js apps |
@lazyconfig/prettier |
Prettier preset for consistent code formatting |
@lazyconfig/commitlint |
Commitlint configuration enforcing Conventional Commits |
@lazyconfig/api-extractor |
API Extractor base config for generating rolled-up .d.ts files |
@lazyconfig/cli |
CLI scripts for automating development workflows |
@lazyconfig/presets |
Meta-package that bundles all lazyconfig packages in a single install |
Install individual packages or use the meta-package for everything at once.
All-in-one:
pnpm add -D @lazyconfig/presetsIndividual packages:
pnpm add -D @lazyconfig/eslint @lazyconfig/jest @lazyconfig/tsconfigbase is always included. All other presets are opt-in boolean flags:
// eslint.config.js
import { defineConfig } from "@lazyconfig/eslint";
// Base only
export default defineConfig();
// TypeScript project
export default defineConfig({ typescript: true });
// React + TypeScript + Prettier
export default defineConfig({ typescript: true, react: true, prettier: true });
// Node.js + TypeScript
export default defineConfig({ typescript: true, node: true });Available presets: typescript, react, a11y, node, prettier, ignores.
See packages/eslint for the full API.
// jest.config.js
import { defineConfig } from "@lazyconfig/jest";
export default defineConfig({
typescript: true,
coverage: true,
});Supports TypeScript via SWC, jsdom for browser environments, coverage thresholds, JUnit XML output, and path aliases.
See packages/jest for the full API.
// rollup.config.js
import { defineConfig } from "@lazyconfig/rollup";
export default defineConfig({
bundles: [{ input: "src/index.ts", file: "my-lib" }],
formats: { es: true, cjs: true },
plugins: { node: true },
});Supports ES, CJS, UMD, IIFE, AMD, and System output formats with opt-in plugins (node-resolve, Babel, JSON, replace, Terser, and custom extras).
See packages/rollup for the full API.
// tsconfig.json
{ "extends": "@lazyconfig/tsconfig/lib" }Available presets: base, node, lib, react. Includes an env.d.ts for __DEV__ and __PROD__ globals.
See packages/tsconfig for the full API.
// .prettierrc.json
"@lazyconfig/prettier"See packages/prettier for the full options table.
// commitlint.config.cjs
module.exports = {
extends: ["@lazyconfig/commitlint"],
};For ESM projects ("type": "module"), use .commitlintrc.mjs instead:
// .commitlintrc.mjs
export default {
extends: ["@lazyconfig/commitlint"],
};Enforces Conventional Commits with 11 commit types. Integrate with Husky to validate messages locally via the commit-msg hook.
See packages/commitlint for the full rules table.
// api-extractor.json
{ "extends": "@lazyconfig/api-extractor/base.json" }See packages/api-extractor for defaults and overrides.
# Compile TypeScript declarations (tsc + api-extractor)
lazyconfig compile types
# Enforce commit sign-off in a Git hook
lazyconfig hook commit-signoffSee packages/cli for all commands.
Requirements: Node.js ≥ 22, pnpm ≥ 10
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run all tests
pnpm test
# Lint
pnpm lint
# Type-check
pnpm typecheckWhen installing @lazyconfig/* packages in your project, pnpm may report:
[WARN] deprecated subdependencies found: glob@7.2.3, inflight@1.0.6
These come from jest's internal coverage path (babel-plugin-istanbul → test-exclude → glob@7). They're transitive and harmless, but if you want a clean install, add the following override to your own project's pnpm-workspace.yaml (or to pnpm.overrides in package.json for non-monorepo projects):
overrides:
"glob@<10": "^10"
allowedDeprecatedVersions:
glob: "*"The override is project-local and is not propagated from this repository's lockfile — every consuming project must declare it independently.
pnpm 10+ no longer auto-runs install scripts for security. unrs-resolver (pulled in by some ESLint resolver plugins) ships native binaries and needs its build script to run. Approve it once with:
pnpm approve-buildsOr add it permanently to your pnpm-workspace.yaml:
allowBuilds:
unrs-resolver: trueContributions are welcome. Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening a pull request.
All commits must follow Conventional Commits and include a DCO Signed-off-by trailer (git commit -s).