Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: react/prop-types rule failed when using @babel/eslint-parser@7.16.0 #15237

Closed
1 task
lyz810 opened this issue Nov 1, 2021 · 2 comments
Closed
1 task
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly
Projects

Comments

@lyz810
Copy link

lyz810 commented Nov 1, 2021

Environment

Environment Info:

Node version: v16.12.0
npm version: v8.1.0
Local ESLint version: v8.1.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 20.6.0

What parser are you using?

@babel/eslint-parser

What did you do?

Configuration
{
// ...
 extends: ['eslint-config-airbnb'],
  parser: '@babel/eslint-parser',
  parserOptions: {
    babelOptions: {
      configFile: path.join(__dirname, './babel.config.js'),
    },
  },
// ...
}
import React from 'react';
import PropTypes from 'prop-types';

class A extends React.PureComponent {
  static propTypes = {
    test: PropTypes.string.isRequired,
  };

  render() {
    const { test } = this.props;
    return (<div>{test}</div>);
  }
}

export default A;

What did you expect to happen?

no eslint error

What actually happened?

error 'test' is missing in props validation react/prop-types

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

This error appears when I upgrade @babel/eslint-parser from v7.15.8 to v7.16.0
I don't know which npm package causes this bug, so I report it in both eslint an @babel/eslint-parser
You can find more information at follow link:
https://github.com/babel/babel/issues/13906

@lyz810 lyz810 added bug ESLint is working incorrectly repro:needed labels Nov 1, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Nov 1, 2021
@lyz810 lyz810 changed the title Bug: (fill in) react/prop-types rule failed when using @babel/eslint-parser Bug: react/prop-types rule failed when using @babel/eslint-parser@7.16.0 Nov 1, 2021
@aladdin-add
Copy link
Member

related: jsx-eslint/eslint-plugin-react#3055

eslint-plugin-react does not support eslint v8 yet. please keep using eslint v7 util it fully supports.

@aladdin-add aladdin-add added 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser and removed repro:needed labels Nov 1, 2021
@aladdin-add aladdin-add moved this from Needs Triage to Blocked in Triage Nov 1, 2021
@nzakas
Copy link
Member

nzakas commented Nov 2, 2021

Closing as this is not an issue with ESLint.

@nzakas nzakas closed this as completed Nov 2, 2021
Triage automation moved this from Blocked to Complete Nov 2, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 2, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

3 participants