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
no-typos: TypeError: only function nodes are expected #3036
Comments
It seems possible to catch forwardRef and warn properly on them, but not on styled-components since there's no way to statically know it's a component. |
For now, I'll fix the crash but not actually handle them. |
Got the error logs of Rule: no-unstable-nested-components
34 | overrides: {
35 | ListItem: {
> 36 | component: React.forwardRef((props, ref) => (
37 | <MenuAdapter
38 | {...props}
39 | ref={ref}
Rule: no-unstable-nested-components
31 | overrides: {
32 | ListItem: {
> 33 | component: React.forwardRef((props: any, ref) => (
34 | <MenuAdapter
35 | {...props}
36 | ref={ref}
Rule: no-unstable-nested-components
24 | Day: {
25 | // eslint-disable-next-line react/display-name
> 26 | component: React.forwardRef((props, ref) => (
27 | <StyledDay
28 | data-highlighted={props.$isHighlighted}
29 | {...props}
Rule: no-unstable-nested-components
36 | overrides: {
37 | ListItem: {
> 38 | component: React.forwardRef((props, ref) => (
39 | <MenuAdapter
40 | {...props}
41 | ref={ref}
Rule: no-unstable-nested-components
211 | HTMLAnchorElement,
212 | Link & AllHTMLAttributes<HTMLAnchorElement>
> 213 | >(({ href = '', children, ...rest }, ref) => (
214 | <Link {...rest} to={href} innerRef={ref}>
215 | {children}
216 | </Link>
Rule: no-unstable-nested-components
80 | appearance="pagination"
81 | component={forwardRef(
> 82 | ({ children, className }, ref: RefObject<HTMLAnchorElement>) => (
83 | <Link innerRef={ref} className={className} to="/3">
84 | {children}
85 | </Link>
Rule: no-unstable-nested-components
64 | href={path}
65 | text={titleCase(pages[idx])}
> 66 | component={React.forwardRef(() => (
67 | <p style={{ fontWeight: 'bold' }}>{titleCase(pages[idx])}</p>
68 | ))}
69 | />
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
no-typos
rule seems to crash in certain cases. This issue was spotted by automated CI run - it is not blocking my development or anything.I don't think these bugs are included in any releases yet.
#2963 (comment)
Minimal repro:
Failing test cases:
Crash reports from real projects
Rule: no-typos
only function nodes are expected Occurred while linting /workspaces/eslint-plugin-react/node_modules/eslint-remote-tester/.cache-eslint-remote-tester/mozilla/Spoke/src/ui/inputs/StringInput.js:17
mozilla/Spoke/src/ui/inputs/StringInput.js
Rule: no-typos
only function nodes are expected Occurred while linting /workspaces/eslint-plugin-react/node_modules/eslint-remote-tester/.cache-eslint-remote-tester/mozilla/Spoke/src/ui/layout/MediaGrid.js:38
mozilla/Spoke/src/ui/layout/MediaGrid.js
The text was updated successfully, but these errors were encountered: