Skip to content
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

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

Closed
mockdeep opened this issue Nov 27, 2017 · 5 comments
Closed

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

mockdeep opened this issue Nov 27, 2017 · 5 comments
Labels

Comments

@mockdeep
Copy link

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)
@ljharb
Copy link
Member

ljharb commented Nov 27, 2017

Thanks, looks like it might be a bug in no-danger-with-children.

@ljharb
Copy link
Member

ljharb commented Nov 27, 2017

altho i'm confused; how does ...props work when const props shadows it?

@ljharb
Copy link
Member

ljharb commented Nov 27, 2017

This actually just looks like it should be invalid syntax, but eslint itself shouldn't crash like this.

Instead of here, can you file this on eslint itself?

@mockdeep
Copy link
Author

Alrighty, opened a new issue at eslint/eslint#9657

@ljharb
Copy link
Member

ljharb commented Jan 31, 2018

Reopening; this is indeed an issue with the rule.

@ljharb ljharb reopened this Jan 31, 2018
@ljharb ljharb added the bug label Jan 31, 2018
@ljharb ljharb closed this as completed in 5e1a64c Jan 31, 2018
This was referenced Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants