tslint how to disable error “someVariable is declared but its value is never read ”

后端 未结 8 921
盖世英雄少女心
盖世英雄少女心 2021-02-02 05:05

I\'m using tslint, and got the error.

\'myVariable\' is declared but its value is never read.

I went to the website that documents the rules

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 05:24

    Extend the tsconfig.json with dev.tsconfig.json

    And run the command tsc -p ./dev.tsconfig.json

    This will deisable the unused variable and unused parameter in development

    Inside dev.tsconfig.json:

    {
      "extends": "./tsconfig.json",
      "compilerOptions": {
        "noUnusedLocals": false,
        "noUnusedParameters": false,
       }
    }
    

提交回复
热议问题