Do you wanna use tslint and prettier without conflicts? tslint-config-prettier disables all conflicting rules that may cause such problems. Prettier takes care of formatting and tslint the rest.
npm install -D tslint-config-prettier
Make sure you've already set up tslint and prettier.
Then, extend your tslint.json
, and make sure tslint-config-prettier
is at the end:
{
"extends": [
"tslint:latest",
"tslint-config-prettier"
]
}
tslint-config-prettier
also turns off formatting rules from the following rulesets, so you can use them safely.
- codelyzer
- tslint
- tslint-consistent-codestyle
- tslint-divid
- tslint-eslint-rules
- tslint-immutable
- tslint-microsoft-contrib
- tslint-misc-rules
- tslint-plugin-ikatyang
- tslint-react
- vrsource-tslint-rules
{
"extends": [
"tslint:latest",
"tslint-react",
"tslint-eslint-rules",
"tslint-config-prettier"
]
}
tslint-config-prettier
also ships with a little CLI tool to help you check if your configuration contains any rules that are conflict with Prettier. (require tslint
installed)
First, add a script for it to package.json
:
{
"scripts": {
"tslint-check": "tslint-config-prettier-check ./tslint.json"
}
}
Then run npm run tslint-check
.
# Fork repo
git clone https://github.com/YOUR-USERNAME/tslint-config-prettier
npm install
This project uses semantic-release to keep a clean CI/CD pipe.
So, you only will be required to follow conventional-commit messages. Everything else happens magically.
- tslint-plugin-prettier - Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.
Made with โค๏ธ by @alexjoverm and all its contributors