[英]eslint-config-react-app throws Definition for rule 'getter-return' was not found
I've just applied https://www.npmjs.com/package/eslint-config-react-app to my project. 我刚刚将https://www.npmjs.com/package/eslint-config-react-app应用于我的项目。
For almost each file I get this error 对于几乎每个文件,我都会收到此错误
1:1 warning Definition for rule 'getter-return' was not found getter-return
1:1警告未找到规则“ getter-return”的定义getter-return
Based on docs, I cannot figure out what I'm doing wrong. 根据文档,我无法弄清楚我在做什么错。 I can disable this rule and get rid of warnings, but I would like to know what is wrong with the code.
我可以禁用此规则并摆脱警告,但是我想知道代码出了什么问题。
Sample file that has this error: 有此错误的示例文件:
import React from 'react';
import { SomeProvider } from 'common/components';
import ButtonHOC from './ButtonHOC';
const Button = props => {
return (
<SomeProvider>
<ButtonHOC {...props} />
</SomeProvider>
);
};
export default Button;
I had a similar issue. 我有一个类似的问题。
Try updating eslint
- most likely you have a rule definition that's only included in a newer version of eslint. 尝试更新
eslint
最有可能您有一个规则定义,该规则定义仅包含在较新的eslint版本中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.