Replies: 5 comments 4 replies
-
Very much needed, we migrated our huge monorepo to biome today, but we miss graphql linting very much |
Beta Was this translation helpful? Give feedback.
-
Any update on this? it's the number one request and by quite far, would it be considered? considering switching back to prettier for this :/ |
Beta Was this translation helpful? Give feedback.
-
In our roadmap for 2024, graphql isn't part of the languages we want to tackle. Although, if someone wants to take on the task using our infrastructure, they are more than welcome! |
Beta Was this translation helpful? Give feedback.
-
I have been trying to replace Prettier with Biome and the lack of GraphQL support continues to be a major hurdle. I've encountered a couple of issues and am currently stuck. Issue 1: Ensuring that GraphQL statements are formatted You're here, so you're aware that at the time of writing, Biome doesn't support GraphQL and has no intention of adding this support soon. I wasn't here when I realized this. Instead, I happened to notice that Biome wasn't formatting GraphQL statements at all after being under the false impression that Biome had reached 97% compatibility with Prettier (and not just its JavaScript capabilities). I was able to get around this by creating a setup that uses both Biome and Prettier for formatting. I run Biome first and a second pass with Prettier to cover the languages that are supported by Prettier, but not yet supported by Biome. To do this, we use the following as the basis for
Prettier's GraphQL support covers GraphQL files ( For now, this seems okay, because it seems as though Biome is trying to offer Prettier compatibility. As Biome and Prettier drift, this will be a problem, but it's the best we have for now. So this is kind of worked around, but I don't feel too great about it. Issue 2: Ensuring the proper VS Code Plugin Now that I'm using Biome and Prettier for formatting, I need to wrangle their respective plugins so that VS Code formats files as expected. For the most part, this works fine because VS Code can be configured to use Biome's plugin by default and Prettier's plugin for the other languages:
However, I am faced with a dilemma for TypeScript files that define GraphQL statements as template literals (The files we've been creating using the
This extension allows us to run multiple formatters for a given language, which would have to be TypeScript to solve this issue. Unfortunate because this means formatting in VS Code would pretty much always run both Biome and Prettier whenever you save, which would be just slow enough to be annoying. |
Beta Was this translation helpful? Give feedback.
-
Hi, everyone! We just opened an issue to track the work for GraphQL support. Considering the huge success of this discussion, we would like to give the opportunity to other people to try and implement this feature in core. We're seeking funding as a means to incentivise the developments. The core team needs to stick to the roadmap, but we are also more than happy to help any contributor to achieve the task with mentoring, PR reviews and coordination. |
Beta Was this translation helpful? Give feedback.
-
Biome has replaced eslint for almost everything, but one of the remaining file types is
*.graphql
. I was wondering if support for this could be considered?Here's an example of graphql-oriented eslint rules → https://the-guild.dev/graphql/eslint/docs/configs
Beta Was this translation helpful? Give feedback.
All reactions