Skip to content

quality.json reference

The package includes quality.schema.json; set $schema to its installed path for editor completion. quality.json is standard JSON.

{
"$schema": "./node_modules/@terra-symposium/quality/quality.schema.json",
"sourceRoots": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"tools": { "prettier": "prettier", "eslint": "eslint", "knip": "knip", "tsc": "tsc" },
"qualityCommands": [
{ "name": "build", "command": "pnpm", "args": ["run", "build"] },
{ "name": "test", "command": "pnpm", "args": ["run", "test"] }
]
}

sourceRoots and extensions are required. Keep only tools and commands installed and desired in your repository.

FieldMeaning
rootRepository root relative to the config file; defaults to the config directory.
sourceRootsRequired source discovery roots, relative to root.
includeRootsAdditional roots used by single-use analysis.
extensionsRequired file extensions, including the leading dot.
skippedDirectories, skippedFilesAdditional excluded paths. Common generated directories are already skipped.
singleUse.skippedDirectoriesExclusions specific to single-use analysis.
aliasesImport prefixes mapped to repository paths, e.g. { "@/": "src/" }.
externalPrefixesImport prefixes intentionally considered external.
protectedIdentifiersNames the naming cleanup must preserve.
renameExportsAllow the naming rule to rename exports; defaults to false.

Paths resolve from root; express roots and exclusions consistently relative to it.

Omitted enabledChecks entries remain enabled. Omitted autofix entries remain enabled for fix-capable checks. The --warn CLI option disables every autofix for that invocation.

{
"enabledChecks": {
"document": true, "format": true, "import": true, "name": true,
"forward": true, "lint": true, "knip": true, "dead-code": true,
"type": true, "recommend": true, "command": true, "diff": true,
"alias": true, "security": true, "repeated-classes": true,
"regex-dedup": true, "ui-patterns": true
},
"autofix": {
"document": true, "format": true, "name": true, "lint": true,
"knip": true, "alias": true, "forward": true,
"repeatedClasses": true, "regexDedup": true
}
}

security, repeatedClasses, regexDedup, and uiPatterns checks run only when their matching config object is supplied. Each check guide explains fixability and limits.

{
"documentation": {
"required": { "types": true, "functions": true, "exportedFunctions": true, "noInlineFunctions": false }
}
}

These booleans are independent. types covers classes, enums, interfaces, and type aliases. functions covers named function declarations. exportedFunctions can cover exported named functions when functions is false. noInlineFunctions reports arrow functions and function expressions. The fixer can add blank scaffolding, not prose.

FieldMeaning
tools.prettier, tools.eslint, tools.knip, tools.tscExecutable name or path. A repository-local .bin tool is preferred for a name. Tools are not installed by this package.
oneLineImportsEnables long one-line import protection/canonicalization.
prettierPrintWidthPrint width for the formatting integration.
lintRootsESLint scope; defaults to selected source files.
tsconfigTypeScript project config path.
typecheckRoots, typecheckExtensionsSource type-check scope.
typecheckCommandOptional repository-owned typecheck executable and args.

Native tool configuration remains available for project-specific rules and plugins.

qualityCommands lists required commands. Each item needs a unique lowercase name, command, and optional string-array args. enabledCommands toggles individual names. enabledChecks.command: false disables the category.

recommendationCommands uses the same shape. enabledRecommendations toggles each name; enabledChecks.recommend: false disables all. Recommendation statuses do not fail quality.

{
"qualityCommands": [{ "name": "test", "command": "pnpm", "args": ["test"] }],
"enabledCommands": { "test": true },
"recommendationCommands": [{ "name": "dependency-report", "command": "pnpm", "args": ["run", "dependency-report"] }],
"enabledRecommendations": { "dependency-report": true }
}

Commands run from root and inherit the calling process environment. The runner does not provision services or credentials.

{
"security": {
"forbiddenTerms": ["temporary-secret"],
"forbiddenImports": ["unsafe-package"],
"clientRoots": ["src/client"],
"allowProcessEnvRoots": ["src/server"]
}
}

All fields are optional. Client roots identify code where secret-shaped environment access should be reported; runtime roots permit expected process-environment access. These are portable guardrails, not a full secret scanner or framework-aware trust analysis.

FieldOptionsPurpose
repeatedClassesminimumCount, extensions, ignoredDirectoriesDetect repeated static class strings.
regexDedupminimumCount, extensions, ignoredFiles, sharedModuleDetect repeated regex sources; optional shared ESM factory enables cross-file fixes.
uiPatternsforbidden, extensions, ignoredFilesReport UI patterns that should use shared primitives.
tailwindCanonicalstylesheet, sourceRootsCanonical stylesheet and optional Tailwind normalization roots.

Regex shared-module extraction expects a repository-relative .mjs and matching .d.mts. Unsupported cases remain review findings. See repeated classes and regex dedup.

This repository scans packages and scripts, supports JS/TS module extensions, protects long one-line imports, and opts into build and test commands. It skips single-use in packages/quality, where declarations are part of reusable package APIs. Treat it as an example; choose scope to fit your own repository.