Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quote: 'single' is broken in 0.15.2 #802

Open
be9 opened this issue Aug 2, 2022 · 0 comments
Open

quote: 'single' is broken in 0.15.2 #802

be9 opened this issue Aug 2, 2022 · 0 comments

Comments

@be9
Copy link

be9 commented Aug 2, 2022

After merging #678, builders.stringLiteral generates a node.extra object with extra.raw having double quotes due to JSON.stringify:

Screen Shot 2022-08-02 at 12 16 50 PM

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant