You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which is at odds with ESLint's overall approach of "run every rule enabled in the configuration, and then just swallow the errors reported by eslint-disabled code". Currently I get the following error:
Unused eslint-disable directive (no problems were reported from 'relay/unused-fields')
And there's no way around it sans just disabling reportUnusedDisableDirectives, which I don't want to do. My current workaround is to wrap offending template literals in /* eslint-disable relay/unused-fields */.
The only solution I see is to do what graphql-eslint does and utilize a processor (very preferably the same one, so that they don't clash with each other). See #153 for a related problem.
The text was updated successfully, but these errors were encountered:
Thanks for the report. Can you share an example of code that triggers the issue here? Is it that when you include an eslint-ignore inline in the graphql tagged template literal (# eslint-disable-next-line relay/unused-fields) that this triggers eslint's own reportUnusedDisableDirectives?
Is it that when you include an eslint-ignore inline in the graphql tagged template literal (# eslint-disable-next-line relay/unused-fields) that this triggers eslint's own reportUnusedDisableDirectives?
Exactly! Done inside a useLazyLoadQuery(graphql`...`).
Does this happen when Relay's lint rule is enabled by itself, or is it an interaction with graphql-eslint?
Thanks for asking this, I went to double-check and removed graphql-eslint's config outright (instead of using the workaround of including *.graphql in eslint-plugin-relay's files), and the directives aren't reported as unused anymore. So your hunch is correct, this happens only when graphql-eslint's processor is enabled. In retrospect, this is obvious, as without the processor to ESLint the template literal is just an opaque string 😛 Would you like me to close this issue in favor of #153?
The problem is pretty simple, this plugin has its own handling of eslint-disable directives in GraphQL strings:
eslint-plugin-relay/src/rule-unused-fields.js
Lines 23 to 25 in 24fd162
Which is at odds with ESLint's overall approach of "run every rule enabled in the configuration, and then just swallow the errors reported by eslint-disabled code". Currently I get the following error:
And there's no way around it sans just disabling
reportUnusedDisableDirectives
, which I don't want to do. My current workaround is to wrap offending template literals in/* eslint-disable relay/unused-fields */
.The only solution I see is to do what
graphql-eslint
does and utilize a processor (very preferably the same one, so that they don't clash with each other). See #153 for a related problem.The text was updated successfully, but these errors were encountered: