Type string trivially inferred from a string literal, remove type annotation @typescript-eslint/no-inferrable-types


我使用的是 vue3 + typescript + eslint
解决方法
在.eslintrc.js文件的rules 增加一行  "@typescript-eslint/no-inferrable-types": "off" // 关闭类型推断

rules: {
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    "@typescript-eslint/no-inferrable-types": "off" // 关闭类型推断
  }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM