diff --git a/lib/rules/no-danger-with-children.js b/lib/rules/no-danger-with-children.js index b96e3eb6c1..d03546537c 100644 --- a/lib/rules/no-danger-with-children.js +++ b/lib/rules/no-danger-with-children.js @@ -36,7 +36,7 @@ module.exports = { return node.properties.find(prop => { if (prop.type === 'Property') { return prop.key.name === propName; - } else if (prop.type === 'ExperimentalSpreadProperty') { + } else if (prop.type === 'ExperimentalSpreadProperty' || prop.type === 'SpreadElement') { const variable = findSpreadVariable(prop.argument.name); if (variable && variable.defs.length && variable.defs[0].node.init) { if (seenProps.indexOf(prop.argument.name) > -1) { @@ -74,7 +74,7 @@ module.exports = { * @returns {Boolean} True if node is a line break, false if not */ function isLineBreak(node) { - const isLiteral = node.type === 'Literal'; + const isLiteral = node.type === 'Literal' || node.type === 'JSXText'; const isMultiline = node.loc.start.line !== node.loc.end.line; const isWhiteSpaces = /^\s*$/.test(node.value);