Skip to content

Repository files navigation

lazyconfig

CI Codecov License Changesets Conventional Commits Node pnpm Sponsor

Shareable, composable configuration packages for JavaScript and TypeScript projects — covering ESLint, Jest, Rollup, TypeScript, Prettier, commitlint, and more.


Packages

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

Quick Start

Install individual packages or use the meta-package for everything at once.

All-in-one:

pnpm add -D @lazyconfig/presets

Individual packages:

pnpm add -D @lazyconfig/eslint @lazyconfig/jest @lazyconfig/tsconfig

Usage

ESLint

base 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

// 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

// 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.


TypeScript

// 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.


Prettier

// .prettierrc.json
"@lazyconfig/prettier"

See packages/prettier for the full options table.


commitlint

// 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

// api-extractor.json
{ "extends": "@lazyconfig/api-extractor/base.json" }

See packages/api-extractor for defaults and overrides.


CLI

# Compile TypeScript declarations (tsc + api-extractor)
lazyconfig compile types

# Enforce commit sign-off in a Git hook
lazyconfig hook commit-signoff

See packages/cli for all commands.


Development

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 typecheck

Troubleshooting

Deprecated glob / inflight warning on install

When 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-istanbultest-excludeglob@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.

ERR_PNPM_IGNORED_BUILDS: unrs-resolver

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-builds

Or add it permanently to your pnpm-workspace.yaml:

allowBuilds:
  unrs-resolver: true

Contributing

Contributions 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).


License

MIT © ruben-omh

About

Shareable configuration packages for ESLint, Jest, Rollup, TypeScript, Prettier, and commitlint.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages