简体   繁体   English

eslint-config-react-app throws找不到规则“ getter-return”的定义

[英]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.

相关问题 Atom &amp; eslint:找不到模块 'eslint-config-react-app' - Atom & eslint: Cannot find module 'eslint-config-react-app' eslint-config-react-app 无效 属性“覆盖”是错误的类型 - eslint-config-react-app is invalid Property “overrides” is the wrong type (ESLint)在VS 2017 react项目中找不到模块&#39;eslint-config-react-app&#39; - (ESLint) Cannot find module 'eslint-config-react-app' in VS 2017 react project create-react-app 版本 5 的“eslint-config-react-app”问题 - "eslint-config-react-app" issue with create-react-app version 5 插件“react”在“package.json » eslint-config-react-app 之间发生冲突 - Plugin "react" was conflicted between "package.json » eslint-config-react-app 部署 React 应用程序时出错,它一直在说 &lt;&lt; Plugin "react" was conflicted between "package.json » eslint-config-react-app » &gt;&gt; - Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >> 如何解决这个错误:package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown - How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown 无法加载在“package.json » eslint-config-react-app”中声明的插件“jsx-a11y”:意外的令牌 = - Failed to load plugin 'jsx-a11y' declared in 'package.json » eslint-config-react-app': Unexpected token = 无法加载在“package.json » eslint-config-react-app”中声明的插件“flowtype”:找不到模块“eslint/use-at-your-own-risk” - Failed to load plugin 'flowtype' declared in 'package.json » eslint-config-react-app': Cannot find module 'eslint/use-at-your-own-risk' 执行导入 React 时,总是在 Eslint (v 6.0.0) 中找到“未找到规则 &#39;no-useless-catch&#39; 的定义” - Always getting 'definition for rule 'no-useless-catch' was not found' in Eslint (v 6.0.0) when doing import React
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM