eslint-plugin-functional
eslint-plugin-functional copied to clipboard
type-declaration-immutability: RangeError: Maximum call stack size exceeded
Bug Report
while updating from v5 to v6, rule type-declaration-immutability
now throws an error RangeError: Maximum call stack size exceeded
looks similar to https://github.com/eslint-functional/eslint-plugin-functional/issues/733
Expected behavior
eslint terminates
Actual behavior
throws error
ESLint: 8.56.0
RangeError: Maximum call stack size exceeded
Occurred while linting /home/jenkins_home/workspace/ing-services_Lint_eslint-updates/accounts-wrapper/users/types.ts:26
Rule: "functional/type-declaration-immutability"
at Object.isIntrinsicErrorType (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/ts-api-utils/lib/index.cjs:140:25)
at Object.get [as isIntrinsicErrorType] (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/ts-api-utils/lib/index.cjs:16:45)
at getTypeData (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:301:20)
at /home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:248:15
at Array.map (<anonymous>)
at typeArgumentsToString (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:245:47)
at TypeName.getNameWithArguments (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:171:54)
at /home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:253:26
at Array.map (<anonymous>)
at typeArgumentsToString (/home/jenkins_home/workspace/ing-services_Lint_eslint-updates/node_modules/is-immutable-type/dist/index.cjs:245:47)
script returned exit code 2
Steps to reproduce
Proposed changes
It doesn't like React.ComponentProps<typeof SomeComponent> either
I'm facing this as well.
:tada: This issue has been resolved in version 6.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I've removed 2 infinite loops I've found in the upstream, hopefully, that fixes the issue for everyone. If you're still getting this error, let me know; and if you can include a type that causes the issue.
@RebeccaStevens I still hit one case where I am using forwardRef
with ComponentProps
in react
Example:
type Props = Readonly<JSX.IntrinsicElements['input']>
const Input = forwardRef<HTMLInputElement, Props>(
function InnerInput(props, ref) {
return <input {...props} ref={ref} />
},
)
type PropsB = Readonly<ComponentProps<typeof Input>> // This line throws `RangeError: Maximum call stack size exceeded`
@foray1010 I haven't explicitly tried to fix this again yet, but I have made some updates that might have consequently fixed the issue. Let me know if you are still getting this issue with the latest release.
@RebeccaStevens I can confirm the above issue has been fixed in 6.5.1, thank you!
That's good to hear. I'll close this issue.