Every check type has a mirror inverse. File-level checks operate on raw file content. Field-level checks parse structured files and inspect individual fields.
Passes if the file specified by the table path (or expect) exists in the matched directory.
["services/*"."package.json"]
name = "must-have-package-json"
check = "file_exists"Passes if the file does not exist.
["services/*".no-env-files]
check = "file_not_exists"
expect = ".env"Passes if the file exists and contains the substring specified by pattern.
["services/*"."tsconfig.json"]
name = "tsconfig-extends-base"
check = "file_contains"
pattern = "extends"Passes if the file exists and does not contain the substring, or if the file does not exist.
["services/*"."src/index.ts"]
name = "no-console-logs"
check = "file_not_contains"
pattern = "console.log"Field checks require format and field. The field value uses dot-notation to traverse nested objects (e.g. "engines.node").
Supported formats: "json", "yaml", "toml".
Passes if the field exists in the parsed file.
["services/*".must-have-engines]
check = "field_exists"
expect = "package.json"
format = "json"
field = "engines"Passes if the field does not exist.
["packages/*".no-private-flag]
check = "field_not_exists"
expect = "package.json"
format = "json"
field = "private"Passes if the field exists and its stringified value contains the substring in pattern.
["services/*".correct-node-version]
check = "field_contains"
expect = "package.json"
format = "json"
field = "engines.node"
pattern = "18"Passes if the field's value does not contain the substring, or if the field is missing.
["services/*".no-legacy-node]
check = "field_not_contains"
expect = "package.json"
format = "json"
field = "engines.node"
pattern = "14"Failure messages include context to help you find and fix issues:
-
file_contains/file_not_contains: Shows the line number where the pattern was found.FAIL no-console-logs services/api src/index.ts:5 contains "console.log" -
field_contains/field_not_contains: Shows the actual field value.FAIL correct-node-version services/auth package.json.engines.node does not contain "18" (found ">=16.0.0") -
field_exists: Names the missing field.FAIL must-have-engines services/auth package.json missing field "engines"
Field checks work identically across all supported formats. Only the format and expect values change.
["services/*".k8s-has-replicas]
check = "field_exists"
expect = "deployment.yaml"
format = "yaml"
field = "spec.replicas"["crates/*".cargo-has-edition]
check = "field_exists"
expect = "Cargo.toml"
format = "toml"
field = "package.edition"