Skip to main content

CLI options, exit codes and JSON output

structurelint [options]

Run it from your project root: the config is discovered in the current working directory, and every reported path is relative to it.

OptionDefaultDescription
-p, --path <path>structureRootRoot folder to validate (overrides structureRoot)
--json—Emit machine-readable JSON instead of text
-h, --help—List all available options

Exit codes​

CodeMeaning
0The structure is valid
1There are violations
2A usage error: no config found, the root folder does not exist, or the config is invalid

An invalid config is one the walk cannot apply, such as a { ruleId } that is not defined under rules or an unknown {CaseToken} in a rule name.

JSON output​

Use --json for machine or AI consumption. The output is the lint result on stdout, and a usage error is reported there too, still with exit code 2:

{
"passed": false,
"error": "Structure root \"lib\" does not exist or is not a folder."
}

--json also suppresses the one-time usage statistics prompt, so nothing interactive can land in the JSON.

In scripts and CI​

{
"scripts": {
"lint:structure": "structurelint"
}
}

Structure validation does not depend on ESLint, so it can run in parallel with the rest of your checks. With CI=true set, as most CI providers do, the CLI never prompts.