generator-typescript-best-practices is a Yeoman generator for creating a TypeScript project with strict linting. This includes the following
- commitlint to enforce conventional commits
- husky for handling Git hooks. The
following hooks are installed:
- pre-commit hook for formatting staged code and verifying that commit messages adheres to conventional commits
- pre-push hook for running linting and verifying test coverage
- Prettier for formatting
- import-sort for sorting imports as part of formatting process
- Eslint for linting
- eslint-plugin-sonarjs for code analysis as part of linting
- eslint-plugin-unicorn for powerful linting rules
- TypeScript parser for allowing Eslint to parse TypeScript
- lint-staged for only linting staged files to avoid formatting whole project as part of pre-commit hook
- Standard Version for automated releases
- TypeScript if not already installed
Before using this generator, the NPM package must be installed on the local machine. A global install can be accomplished using
npm i -g generator-typescript-best-practices
To scaffold an existing project, navigate to a TypeScript repository where Git and NPM already have been initialized and run
npx yo typescript-best-practices
See the contribution guide.