Integration of tslint with pre-commit
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore Tslint init commit Mar 22, 2017
.npmignore Tslint init commit Mar 22, 2017
.pre-commit-hooks.yaml Update .pre-commit-hooks.yaml Apr 15, 2017
.version Tslint init commit Mar 22, 2017
LICENSE Initial commit Mar 22, 2017
README.md Update README.md May 24, 2017
package.json Tslint init commit Mar 22, 2017

README.md

Pre-commit hook for TSlint

This is the TSlint hook for pre-commit. This prevents git commits unless the checks pass.

Usage

  • 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 install from the root of your project

Finally add this to your .pre-commit-config.yaml:

    -   repo: git://github.com/awebdeveloper/pre-commit-tslint/
        sha: ''  # Use the sha or tag you want to point at
        hooks:
        -   id: tslint
            additional_dependencies: ['tslint@5.0.0']

Now everytime you commit a ts file. It will run tslint on this and prevent commit if the checks fail.

FAQs

  • To use with tslint-eslint-rules include it as additional_dependencies

  • 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']

Links