Skip to Content
🚧 This is WIP documentation for v4 of the plugin. For v3 click here.
ESLGraphQL-ESLint
Rulesprettier Rule

prettier Rule

eslint-plugin-prettier supports .graphql files, and v4.1.0 supports graphql blocks even better. You need to do the following:

{
  "overrides": [
    {
      "files": ["*.js"],
      "processor": "@graphql-eslint/graphql",
      "extends": ["plugin:prettier/recommended"]
    },
    {
      "files": ["*.graphql"],
      "parser": "@graphql-eslint/eslint-plugin",
      "plugins": ["@graphql-eslint"],
      "rules": {
        "prettier/prettier": "error"
      }
    }
  ]
}

You can take this repository as example.

Last updated on