src/nodes/strings.js in prettier-0.18.0 vs src/nodes/strings.js in prettier-0.18.1

- old
+ new

@@ -13,22 +13,22 @@ // If there is some part of this string that matches an escape sequence or that // contains the interpolation pattern ("#{"), then we are locked into whichever // quote the user chose. (If they chose single quotes, then double quoting // would activate the escape sequence, and if they chose double quotes, then // single quotes would deactivate it.) -const isQuoteLocked = string => +const isQuoteLocked = (string) => string.body.some( - part => + (part) => part.type === "@tstring_content" && (part.body.includes("#{") || part.body.includes("\\")) ); // A string is considered to be able to use single quotes if it contains only // plain string content and that content does not contain a single quote. -const isSingleQuotable = string => +const isSingleQuotable = (string) => string.body.every( - part => part.type === "@tstring_content" && !part.body.includes("'") + (part) => part.type === "@tstring_content" && !part.body.includes("'") ); const quotePattern = new RegExp("\\\\([\\s\\S])|(['\"])", "g"); const normalizeQuotes = (content, enclosingQuote, originalQuote) => { @@ -59,10 +59,10 @@ "[": "]", "{": "}", "<": ">" }; -const getClosingQuote = quote => { +const getClosingQuote = (quote) => { if (!quote.startsWith("%")) { return quote; } const boundary = /%q?(.)/.exec(quote)[1];