Selectors are used apply checks constraints and constraints to subsets of packages in a project and are defined in a project configuration file.

Select all packages

Use the * selector to apply constraints and checks to all packages.

Example check:

.commonality/config.json
{
  "checks": {
    '*': [recommended.hasReadme()],
  }
}

Example constraint:

.commonality/config.json
{
  "constraints": {
    "*": { "disallow": ["deployable"] }
  }
}

Select packages with a tag

Select a tag to apply constraints and checks to a subset of packages.

Example check:

.commonality/config.json
{
  "checks": {
    "buildable": ["has-build-scripts"]
  }
}

Example constraint:

.commonality/config.json
{
  "constraints": {
    "config": { "disallow": ["application"] }
  }
}

Was this page helpful?