What is the “as syntax” pointed out by tslint?

前端 未结 2 1328
故里飘歌
故里飘歌 2020-12-03 13:33

I upgraded tslint and now it complains about:

ERROR: src/Metronome/JobFetcher.ts[13, 32]: Type assertion using the \'<>\' syntax is forbidden. Use the          


        
2条回答
  •  执笔经年
    2020-12-03 14:09

    If you want to suppress the error, you can as well go to tslint.json and include

    ...
    "rules": {
        "no-angle-bracket-type-assertion": false,
        ...
    }
    ...
    

    provided you don't mind consistence as said.

提交回复
热议问题