Historically, only JS formatter has had the `detect_code_removal` feature, which uses CI to check for missing nodes or comments.
While this would be useful in other languages (especially CSS), but setting up the mechanism is difficult. For now, just start with something simple that just guarantees the number of comments.
That said, even with a mechanism in place, it can't detect anything unless the cases are fully covered by fixtures, so this only tells us that the current state is problem-free.
Aligned the handling of line comments immediately following an opening `{`.
(For GraphQL only,) previously kept their own line, now matches other languages by inserting a line break and treating them as leading comments for the next element.
This brings it in line with Prettier's style. The only drawback is that the behavior of `-line` style comments. However, since most of these can be replaced with `-next-line` style comments, we are going to standardize on this consistent behavior for now.
prettier/prettier#1267 (won't fix)
- Extract "known divergences" section from `AGENTS.md` to explicit `DIVERGENCES.md` with code example
- Update all anchors
- Add missing pinned fixtures
Also fixes#24927
- rework comment printing to follow the rules and align with other formatters
- bump `oxc-graphql-parser`
- to track comments inside a node's span more accurately
Part of #23923
Now `implements` long list are broken on print-width.
```gql
type LongNoDirective implements Node &
RequirableByPullRequest &
UniformResourceLocatable &
ExtraLongInterface {
id: ID!
}
```
- Fork `apollo-rs` to be compatible with Prettier(`latest` for now)
- https://github.com/leaysgur/apollo-rs
- By doing this, Prettier fallback is no longer needed
- And now all prettier_conformance are passed, no parse error skip
> [!WARNING]
> TODO: Move fork under `oxc-project` org and replace refs
- Implement `oxc_formatter_graphql` crate
- Use `apollo-parser` crate from `apollo-rs`
- https://github.com/apollographql/apollo-rs
- Which follows Oct2021 spec
- Prettier uses `graphql-js` and implements more and more syntax
- v16 for `latest = 3.8.4` and v17 for `main = 3.9.x`
NOTE: So at the point of this PR, diffs can be seen as skipped in prettier_conformance.
Will be addressed in later PR by forking `apollo-parser`.