interface name must start with a capitalized I

最近尝试使用ts编辑react组件,却发现interface报错,解决方案为:

在tslint.json中添加:

"rules": {
  "interface-name" : [true, "never-prefix"]
}

整个json文件最后的代码为:

{
  "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
  "interface-name": [true, "never-prefix"],
  "linterOptions": {
    "exclude": [
      "config/**/*.js",
      "node_modules/**/*.ts",
      "coverage/lcov-report/*.js"
    ]
  },
  "rules": {
    "interface-name" : [true, "never-prefix"]
  }
}

你可能感兴趣的:(前端)