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

Remove eslint-plugin-graphql #340

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Remove eslint-plugin-graphql #340

merged 1 commit into from
Jun 29, 2022

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Jun 28, 2022

Description

Fixes #327. Fixes #320.
Part of https://github.com/Shopify/web/issues/55503.

eslint-plugin-graphql is outdated and unsupported. Consumers should use
@graphql-eslint/eslint-plugin to lint their graphql files.

I am choosing to remove eslint-plugin-graphql without replacement because graphql linting has a large install footprint, and we should not burden consumers that do not use graphql with having to install those additional dependencies.

Upon updating to v42, consumers that currently extend from plugin:@shopify/graphql can instead add the following to their eslint config:

{
plugins: ['eslint-plugin-graphql']},
overrides: [
    {
      parser: '@babel/eslint-parser',
      files: ['*.graphql'],
      rules: {
        'graphql/capitalized-type-name': 'off',
        'graphql/named-operations': ['error', {env: 'literal'}],
        'graphql/no-deprecated-fields': ['error', {env: 'literal'}],
        'graphql/template-strings': ['error', {env: 'literal'}],
        'graphql/required-fields': ['error', {env: 'literal', requiredFields: ['id']}],
      },
    },
  ]
}

This PR:

  • Removes the graphql config. Extending from plugin:@shopify/graphql will cause an error as that config no longer exists.
  • Removes the dependency on eslint-plugin-graphql

eslint-plugin-graphql is outdated and unsupported. Consumers should use
`@graphql-eslint/eslint-plugin` to lint their grahql files. This plugin
is not included as graphql has a large install footprint and we do not
want to burden consumers that do not use graphql.
@BPScott
Copy link
Member Author

BPScott commented Jun 28, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @BPScott! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

yarn add @shopify/[email protected]

@BPScott BPScott requested review from a team and vsumner June 28, 2022 22:26
@BPScott BPScott merged commit af6fccc into main Jun 29, 2022
@BPScott BPScott deleted the remove-graphql branch June 29, 2022 18:07
@github-actions github-actions bot mentioned this pull request Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eslint-plugin-graphql is deprecated Dividing the graphql part
2 participants