An npm package including some general shared tools and confiiguration files for Prettier, Husky, lint-staged and commitlint.
| Name | Description | Version | Website | GH repository | npm package |
|---|---|---|---|---|---|
| Prettier | An opinionated code formatter | 2.2 | prettier.io | prettier/prettier | prettier |
| commitlint | Linter for commit messages | 11.0 | commitlint.js.org | conventional-changelog/commitlint | @commitlint/cli |
| Husky | Git hooks made easy | 4.3 | typicode.github.io/husky | typicode/husky | husky |
| lint-staged | Run linters on git staged files | 10.5 | - | okonet/lint-staged | lint-staged |
-
Add the package as a dev dependency in your project:
yarn add -D @danielpes/coding-standards
This should already add Husky, Prettier and similar required dependencies to node_modules, so there should be no need to keep them in devDependencies.
-
Point each of the desired configuration files in your project to the shared config:
.huskyrc.jsmodule.exports = require("@danielpes/coding-standards/config/husky");
.lintstagedrc.jsmodule.exports = require("@danielpes/coding-standards/config/lintstaged");
.prettierrc.jsmodule.exports = require("@danielpes/coding-standards/config/prettier");
.commitlintrc.jsmodule.exports = require("@danielpes/coding-standards/config/commitlint");
See the GitHub repository root README file.