void-dom-elements-no-children
checking every .createElement and crashing #1073
Closed
Description
I've just updated to v6.10.0 and enabled void-dom-elements-no-children
.
It's crashing with this error:
TypeError: Cannot read property 'properties' of undefined
at EventEmitter.CallExpression ([...]/eslint-plugin-react/lib/rules/void-dom-elements-no-children.js:121:28)
[...]
It happens with this simple code:
document.createElement('img');
So here is the first problem:
- The rule thinks that every
.createElement(
is theReact.createElement
.
Now testing with the actual React
:
import React from 'react';
React.createElement('img');
The rule will crash too.
Second problem:
- The rule doesn't treat incomplete number of
createElement
's arguments (as while typingReact.createElement()
).