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

后端 未结 8 755
盖世英雄少女心
盖世英雄少女心 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:25

    I am using typescript": "2.9.1" with tslint": "^5.10.0.

    I was getting tons of error such as

    Property 'logger' is declared but its value is never read.
    

    Also, I observed that I was getting a warning when running ng-lint

    $> ng lint
    no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
    

    So, I removed the no-unused-variable rule fromt tslint.json - and that seems to solve the problem for me.

提交回复
热议问题