@s-ui/precommit
v3.3.0
Published
Effortless SUI precommit rules integration in your project
Maintainers
Keywords
Readme
sui-precommit
Effortless SUI precommit rules integration in your project
Installs git hooks to ensure quality rules are executed before any commit (test, linting, consistent commit, etc).
It provides:
- Assurance that all code is compliant with Adevinta's standards.
- Centralize precommit rule: quality rules can be improved and seemlessly inherited by all projects.
Installation
$ npm install @s-ui/precommit --save-devCLI
$ sui-precommit
Installs git hooks. This command is executed automatically when you install @s-ui/precommit as dependency thanks to a postinstall npm hook.
Executes 3 actions:
- Add
commit-msg,pre-commit, andpre-pushhooks to the.git/hooksfolder. - Add
pre-commitandpre-pushnpm scripts to thepackage.json. - Add
lintandtestnpm scripts in case they're not present. Note: If scripts are already present, it doesn't overwrite them (as some packages might not need executingsui-lint sassorsui-lint jsor you could have a specific config).
Your package.json might be altered like that:
{
"scripts": {
"lint": "sui-lint js && sui-lint sass",
"test": "echo \"Error: no test specified\" && exit 1",
"pre-commit": "npm run lint",
"pre-push": "npm run test"
}
}