Skip to content

Config

Sadrazam loads config from either:

  • sadrazam.json
  • package.json#sadrazam

Create a config file interactively:

Terminal window
sadrazam init

The init flow asks for reporter, scan mode, finding focus, noise exclusions, ignored packages, and optional custom scan inputs before writing sadrazam.json.

Validate an existing config:

Terminal window
sadrazam doctor

doctor checks unsupported reporters, finding types, plugin keys, and stale allowlist, ignore, and catalog entries.

{
"reporter": "json",
"maxShowIssues": 10,
"production": false,
"strict": false,
"exclude": ["missing"],
"ignorePackages": ["$packages:ignored"],
"allowUnusedDependencies": [],
"allowUnusedDevDependencies": ["typescript"],
"allowMissingPackages": [],
"allowMisplacedDevDependencies": [],
"catalog": {
"packages": {
"ignored": ["react"]
},
"entryFiles": {
"bootstrap": ["scripts/bootstrap.ts"]
}
},
"inputs": {
"entryFiles": ["$entryFiles:bootstrap"]
},
"plugins": {
"vite": true,
"jest": false,
"playwright": {
"config": "config/playwright.config.ts",
"entry": "integration/**/*.spec.ts"
}
},
"preprocessors": {
"packagePatterns": ["@types/*"],
"filePatterns": ["src/generated/*"],
"exportPatterns": ["src/lib.ts: ignored*"]
},
"jsdocTags": {
"ignoreExports": ["sadrazam-ignore", "sadrazam-keep"]
},
"workspace": ["packages/web"],
"ai": {
"provider": "openai",
"model": "gpt-4.1"
}
}

CLI flags override config values.

  • ignorePackages
  • allowUnusedDependencies
  • allowUnusedDevDependencies
  • allowMissingPackages
  • allowMisplacedDevDependencies
  • maxShowIssues
  • catalog.packages
  • catalog.entryFiles
  • inputs.entryFiles
  • inputs.packageNames
  • plugins.<name>
  • plugins.<name>.config
  • plugins.<name>.entry
  • preprocessors.packagePatterns
  • preprocessors.filePatterns
  • preprocessors.exportPatterns
  • jsdocTags.ignoreExports

Catalog references can be used inside rule and input arrays with $packages:<name> and $entryFiles:<name>.

Sadrazam automatically enables built-in plugin analysis from package declarations, scripts, and known config files. Plugin config can force-enable a plugin, disable one, or override its config and entry files:

{
"plugins": {
"vite": true,
"jest": false,
"playwright": {
"config": "config/playwright.config.ts",
"entry": ["integration/**/*.spec.ts"]
},
"github-actions": {
"config": ".github/workflows/*.yml"
},
"gitlab-ci": {
"config": ".gitlab-ci.yml"
},
"circleci": {
"config": ".circleci/config.yml"
},
"azure-pipelines": {
"config": "azure-pipelines.yml"
},
"bitbucket-pipelines": {
"config": "bitbucket-pipelines.yml"
},
"nx": {
"config": "nx.json"
},
"turbo": {
"config": "turbo.json"
},
"babel": {
"config": ["babel.config.json", ".babelrc"]
},
"lint-staged": {
"config": ".lintstagedrc.json"
},
"docker": {
"config": ["Dockerfile", "docker-compose.yml"]
}
}
}

Supported built-in plugins currently cover Astro, Azure Pipelines, Babel, Bitbucket Pipelines, CircleCI, Commitlint, Cypress, Docker, ESLint, GitHub Actions, GitLab CI, Husky, Jest, Lerna, lint-staged, Next, Nx, Playwright, pnpm workspace, PostCSS, Prettier, Rollup, Rush, Storybook, SvelteKit, Tailwind, Turbo, TypeScript, Vite, Vitest, and webpack.