@async/hygiene hides repository hygiene tooling behind one package, one config file, one CLI command, and one pipeline task.
Consuming repositories should expose a single hygiene gate. The underlying tools are implementation details of this package.
pnpm add -D @async/hygieneThe package is ESM TypeScript, requires Node >=24, and ships the async-hygiene binary.
Create hygiene.config.ts:
import { defineConfig } from "@async/hygiene";
export default defineConfig({
mode: "auto",
targets: {
packages: [{ path: "packages/pipeline" }]
}
});Modes:
app: repo-level hygiene only.package: repo-level hygiene plus package publish/type/metadata checks.mixed: repo-level hygiene once, package checks for explicit package targets.auto: explicit targets select mixed mode; otherwise a publishable root package selects package mode; private roots fall back to app mode.
async-hygiene list
async-hygiene check
async-hygiene check --mode app
async-hygiene check --mode package
async-hygiene check --mode mixedcheck prints one combined report and exits non-zero when any hygiene gate fails.
Expose one task:
import { hygieneTask } from "@async/hygiene/pipeline";
import hygieneConfig from "./hygiene.config.ts";
export default definePipeline({
// ...
tasks: {
hygiene: hygieneTask(hygieneConfig),
pack: task({
dependsOn: ["test", "hygiene"],
run: sh`npm --cache .async/npm-cache pack --dry-run`
})
}
});Do not expose tool-specific task ids in the consuming repo.