lite-lint

lite-lint is a tool to ease the long time waiting for tslint/eslint in a big project. tslint(or eslint) just lint what you configed, so if you set the whole project to lint, maybe you will wait for a long time. But infact, there is no need to lint every file, instead just lint what you modified will speed up lint progress. It's just what lite-lint does, use git status -s to collect files modified and then lint them. lite-lint only work for repository with git.

Usage no npm install needed!

<script type="module">
  import liteLint from 'https://cdn.skypack.dev/lite-lint';
</script>

README

lite-lint

lite-lint is a tool to ease the long time waiting for tslint/eslint in a big project. tslint(or eslint) just lint what you configed, so if you set the whole project to lint, maybe you will wait for a long time. But infact, there is no need to lint every file, instead just lint what you modified will speed up lint progress. It's just what lite-lint does, use git status -s to collect files modified and then lint them. lite-lint only work for repository with git.

How to use

install

Use npm install -save-dev lite-lint to install or put "lite-lint": "^1.0.2", in your package.json.

configure

Just config in you package.json as bellow: for tslint:

...
"liteLint": {
    "type": "ts",
    "patterns": [
        "src/**",
        "sample/**"
    ]
},
...

for eslint:

...
"liteLint": {
    "type": "es",
    "patterns": [
        "src/**"
    ],
    "showWarning": true
},
...

type

Whitch lint you want to use, "ts" for tslint, or "es" for eslint.

patterns

The pathes you want lite-lint to check, It's an array of pattern. lite-lint will take each path of modifed file to match every pattern, if one pattern matched, the file will be lint.

[showWarning]

A boolean value to console out warning informations of lint. false by default.

[configFile]

The path of lint config file. lite-lint will use tslint.json for tslint and use .eslintrc for eslint as default. This option is only work for tslint.

[fileTypes]

By default, lite-lint only lint .ts and .tsx files for tslint, andonly lint .js files for eslint. But you still can use fileTypes to config this behavior, it's a string separated by commas, for example "ts,tsx".