relayjs / eslint-plugin-relay

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

readInlineData: missing argument check #106

Closed mightyaleksey closed 3 years ago

mightyaleksey commented 4 years ago

Hey, I faced an issue recently with readInlineData function call. I forgot to pass fragment reference (second argument) to readInlineData and had some challenges to figure out why my feature wasn't working properly.

Flow also haven't covered this case, so I thought that it would be nice to have a rule check similar to rule-hook-required-argument.

For context here is a link for the doc https://relay.dev/docs/en/graphql-in-relay#inline

alunyov commented 3 years ago

I think it makes perfect sense to add this lint rule for readInlineData.

If you could send a PR, we will guarantee a speedy review ;-)

Thanks for reporting @sullenor !

mightyaleksey commented 3 years ago

Hey @alunyov, I implemented a rule for the issue https://github.com/relayjs/eslint-plugin-relay/pull/108. Can you please take a look when you have time? thanks :)

alunyov commented 3 years ago

@sullenor thank you!

I'll take a look a little later this week.

alunyov commented 3 years ago

Closing, as https://github.com/relayjs/eslint-plugin-relay/issues/106 has merged. Thank you @sullenor for your contribution!