如何修复规则' sap -....'的eslint定义?没找到?

时间:2017-02-02 07:02:32

标签: sap webstorm eslint

我使用SAP eslint配置并拥有所有配置文件但仍然出现此错误:

enter image description here

有什么建议吗?

PS:我正在使用WebStorm

配置:

{
  "env": {
    "browser": true
  },
  "globals": {
    "sap": true,
    "jQuery": true
  },
  "rules": {
    "sap-no-localhost": 2,
    "sap-no-ui5base-prop": 2,
    "sap-usage-basemastercontroller": 2,
    "sap-no-dom-access": 2,
    "sap-no-global-selection": 2,
    "sap-timeout-usage": 2,
    "sap-no-history-manipulation": 2,
    "sap-no-ui5-prop-warning": 2,
    "sap-no-proprietary-browser-api": 2,
    "no-use-before-define": 2,
    "no-redeclare": 2,
    "no-extra-boolean-cast": 2,
    "no-shadow": 2,
    "no-reserved-keys": 2,
    "no-unused-vars": [2, {"vars": "all", "args": "none"}],
    "no-extend-native": 2,
    "no-eq-null": 2,
    "eqeqeq": 2,

    "no-underscore-dangle": 0,
    "new-cap": 0,
    "quotes": 0,
    "camelcase": 0,
    "eol-last": 0
  }
}

1 个答案:

答案 0 :(得分:0)

根据您提供的配置,SAP规则使用过时的custom-rules方法而不是插件。您必须下载所有SAP规则,将它们放在目录中并配置WebStorm以使用--rulesdir开关运行ESLint。