Skip to content

LauraBonmati/tslint-config-prettier

 
 

Repository files navigation

tslint-config-prettier

npm Travis downloads David David Greenkeeper badge

👮 tslint + 💅 prettier = 😍

Do you want to use tslint and prettier without conflicts? tslint-config-prettier disables all conflicting rules that may cause such problems. Prettier takes care of the formatting whereas tslint takes care of all the other things.

Get started

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"
  ]
}

More configuration

tslint-config-prettier also turns off formatting rules from the following rulesets, so you can use them safely.

{
  "extends": [
    "tslint:latest",
    "tslint-react",
    "tslint-eslint-rules",
    "tslint-config-prettier"
  ]
}

CLI helper tool

tslint-config-prettier is shipped with a little CLI tool to help you check if your configuration contains any rules that are in conflict with Prettier. (require tslint installed)

In order to execute the CLI tool, first add a script for it to package.json:

{
  "scripts": {
    "tslint-check": "tslint-config-prettier-check ./tslint.json"
  }
}

Then run npm run tslint-check.

Contributing

# 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, the only requirement is to follow conventional-commit messages. Everything else happens magically.

Related

  • tslint-plugin-prettier - Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

Credits

Made with ❤️ by @alexjoverm and all its contributors

About

Use tslint with prettier without any conflict

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 96.6%
  • JavaScript 3.4%