Configuration
Project configuration
A project configuration file is a config.json
file located in the .commonality
folder at the root of your project.
.commonality/config.json
{
"$schema": "https://commonality.co/config.json",
"checks": {
"*": ["has-readme"],
"publishable": ["ensure-license"]
},
"constraints": {
"*": { "disallow": ["deployable"] },
"config": { "allow": ["config"] }
}
}
Properties
checks
An object whose keys are selectors and whose values are paths to check objects.
Checks will run in the order they are defined.
.commonality/config.json
{
"checks": {
"*": [
// Path to a check local to the project
"has-readme",
"./has-readme",
"./linting/eslint-extends-node",
// Path to a custom check exported from a package
"@scope/my-team/my-custom-check",
"commonality-checks-recommended/sorted-dependencies"
// Packages prefixed with "commonality-checks-" can use a shorthand
"recommended/sorted-dependencies"
],
}
}
constraints
An object whose keys are selectors and whose value are constraint objects.
.commonality/config.json
{
"constraints": {
"*": { "disallow": ["deployable"] },
"config": { "allow": ["config"] }
}
}
workspaces
An array of micromatch patterns used to identify which directories should be included when searching for packages.
.commonality/config.json
{
"workspaces": ["apps/*", "packages/**", "!**/dist/**"]
}
Was this page helpful?