]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/lib/rules/no-multi-str.js
6a17d581b98fa1060ba3d803e6c4f8f5f09788d4
2 * @fileoverview Rule to flag when using multiline strings
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const astUtils
= require("./utils/ast-utils");
14 //------------------------------------------------------------------------------
16 //------------------------------------------------------------------------------
18 /** @type {import('../shared/types').Rule} */
24 description
: "disallow multiline strings",
26 url
: "https://eslint.org/docs/rules/no-multi-str"
32 multilineString
: "Multiline support is limited to browsers supporting ES5 only."
39 * Determines if a given node is part of JSX syntax.
40 * @param {ASTNode} node The node to check.
41 * @returns {boolean} True if the node is a JSX node, false if not.
44 function isJSXElement(node
) {
45 return node
.type
.indexOf("JSX") === 0;
48 //--------------------------------------------------------------------------
50 //--------------------------------------------------------------------------
55 if (astUtils
.LINEBREAK_MATCHER
.test(node
.raw
) && !isJSXElement(node
.parent
)) {
58 messageId
: "multilineString"