vue tslint報錯: Calls to 'console.log' are not allowed


使用Vue CLI 3 的 vue create 創建vue+ts 項目,使用默認配置, 控制台報警告Calls to 'console.log' are not allowed,解決

在tslint.json中的rules下 添加: "no-console": false。無需向在tsling.config中添加"extends":"./tslint.config"。重啟服務,搞定。

附tslint.json文件:

 
{
  "defaultSeverity": "warning", "extends": [ "tslint:recommended" ], "linterOptions": { "exclude": [ "node_modules/**" ] }, "rules": { "quotemark": [true, "single"], "indent": [true, "spaces", 2], "interface-name": false, "ordered-imports": false, "object-literal-sort-keys": false, "no-consecutive-blank-lines": false, "max-line-length": [ false ], "no-console": false } }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM