代码之家  ›  专栏  ›  技术社区  ›  Hemadri Dasari

如何运行tslint.json?

  •  2
  • Hemadri Dasari  · 技术社区  · 6 年前

    我是打字新手。我有 tslint.json 文件已创建,但不知道如何使用命令行运行此文件。请告知我需要使用哪个命令来运行此配置

    1 回复  |  直到 6 年前
        1
  •  9
  •   Quentin    6 年前

    tslint.json 是TSLint配置文件。它需要全球 tslint

    npm i -g tslint
    

    在这种情况下,TSLint可以从命令行执行为

    或本地安装:

    npm i tslint
    

    "scripts": { "lint": "tslint" }
    

    并被执行为 npm run lint .

    作为 tslint --help

    -c, --config:
        The location of the configuration file that tslint will use to
        determine which rules are activated and what options to provide
        to the rules. If no option is specified, the config file named
        tslint.json is used, so long as it exists in the path.
    

    tslint.json文件