2 * @fileoverview Rule to flag when using multiline strings
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const astUtils = require("./utils/ast-utils");
14 //------------------------------------------------------------------------------
16 //------------------------------------------------------------------------------
23 description: "disallow multiline strings",
24 category: "Best Practices",
26 url: "https://eslint.org/docs/rules/no-multi-str"
35 * Determines if a given node is part of JSX syntax.
36 * @param {ASTNode} node The node to check.
37 * @returns {boolean} True if the node is a JSX node, false if not.
40 function isJSXElement(node) {
41 return node.type.indexOf("JSX") === 0;
44 //--------------------------------------------------------------------------
46 //--------------------------------------------------------------------------
51 if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) {
52 context.report({ node, message: "Multiline support is limited to browsers supporting ES5 only." });