0.1.3 • Published 5 years ago
tslint-staged v0.1.3
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-stagedTSLint-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-stagedUse 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"
}
},
...
}