Skip to content

udohjeremiah/moniq

Repository files navigation

moniq

Define workspace policies once. Keep every package consistent.

NPM Version NPM Downloads GitHub Actions Workflow Status GitHub License

Install

# npm
npm install --save-dev @udohjeremiah/moniq

# pnpm
pnpm add -D -w @udohjeremiah/moniq

# yarn
yarn add --dev @udohjeremiah/moniq

# bun
bun add --dev @udohjeremiah/moniq

# deno
deno add -D npm:@udohjeremiah/moniq

Quick Start

Create a moniq.config.{ts,js,mjs,cjs,mts,cts} at the root of your monorepo and configure your policies:

import { defineConfig, bin } from "@udohjeremiah/moniq";

export default defineConfig({
  scripts: {
    build: { command: bin("tsdown"), severity: "error" },
    lint: { required: false, severity: "warn" },
  },
});

Then run the check:

# npm
npx moniq check

# pnpm
pnpm moniq check

# yarn
yarn moniq check

# bun
bun run moniq check

# deno
deno run -A npm:@udohjeremiah/moniq check

CLI

Command Description Options
moniq init Install and scaffold a moniq.config file --lang <type>
moniq check Run policy checks --format <fmt>
moniq fix Run policy checks and apply autofixes --dry-run, --format <fmt>
moniq doctor Detect configuration mistakes

Configuration

Configuration is done via a moniq.config.{ts,js,mjs,cjs,mts,cts} file at your workspace root.

import { defineConfig, bin } from "@udohjeremiah/moniq";

export default defineConfig({
  scripts: {
    build: { command: bin("tsdown"), severity: "error" },
    lint: { required: false, command: /^eslint/, severity: "warn" },
    typecheck: { command: "tsc --noEmit", severity: "error" },
  },
});

See the configuration guide for a full list of policy types and configuration options.

Docs

Full documentation is available at udohjeremiah.github.io/moniq.

Contributing

See CONTRIBUTING.md for detailed instructions on setting up the project, development workflow, pull request process, and release process.

License

MIT © Udoh Jeremiah

About

Policy-driven workspace linter for JavaScript/TypeScript monorepos.

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages