prisma-labs / graphql-framework-experiment

Code-First Type-Safe GraphQL Framework
https://nexusjs.org
MIT License
675 stars 66 forks source link

Integrate dprint for code formatting #1236

Open jasonkuhrt opened 4 years ago

jasonkuhrt commented 4 years ago

Perceived Problem

Ideas / Proposed Solution(s)

dsherret commented 4 years ago

@jasonkuhrt is this just for typescript formatting? If so, dprint-plugin-typescript is MIT and you could integrate it without legal issue: https://crates.io/crates/dprint-plugin-typescript -- That's what Deno used for deno fmt.

The CLI and json & markdown formatters aren't MIT though. The CLI also uses a lot of parallelization to speed things up in Rust, which wouldn't be possible in JS.

What's this feature? Nexus provides prettier for code formatting and that's distributed with Nexus? I don't see prettier as a dependency (only dev dependency).

jasonkuhrt commented 4 years ago

Appreciate the input @dsherret. Yes we'd be primarily interested in TS formatting.

You're right prettier is not a dep yet. What could happen in the future though:

Being able to format as much as possible seems nice, but TS is the overwhelming majority of code.

Once nexus supports JS then JS code too.

For example the GraphQL SDL generated by nexus would go through prettier.