导出typescript接口会产生eslint错误

时间:2018-03-15 12:33:57

标签: typescript eslint

的package.json:

"eslint": "^4.16.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-import-resolver-typescript": "^1.0.2",
"eslint-plugin-eslint-comments": "^2.0.2",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-typescript": "^0.10.0",
"typescript": "^2.7.2",
"typescript-eslint-parser": "^14.0.0"

.eslintrc.js

module.exports = {
  "env": {
    "browser": false,
  },
  "parser": "typescript-eslint-parser",
  "plugins": ["typescript"],
  "settings": {
    "import/resolver": {
      "node": true,
      "eslint-import-resolver-typescript": true
    }
  }
};

在WebStorm 2017.3中仍然无法在没有警告的情况下导出typescript接口:

enter image description here

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

您可以尝试将此添加到您的eslint配置吗?

overrides: {
  files: ['**/*.ts'],
  parser: 'typescript-eslint-parser',
  rules: {
   'no-undef': 'off'
}