0
点赞
收藏
分享

微信扫一扫

Angular+Typescript use console error

大沈投资笔记 2022-03-22 阅读 40
angular.js

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

{
  "plugins": ["@typescript-eslint/tslint"],
  "extends": ["jhipster"],
  "parserOptions": {
    "project": "./tsconfig.base.json"
  },
    "rules": {
        "@typescript-eslint/tslint/config": [
            "error",
            {
                "lintFile": "./tslint.json"
            }
        ],
        "@typescript-eslint/no-unused-vars": [
            "warn",
            {
                "vars": "all",
                "args": "after-used",
                "ignoreRestSiblings": false
            }
        ],
        "@typescript-eslint/no-non-null-assertion": "off",
        "no-console": "off",
        "@typescript-eslint/no-inferrable-types": "off"
    }
}

修改文件:.eslintrc.json

FYI: Type string trivially inferred from a string literal, remove type annotation @typescript-eslint/no-inferrable-types - 爱放屁的菜鸟 - 博客园

举报

相关推荐

0 条评论