Standard linting, formatting and more for mongodb-js projects.
mongodb-js-precommit provides a shortcut to the following useful tools:
dependency-checkMakes sure you didn't forget to update yourpackage.jsonwith new dependencies or remove dependencies your module isn't using anymore.jsfmtFormats your code to the syleguide for you.eslintMakes sure your code conforms to the syleguide for cases that aren't just simple formatting and are probably bugs.
First, install pre-commit, which actually sets up the git precommit hook:
npm install --save-dev pre-commit mongodb-js-precommitNext, update your package.json to add a new check script and condifure
pre-commit to run it:
"scripts": {
"check": "mongodb-js-precommit"
},
"precommmit": ["check"]To test that everything is working correctly, you can run:
npm run checkNow, sit back, relax and think about what you're going to do with your new found free time that would have been spent on code reviews.
mongodb-js-precommit is easily configurable via your package.json.
entries[]extra entry points for dependency-checkignore[]module names for dependency-check to ignore
"dependency-check": {
"entries": ["bin/mongodb-js-precommit.js"],
"ignore": ["mongodb-js-precommit", "mocha"]
}Checkout the pre-commit configuration docs for more details.
For more information, checkout eslint-config-mongodb-js.
npm-check-updatesCan we safely update dependency versions to latest safely?nspAre you using any modules with known security vulnerabilites?
Apache 2.0