Skip to content

--insert-pragma breaks GraphQL, CSS #3557

@azz

Description

@azz

Prettier 1.9.2
Playground link

--insert-pragma
--parser graphql

Input:

query Query {
  id
}

Output:

SyntaxError: Syntax Error GraphQL request (1:1) Cannot parse the unexpected character "/".

1: /** @format */
   ^
2: 
 (1:1)
> 1 | /** @format */
    | ^
  2 | 
  3 | query Query {
  4 |   id

Prettier 1.9.2
Playground link

--insert-pragma
--parser markdown

Input:

# hello

Output:

/\*_ @format _/

# hello

Prettier 1.9.2
Playground link

--insert-pragma
--parser json

Input:

{ "foo": "bar" }

Output:

/** @format */

{ "foo": "bar" }

Metadata

Metadata

Assignees

Labels

lang:css/scss/lessIssues affecting CSS, Less or SCSSlang:graphqlIssues affecting GraphQLlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions