Pre-commit hook for TSlint
This is the TSlint hook for pre-commit. This prevents git commits unless the checks pass.
- To use this you first need to install pre-commit(see links below).
- Then create a pre-commit config file and also the linter config file in the root of your project.
pre-commit installfrom the root of your project
Finally add this to your
- repo: git://github.com/awebdeveloper/pre-commit-tslint/ sha: '' # Use the sha or tag you want to point at hooks: - id: tslint additional_dependencies: ['email@example.com']
Now everytime you commit a ts file. It will run tslint on this and prevent commit if the checks fail.
To use with
tslint-eslint-rulesinclude it as
To check type or if linter complaints of type include the following args (but this will slow down your commit)
hooks: - id: tslint args: ['--project','tsconfig.json','--type-check']