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

prettier plugin: Infinite loop for malformed graphql relay query #1359

Open
ayroblu opened this issue Mar 19, 2024 · 0 comments
Open

prettier plugin: Infinite loop for malformed graphql relay query #1359

ayroblu opened this issue Mar 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ayroblu
Copy link

ayroblu commented Mar 19, 2024

Bug Description

The following code hangs forever:

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

@ayroblu ayroblu added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants