Add .graphql detection (#2256)
Test Plan: create a `test.graphql` file that has some graphql content ```js fragment Visit on HighlightedVisit @argumentDefinitions( count: {type: "Int", defaultValue: 20} ) { name } ``` ``` ./bin/prettier.js test.graphql ``` make sure it doesn't syntax error because it's parsing it as js.master
parent
59b3a9bc56
commit
b464189fb4
|
@ -35,6 +35,8 @@ function normalize(options) {
|
|||
normalized.parser = "parse5";
|
||||
} else if (/\.(ts|tsx)$/.test(filepath)) {
|
||||
normalized.parser = "typescript";
|
||||
} else if (/\.graphql$/.test(filepath)) {
|
||||
normalized.parser = "graphql";
|
||||
} else if (/\.json$/.test(filepath)) {
|
||||
normalized.parser = "json";
|
||||
normalized.trailingComma = "none";
|
||||
|
|
Loading…
Reference in New Issue