@ts-dev-tools/core
Version:
TS dev tools Core
105 lines (66 loc) โข 3.98 kB
Markdown
[](https://escemi-tech.github.io/ts-dev-tools/)
[](https://www.npmjs.com/package/@ts-dev-tools/core) [](https://github.com/escemi-tech/ts-dev-tools/actions?query=workflow%3A%22Continuous+Integration%22) [](https://codecov.io/gh/escemi-tech/ts-dev-tools) [](CONTRIBUTING) [](https://github.com/sponsors/neilime) [](https://github.com/escemi-tech/ts-dev-tools)
# Welcome to @ts-dev-tools/core ๐
## Common Typescript dev tools
---
## What's included
### ๐ฆ Package scripts
- `test`: Run tests with [jest](https://jestjs.io/)
- `lint`: Run linter with [eslint](https://eslint.org/)
- `prepare`: Self install / update
### โก Git hooks
#### `pre-commit`
- Run linter against staged git files with [lint-staged](https://github.com/okonet/lint-staged)
- Run prettier against changed files with [pretty-quick](https://github.com/azz/pretty-quick#readme)
#### `commit-msg`
- Lint [conventional commit](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional) message with [commit-lint](https://conventional-changelog.github.io/commitlint/)
#### `pre-push`
- Run linter
- Execute Typescript compiler with [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
- Run tests
### ๐ Linter
- Install and configure [eslint](https://eslint.org/) with recommended [rules](https://eslint.org/docs/rules/)
- Configure Eslint to works with [typescript](https://github.com/typescript-eslint/typescript-eslint#readme)
- Install and configure the following Eslint plugins:
- [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import): ES2015+ (ES6+) import/export syntax
- [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest#readme): Rules for Jest
- [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node#readme): Additional ESLint's rules for Node.js
- [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise#readme): Enforce best practices for JavaScript promises.
### ๐ Prettier
- Install and configure [Prettier](https://prettier.io/)
- Configure Prettier to works with [Eslint](https://github.com/prettier/eslint-config-prettier)
- Install and configure the following Prettier plugins:
- [prettier-plugin-import-sort](https://github.com/ggascoigne/prettier-plugin-import-sort#readme): sort imports using [import-sort](https://github.com/renke/import-sort) for javascript and typescript files.
### ๐งช Tests
- Install and configure [Jest](https://jestjs.io/)
- Install and configure [ts-jest](https://kulshekhar.github.io/ts-jest) to make Jest and Typescript work together
### ๐ Types
- [@types/node](https://www.npmjs.com/package/@types/node)
- [@types/jest](https://www.npmjs.com/package/@types/jest)
---
## Usage
### _1_. Install
```sh
npm install --save-dev @ts-dev-tools/core
```
Or
```sh
yarn add --dev @ts-dev-tools/core
```
Or
```sh
pnpm add -D @ts-dev-tools/core
```
### _2_. Enable ts-dev-tools
```sh
npm exec ts-dev-tools install
```
Or
```sh
yarn ts-dev-tools install
```
Or
```sh
pnpm ts-dev-tools install
```
โ ๏ธ If your package is using yarn, is not private and you're publishing it on a registry like npmjs.com, you need to disable postinstall script using [pinst](https://github.com/typicode/pinst). Otherwise, postinstall will run when someone installs your package and result in an error.