biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
14.47k stars 451 forks source link

📎 All caps ENUM in GraphQL #4033

Open eMerzh opened 1 week ago

eMerzh commented 1 week ago

Description

it's well a convention (not a requirement) in GQL to have ALL CAPS enums,

a few eslint based linter have it like

https://github.com/joshuaNathaniel/eslint-plugin-graphql-schema/blob/master/docs/rules/enum-values-all-caps.md or https://github.com/cjoudrey/graphql-schema-linter

it might be a good new lint for biome :)

eMerzh commented 1 week ago

as a noob, i'd like to try my hand at that :)

i did created #4031

minht11 commented 1 week ago

After doing quick search for enum graphql there are a lot of different casing examples, so this rule is likely too restrictive. I think this functionality would be better served by useNamingConvention for graphql. https://github.com/biomejs/biome/pull/4031#issuecomment-2366252558

Conaclos commented 1 week ago

I think this functionality would be better served by useNamingConvention for graphql.

It is a good point. However, I think that our current infra and way of configuring rules doesn't allow a rule on several languages with a config shape different for every language. @ematipico any input regarding this aspect?

ematipico commented 1 week ago

Configuring multiple rules shouldn't be difficult.

Here's what I thought: