Typescript Best Practices
Package Management
This project uses npm for package management.
Code Quality and Format
This project uses eslint to check code style and quality. The configured eslint rules can be found in the project's .eslintrc.js file.
To check the configured linting, run npm run lint.
Code Auditing
This project uses audit-ci to run a security audit on the package dependency
tree. This must pass prior to merge. The configured rules for audit-ci can be
found here.
To execute an audit, run npm run audit.
Code Testing and Coverage
Unit testing leverages ava. To perform unit tests,
run the <REPO ROOT DIR>/node_modules/.bin/ava command. This command is usually
aliased to test in the package.json file scripts section. Once aliased, to
run code coverage on an individual package during development, run npm run test.
Code coverage is checked using nyc. Generally
code coverage is checked using the command <REPO ROOT DIR>/node_modules/.bin/nyc npm test.
The command is usually aliased to test:coverage in the package.json file scripts
section. Once aliased, to run code coverage on an individual package during development, run
npm run test:coverage. This will output the coverage in the terminal. To create an html
report, run nyc report --reporter html and open the index.html file in the coverage folder.
Code Documentation
It is expected that whenever possible the code functionality should be documented via a README that includes critical usage and development information such as inputs, outputs, internal and external dependencies, use cases, and critical development information. In addition, the README markdown file should utilize the proper template and conform with markdown quality standards.