relayjs / eslint-plugin-relay

A plugin for the code linter ESLint to lint specific details about Relay.
MIT License
98 stars 46 forks source link

Would you consider adding lint for deprecated #136

Open eMerzh opened 1 year ago

eMerzh commented 1 year ago

Hello, i'm trying to add a linter for deprecrated fields on my project,

our schema is quite large, and i struggle to find a linter that could do it well... i was wondering if you would consider adding one in the project?

i might try my hand at it

dotansimha commented 1 year ago

We do have some rules around deprecations in graphql-eslint - some are from the build-in validations of GraphQL, and some are added by us. You can find it here:

It might be useful for you to integrate it, as an additional linting layer.

eMerzh commented 1 year ago

thanks @dotansimha ... i know those rules indeed, i was thinking about the client/operation lint like this one https://the-guild.dev/graphql/eslint/rules/no-deprecated

couple reasons why i would hope relayjs-eslint would add this

dotansimha commented 1 year ago
  • I have issues with the-guild eslint, i can't really set it up 😬 but that's probably me...

feel free to create an issue, we would love to help ;)

  • an extra dep if like me, you already have this running

Agree. But I think this might be out of scope for the Relay compiler? as this is a lint issue? 🤔

  • i was hoping this project could take advantage of the rust relay-compiler somehow

Actually, that might be interesting. If relay-compiler (rust) version has some built-in rules, we can use that and integrate it directly into the IDE using the ESLint extension. @B2o5T what do you think?

eMerzh commented 1 year ago

@dotansimha what got me thinking it could [one-day] be possible, is these kinds of changes released in latest relay

https://github.com/facebook/relay/commit/50266e1051c9e275b68bda34bb30b970c390d203

dimaMachina commented 1 year ago

If relay-compiler (rust) version has some built-in rules, we can use that and integrate it directly into the IDE using the ESLint extension.

@dotansimha Yes, we can do it as we already do with graphql-js rules

I have issues with the-guild eslint, i can't really set it up 😬 but that's probably me...

@eMerzh there is nothing wrong with graphql-eslint, take a look at working examples