![](/img/trans.png)
[英]Atom & eslint: Cannot find module 'eslint-config-react-app'
[英]eslint-config-react-app throws Definition for rule 'getter-return' was not found
我剛剛將https://www.npmjs.com/package/eslint-config-react-app應用於我的項目。
對於幾乎每個文件,我都會收到此錯誤
1:1警告未找到規則“ getter-return”的定義getter-return
根據文檔,我無法弄清楚我在做什么錯。 我可以禁用此規則並擺脫警告,但是我想知道代碼出了什么問題。
有此錯誤的示例文件:
import React from 'react';
import { SomeProvider } from 'common/components';
import ButtonHOC from './ButtonHOC';
const Button = props => {
return (
<SomeProvider>
<ButtonHOC {...props} />
</SomeProvider>
);
};
export default Button;
我有一個類似的問題。
嘗試更新eslint
最有可能您有一個規則定義,該規則定義僅包含在較新的eslint版本中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.