Quality control tool for Trussle
npm install @trussle/qc
QC is a tool that performs quality control checks on a Javascript repository. It makes sure that:
- All tests are passing (by calling npm test)
- All code is lint-free (using Trussle's ESLint rules)
- Code coverage is sufficient (using Istanbul)
If any of these checks don't pass, QC won't let you push your changes.
Mean, I know - but it's the only way you'll learn.
QC should be installed as a dependency in your project:
``sh`
npm install --save-dev @trussle/qc
If you're using mocha, you'll need to change from using mocha to using _mocha; this avoids forking the process, which causes some issues with code coverage.
On installation, QC will do a few things:
- If there is no .eslintrc.js file, one is added to the root of the project..istanbul.yml
- If there is no file, one is added to the root of your project.
- It will set up a Git pre-push hook that runs itself when pushing code, to make sure you're behaving 😘
If you want to run QC yourself, just run ./node_modules/.bin/qc or set up the following script in your package.json:
`json`
{
"scripts": {
"qc": "qc"
}
}
> Please read this section very carefully: if any of these assumptions are not true about your project, QC will fail.
QC assumes the following about your package:
- There is a test script in your package.json which points to an executable in the ./node_modules/.bin directory (not global; usually _mocha`).