Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

awebdeveloper/pre-commit-tslint

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/
        rev: ''  # Use the sha or tag you want to point at
        hooks:
        -   id: tslint
            additional_dependencies: ['tslint@5.0.0']

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.

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

About

Integration of tslint with pre-commit

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.