How to lint entire folder using tslint

后端 未结 3 1476
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 00:14

Is that possible to lint entire folder using tslint?

Using eslint it is possible to do eslint ./src to validate whole folder.

When i try to do

3条回答
  •  盖世英雄少女心
    2020-12-24 00:56

    If your project has a tsconfig.json you can aproach --project advange.

    In my case I have a nativescript project wich includes a tsconfig.json at project root, so I have this:

    Note that in the json 'node_modules' and 'platforms' directories are excluded. This means that all files in the project are going to be mapped except 'node_modules' and 'platforms' directories.

    I have added this scripts at my package.json, 'tslint' to log the errors and 'tslint-fix' to fix the errors.

    "scripts": {
        "tslint": "tslint -p tsconfig.json",
        "tslint-fix": "tslint --fix -p tsconfig.json"
    }
    

提交回复
热议问题