[Bug]: cannot recognize propTypes as Class static props using @babel/[email protected] #13906
Labels
area: downstream
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
💻
How are you using Babel?
@babel/eslint-parser
Input code
Configuration file name
babel.config.js
Configuration
Current and expected behavior
eslint throw an error
error 'test' is missing in props validation react/prop-types
It should be no error, because
test
props defined in propTypesIt will pass if I define propTypes as follow:
Environment
System:
OS: macOS 11.6
Binaries:
Node: 16.12.0 - /usr/local/bin/node
npm: 8.1.0 - /usr/local/bin/npm
npmPackages:
@babel/cli: ^7.16.0 => 7.16.0
@babel/core: ^7.16.0 => 7.16.0
@babel/eslint-parser: ^7.16.0 => 7.16.0
@babel/plugin-proposal-decorators: ^7.16.0 => 7.16.0
@babel/plugin-transform-runtime: ^7.16.0 => 7.16.0
@babel/preset-env: ^7.16.0 => 7.16.0
@babel/preset-react: ^7.16.0 => 7.16.0
@babel/preset-typescript: ^7.16.0 => 7.16.0
@babel/runtime: ^7.16.0 => 7.16.0
babel-jest: ^27.3.1 => 27.3.1
babel-preset-const-enum: ^1.0.0 => 1.0.0
eslint: ^8.1.0 => 8.1.0
jest: ^27.3.1 => 27.3.1
Possible solution
I don't know this bug belongs to eslint or @babel/eslint-parser,but I just upgrade @babel/eslint-parser, and do nothing with eslint config or update eslint npm packages.
Additional context
After update @babel/eslint-parser from v7.15.8 to v7.16.0
Eslint rule react/prop-types failed
I tried to install @babel/[email protected],eslint rules passed
The text was updated successfully, but these errors were encountered: