0.1.3 • Published 4 years ago

tslint-staged v0.1.3

Weekly downloads
223
License
MIT
Repository
github
Last release
4 years ago

TSLint-Staged

Run TSLint against staged git files only !

Used as git hook, it will run fast by not running on all of your project files !

Important note !!!

TSLint will be depreciated in a near future to move to ESLint !

Lint-staged gives you the same feature and more for ESLint and Prettier.

Install & configuration

npm install --save-dev tslint-staged

TSLint-Staged configuration holds directly in your package.json :

{
  ...,
  "tslintStaged": {
    "tslintConfig": "tslint.json",
    "include": [ "**/*.ts" ],
    "exclude": []
  },
  ...
}

tslint_config specify the path of your own tslint.json configuration file.

include and exclude allow you to filter analysed files. TSLint-Staged uses micromatch for matching files. You can use wild cards as *, ** and more !

You can now run TSLint-Staged :

npm run tslint-staged

Use it as a hook with Husky

The most usefull way to use TSLint-staged is to use it as a pre-commit/pre-push hook !

{
  ...,
  "husky": {
    "hooks": {
      "pre-commit": "tslint-staged"
    }
  },
  ...
}