ast-types
ast-types copied to clipboard
`quote: 'single'` is broken in 0.15.2
After merging #678, builders.stringLiteral generates a node.extra object with extra.raw having double quotes due to JSON.stringify:
recast.print has this code that doesn't reformat any quotes if extra.raw is present:
case "BooleanLiteral": // Babel 6 Literal split
case "StringLiteral": // Babel 6 Literal split
case "Literal":
return fromString(
getPossibleRaw(n) ||
(typeof n.value === "string" ? nodeStr(n.value, options) : n.value),
options,
);
getPossibleRaw wins here; nodeStr which respects options.quote is not called.