Skip to content

Maximum call stack size exceeded with no-danger-with-children rule #1571

Closed
@mockdeep

Description

@mockdeep

I made a typo in one of my tests, and got a weird "RangeError" from ESLint. I would have expected some sort of error maybe complaining about invalid syntax or something, but this one in particular was hard to trace. The code looks like:

const props = {...props, scratch: {mode: 'edit'}};
const component = shallow(<TaskEditableTitle {...props} />);

The error that came out:

Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at ScopeManager.__get (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-scope/lib/scope-manager.js:85:10)
    at ScopeManager.acquire (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-scope/lib/scope-manager.js:127:29)
    at getScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint/lib/linter.js:613:36)
    at Object.getScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint/lib/linter.js:843:37)
    at Object.variablesInScope (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/util/variable.js:36:23)
    at findSpreadVariable (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:23:27)
    at node.properties.find.prop (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:38:28)
    at Array.find (native)
    at findObjectProp (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:34:30)
    at node.properties.find.prop (/home/fletch/Dropbox/projects/web_apps/questlog/node_modules/eslint-plugin-react/lib/rules/no-danger-with-children.js:40:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions