Basic usage
The minimal possible configuration depends on two files, the configuration and one style file:
style = "foo.json"
{
"rules": [
{
"files": [".gitignore"],
"includeLines": ["/dist/"]
}
]
}
This example enforces the existence of a .gitignore file which must
include a line with the content /dist/
.
The first time that you execute project-config check
will raise an
error indicating the abcense of .gitignore:
.gitignore
- Expected existing file does not exists rules[0].files[0]
If you create a .gitignore keeping it empty, the second time it will warns indicating that the file does not include the line:
.gitignore
- Expected line '/dist/' not found rules[0].includeLines[0]
If you include the line, it will not warn exiting with 0 code.
Autofixing
This example is automatically fixable executing project-config fix
when the file .gitignore is even unexistent.
$ project-config fix
.gitignore
- (FIXED) Expected existing file does not exists rules[0].files[0]
- (FIXED) Expected line '/dist/' not found rules[0].includeLines[0]