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.
- Run
pre-commit installfrom the root of your project
Finally add this to your .pre-commit-config.yaml:
- repo: git://github.com/awebdeveloper/pre-commit-tslint/rev: ''# Use the sha or tag you want to point athooks: - id: tslintadditional_dependencies: ['[email protected]']PS: These are for version 2.3.0 visit https://pre-commit.com/#2-add-a-pre-commit-configuration for latest config syntax or for config syntax specific to your version
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 asadditional_dependenciesTo check type or if linter complaints of type include the following args (but this will slow down your commit)
hooks: - id: tslintargs: ['--project','tsconfig.json','--type-check']For pre-commit: see https://github.com/pre-commit/pre-commit
For stylelint: see https://github.com/palantir/tslint