cd /news/developer-tools/monoswan-a-pleasant-ts-monorepo-lint… · home › topics › developer-tools › article
[ARTICLE · art-145004] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Monoswan – a pleasant TS monorepo linter

Monoswan, a TypeScript monorepo linter from developer pelicanonical, launched to keep package.json, tsconfig.json, and other standard files consistent across monorepo packages by defining shared package shapes once and checking them with built-in or custom rules. The tool discovers packages from pnpm, npm, Yarn, and Bun workspace declarations, requires Node.js 22.13 or newer, and installs as a development dependency at the workspace root via pnpm, npm, Yarn, or Bun. It ships four commands — lint (with --fix), init, print-config, and create-package — and documentation at monoswan.com/docs, with bugs reported through the project's GitHub issues.

read2 min views1 publishedOct 4, 2026
Monoswan – a pleasant TS monorepo linter
Image: Michielbdejong (auto-discovered)

pleasant monorepos

monoswan keeps package configuration consistent across a monorepo. Define shared package shapes once, check them with rules, and use the same definitions to create new packages. It discovers packages from pnpm, npm, Yarn, and Bun workspace declarations.

  • Centrally managed configuration: Sharepackage.json , TypeScript, JSON, and text configuration through composable variants.
  • Rules and consistency: Check packages with built-in or custom rules, with autofix support.
  • Package templates: Create packages from variant defaults and initialization content.

Copy this prompt into your coding agent:

monoswan is a monorepo management tool to help keep your package.json, tsconfig.json, and other standard files consistent across packages in a monorepo. Set up monoswan in this monorepo, you can view the full documentation at monoswan.com/llms.txt. Inspect the workspace first so you can preserve its package manager, structure, and existing conventions. Install monoswan as a development dependency at the workspace root, run its init command, then review the workspace packages and define practical variants in monoswan.config.ts for their shared package.json, TypeScript, JSON, and text-file configuration. Assign the appropriate variant or variants to each package, run the monoswan linter, fix any issues it reports without changing unrelated behavior, and summarize the configuration and files you changed.
  • Node.js 22.13 or newer
  • A pnpm-workspace.yaml or aworkspaces declaration in the rootpackage.json

Install monoswan at the workspace root.

pnpm add -D -w monoswan

npm install -D monoswan

yarn add -D -W monoswan

bun add -D monoswan

Initialize a configuration:

pnpm exec monoswan init

Use npx monoswan, yarn monoswan, or bunx monoswan in the commands below when using a different package manager.

Workspace discovery supports pnpm workspace files, npm and Bun workspace arrays, and both Yarn workspace forms, including modern Yarn Plug'n'Play installations. monoswan reads workspace declarations directly and does not invoke the package manager during discovery.

Then describe a shared package shape in monoswan.config.ts:

import { defineConfig, enforceVariants, sortPackageJson } from "monoswan";

export default defineConfig({
  variants: {
    "my-library": {
      packageJson: { type: "module" },
      tsConfig: { compilerOptions: { strict: true } },
    },
  },
  rules: [enforceVariants(), sortPackageJson()],
});

Assign the variant to a workspace package:

{
  "name": "@myrepo/example",
  "monoswan": {
    "variants": ["my-library"]
  }
}

Check the workspace:

pnpm exec monoswan lint .
Command Purpose
monoswan lint [path] Check workspace packages and optionally apply fixes with --fix .
monoswan init [path] Create an initial monoswan.config.ts .
monoswan print-config [path] Print the resolved configuration for a package.
monoswan create-package <path> <name> <variants...> Generate a package from variant templates.

Run pnpm exec monoswan <command> --help for complete command syntax.

Full documentation is available at monoswan.com/docs. Report bugs and request features through the project's GitHub issues.

This repository uses pnpm and pins the contributor runtime in package.json.

pnpm install
pnpm lint
pnpm check
pnpm test
pnpm build
── more in #developer-tools 4 stories · sorted by recency
── more on @monoswan 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/monoswan-a-pleasant-…] indexed:0 read:2min 2026-10-04 · —