prettier plugin: Infinite loop for malformed graphql relay query
Open
bug
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 859
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
Description
## Bug Description
The following code hangs forever:
```js
const prettier = require('@prettier/sync');
const prettierOptions = {
plugins: ['prettier-plugin-hermes-parser'],
};
const code = `// @flow strict
function App() {
const data = useLazyLoadQuery(graphql\`query AppQuery {} \`, {})
}
`;
for (let i = 0; i < 4; ++i) {
console.log(
prettier.format(code, { ...prettierOptions, parser: 'hermes' }).trim()
);
}
```
Hermes git revision (if applicable): `"prettier-plugin-hermes-parser": "0.19.2",`
## The Expected Behavior
Don't have infinite loops
Contributor guide
Assessment
This issue has not been assessed yet.