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
Error: VariableDeclarator ASTNodes are not handled by markPropTypesAsUsed #2319
Comments
Can you share the code that produce the bug? |
Here's one example: import {Panel, PanelContainer} from "../../components/utility";
import PropTypes from "prop-types";
import React from "react";
import RoundTable from "./round/round-table";
import {ScoreTable} from "./scores";
export default function Status({tournament}) {
const {tourney, getPlayer} = tournament;
const lastRound = (function () {
if (tourney.roundList.length === 0) {
return <p>No rounds played yet.</p>;
}
const lastRoundId = tourney.roundList.length - 1;
if (tourney.roundList[lastRoundId].length === 0) {
return (
<p>Matched players in the current round will be shown here.</p>
);
}
return (
<RoundTable
roundId={lastRoundId}
tournament={tournament}
compact
/>
);
}());
return (
<>
<h2 style={{textAlign: "center"}}>Tournament status</h2>
<PanelContainer
style={{justifyContent: "center"}}
>
<Panel>
{lastRound}
</Panel>
<Panel>
<ScoreTable
getPlayer={getPlayer}
title="Rankings"
tourney={tourney}
compact
/>
</Panel>
</PanelContainer>
</>
);
}
Status.propTypes = {
tournament: PropTypes.object.isRequired
}; If I remove the line |
I started getting this error today also, with a very similar example to yours. |
I opened a pr on this. A minimal reproducing example is: /* react/prop-types: 2 */
const PropTypes = require('prop-types');
function Foo({a}) {
const {b} = a;
return <p>{b.nope}</p>;
}
Foo.propTypes = {
a: PropTypes.shape({
b: PropTypes.shape({
_: PropTypes.string,
}),
}),
}; |
afc163
added a commit
to ant-design/ant-design
that referenced
this issue
Jun 24, 2019
What version of eslint? |
chenshuai2144
added a commit
to umijs/fabric
that referenced
this issue
Jun 24, 2019
This was referenced Jun 24, 2019
martinpitt
added a commit
to martinpitt/cockpit
that referenced
this issue
Jun 24, 2019
7.14.0 has a grave bug which breaks our build: jsx-eslint/eslint-plugin-react#2319 Until the fix is released, pin down to the previous version.
martinpitt
added a commit
to cockpit-project/cockpit
that referenced
this issue
Jun 24, 2019
7.14.0 has a grave bug which breaks our build: jsx-eslint/eslint-plugin-react#2319 Until the fix is released, pin down to the previous version. Closes #12136
This was referenced Jun 24, 2019
This was referenced Jun 24, 2019
sunu
added a commit
to alephdata/aleph
that referenced
this issue
Jun 24, 2019
Lock version till jsx-eslint/eslint-plugin-react#2319 is fixed
wichert
added a commit
to Crypho/eslint-config-crypho
that referenced
this issue
Jun 24, 2019
This was referenced Jun 24, 2019
This was referenced Sep 22, 2019
fonghehe
pushed a commit
to fonghehe/fabric
that referenced
this issue
Apr 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ESLint started crashing with this error shortly after I upgraded to 7.14.0.
I suspect it's related to prop destructuring. I tried opening different JSX files and ESLint didn't seem to have a problem except for files with components that destructure their props.
Full error log:
The text was updated successfully, but these errors were encountered: