Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint disable support #112

Merged
merged 4 commits into from
Feb 5, 2021
Merged

Add eslint disable support #112

merged 4 commits into from
Feb 5, 2021

Conversation

poteto
Copy link
Contributor

@poteto poteto commented Feb 5, 2021

This PR adds the ability to suppress eslint reporting within graphql tags:

graphql`
  fragment foo on Page {
    # eslint-disable-next-line relay/must-colocate-fragment-spreads
    ...unused1
  }
`

Note that only the eslint-disable-next-line form of suppression works. eslint-disable-line doesn't currently work until graphql-js provides support for parsing Comment nodes in their AST.

README.md Outdated
}`
```

Note that only this form of suppression works. Inline disables don't currently work until graphql-js provides support for parsing Comment nodes in their AST.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what you mean by "inline disables". To me eslint-disable-next-line is a type of inline disable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I was referring to the eslint suppression where the comment is on the same line as the offending ast node to be "inline". I guess I could make the readme more specific

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I get it now. Thanks for the update!

@poteto poteto force-pushed the add-eslint-disable-support branch from 7ec2649 to d26e588 Compare February 5, 2021 19:57
Copy link
Contributor

@captbaritone captbaritone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@alunyov alunyov merged commit f05d2a7 into master Feb 5, 2021
@poteto poteto deleted the add-eslint-disable-support branch February 5, 2021 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants