https://github.com/chilijung/tslint-gitstaged
lint only git staged typescript files
https://github.com/chilijung/tslint-gitstaged
git git-staged tslint typescript
Last synced: about 2 months ago
JSON representation
lint only git staged typescript files
- Host: GitHub
- URL: https://github.com/chilijung/tslint-gitstaged
- Owner: chilijung
- License: mit
- Created: 2017-06-28T10:32:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T14:45:48.000Z (over 8 years ago)
- Last Synced: 2025-04-07T15:34:47.411Z (about 1 year ago)
- Topics: git, git-staged, tslint, typescript
- Language: TypeScript
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tslint-gitstaged
**Please use v5.4.3 or higher version of tslint**
Using **current git status** to find out modfied and added files passing tslint, to prevent lint the whole repository again and again. This is a nice package to use along with `git precommit`.
## Install
```
npm install tslint-gitstaged
```
## Command line usage
Install global
```
npm i -g tslint-gitstaged
```
Usage
```
Usage: tslintgs [options] [command]
Commands:
help Display help
Options:
-e, --ext [value] extension names, can use multiple extensions seperate with comma (defaults to "ts,tsx")
-g, --git [value] your git directory, where your .git exist (defaults to "./")
-h, --help Output usage information
-t, --tslint [value] tslint.json file path (defaults to "./tslint.json")
-v, --version Output the version number
```
## API
### TslintGitStaged(tslintrcPath, gitPath, extension)
- tslintrcPath: path to your tslintrc file
- gitPath: path to your `.git`
- extension `string | string[]`: which kind of extensions do you want to lint with tslint.
## Usage
```js
// TslintGitStaged(, , )
new TslintGitStaged(resolve(__dirname, "./tslint.json"), resolve(__dirname, "../"), ".ts").start()
.then((result) => {
// success no lint error, done lint
})
.catch((err) => {
// err, when lint failed
});
```
## Eslint users
- https://github.com/Canner/eslint-gitstaged
## License
MIT