2016-05-06 90 views
0

我有很多來自eslint的冗餘和奇怪的輸出,我不知道如何禁用它。在下面的屏幕截圖中,您可以看到每個文件中有5或6個重複問題與代碼的實際問題無關。Eslint冗餘警告

enter image description here

例如第一每一個文件的行包含此警告。

Rule 'no-reserved-keys' was removed and replaced by: quote-props 

在.eslintrc規則quote-props被禁用。

"quote-props": 0 

但沒有啓用,被保留的密鑰規則,而

"no-reserved-keys": 1 

他們additionalRuleMetadata部分定義:

"no-reserved-keys": { 
    "severity": "w", 
    "help": "http://eslint.org/docs/rules/no-reserved-keys", 
    "priority": "major", 
    "category": "Possible Error" 
}, 

"quote-props": { 
    "severity": "i", 
    "help": "http://eslint.org/docs/rules/quote-props", 
    "category": "Stylistic Issue" 
}, 

所以,問題是。如何擺脫這些多餘的警告?

回答

1

看來您正在定義ESLint 1.0規則,但使用的是ESLint 2.0。

按照ESLint docs for no-reserved-keys

更換通告:在ESLint V1.0,刪除了此規則,並通過報價道具規則所取代。

您可以刪除您ESLint配置no-reserved-keys規則,但離開quote-props因爲是和冗餘的警告應該消失。

的情況也是如此:

  • space-return-throw-case
  • no-wrap-func
  • global-strict
  • no-empty-label

每一個與你所看到的警告中提到的規則所取代。更多關於migrating to ESLint 2.0的信息。

+0

是否有任何可能只是關閉這樣的警告?看來,我不能只是重寫規則文件。 – QuestionAndAnswer

+0

爲什麼你不能重寫規則文件?你可以創建一個個人配置文件來擴展規則文件嗎? –