Closed crnhrv closed 1 month ago
Thanks - we'd need a regression test in order to land this tho.
@ljharb I've attempted to add some regression tests by trying to find a minimal reproduction. I think the issue relates to using ReturnType<typeof object>
for the type parameter for a component, but I don't really know the details.
I get the expected failure without the nullcheck:
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.76%. Comparing base (
417e1ca
) to head (f877a50
).:exclamation: Current head f877a50 differs from pull request most recent head e27ef81
Please upload reports for the commit e27ef81 to get more accurate results.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I see that code coverage is failing on some indirect changes related to code beneath a node.type === 'TSParenthesizedType'
conditional. Not sure why that would happen, but is this code actually necessary since TSParenthesizedType
seems to no longer be generated as a node type?
@crnhrv that PR seems to be in v5 of the parser, but we still support down to v2
Cool, thanks for the help. Will leave it with you then
I'm getting this error while linting some valid React/TS code after upgrading to the latest version (
7.34.2
):Stack trace
``` Oops! Something went wrong! :( ESLint: 8.57.0 TypeError: Missing required argument: node. Occurred while linting ./OptionsTable.tsx:599 Rule: "react/display-name" at SourceCode.getScope (./node_modules/eslint/lib/source-code/source-code.js:773:19) at getScope (./node_modules/eslint-plugin-react/lib/util/eslint.js:19:23) at resolveValueForIdentifierNode (./node_modules/eslint-plugin-react/lib/util/propTypes.js:378:21) at buildReactDeclarationTypes (./node_modules/eslint-plugin-react/lib/util/propTypes.js:420:5) at ./node_modules/eslint-plugin-react/lib/util/propTypes.js:788:39 at iterateProperties (./node_modules/eslint-plugin-react/lib/util/propTypes.js:71:7) at ./node_modules/eslint-plugin-react/lib/util/propTypes.js:773:23 at Array.forEach (I don't really understand enough about the codebase to say whether this is the correct fix, or if this really should be passing in
node
instead ofrootNode
togetScope
or something like that. This resolves the immediate issue for me at least and seemed reasonable to check the value is valid before it tries to call something that requires it.