{"id":19917,"library":"eslint-plugin-relay","title":"eslint-plugin-relay","description":"ESLint plugin for Relay, version 2.0.0, released under MIT license. It provides lint rules to catch common problems in Relay code, such as invalid GraphQL syntax, naming convention violations, missing colocated fragment spreads, and unused fields. The plugin ships with recommended and strict configurations, and supports suppression of certain rules within graphql tagged templates. Key differentiators: it provides faster feedback than the Relay Compiler for syntax and naming issues, and includes rules like `must-colocate-fragment-spreads` that enforce best practices for data fetching. It is actively maintained by the Relay team.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/relayjs/eslint-plugin-relay","tags":["javascript"],"install":[{"cmd":"npm install eslint-plugin-relay","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-relay","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-relay","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the plugin requires ESLint as a linter framework","package":"eslint","optional":false},{"reason":"used internally for parsing and validating GraphQL strings","package":"graphql","optional":false}],"imports":[{"note":"ESLint plugin names should omit the 'eslint-plugin-' prefix when listed in 'plugins'.","wrong":"plugins: ['eslint-plugin-relay']","symbol":"plugin","correct":"plugins: ['relay']"},{"note":"Use the full 'plugin:' prefix syntax when extending a plugin's config.","wrong":"extends: ['relay/recommended']","symbol":"recommended config","correct":"extends: ['plugin:relay/recommended']"},{"note":"Similar to recommended, use 'plugin:' prefix.","wrong":"extends: ['relay/strict']","symbol":"strict config","correct":"extends: ['plugin:relay/strict']"}],"quickstart":{"code":"npm i --save-dev eslint-plugin-relay\n\n// .eslintrc.js\nmodule.exports = {\n  plugins: ['relay'],\n  rules: {\n    'relay/graphql-syntax': 'error',\n    'relay/graphql-naming': 'error',\n    'relay/must-colocate-fragment-spreads': 'warn',\n    'relay/no-future-added-value': 'warn',\n    'relay/unused-fields': 'warn',\n    'relay/function-required-argument': 'warn',\n    'relay/hook-required-argument': 'warn',\n  },\n  // Alternatively, use recommended config:\n  // extends: ['plugin:relay/recommended']\n};","lang":"javascript","description":"Installs and configures eslint-plugin-relay with all core rules enabled to catch common Relay code issues."},"warnings":[{"fix":"Consider disabling this rule if your project uses non-unique module names or relative imports.","message":"The `must-colocate-fragment-spreads` rule relies on globally unique module names and may not work well outside of Meta's environment.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"No fix needed; rule still works, but you can rely on Relay Compiler for syntax validation.","message":"The rule `relay/graphql-syntax` is deprecated? Actually it is still valid but may be superseded by compiler validation.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use `eslint-disable-next-line` comment before the line you want to suppress, not inline.","message":"Suppression within graphql tags only supports `eslint-disable-next-line`, not `eslint-disable-line`, due to graphql-js AST limitations.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm i --save-dev eslint-plugin-relay` and ensure it is listed in your package.json.","cause":"The plugin is not installed or is missing from package.json devDependencies.","error":"ESLint couldn't find the plugin \"eslint-plugin-relay\"."},{"fix":"Use 'error' correctly: `'relay/graphql-syntax': 'error'`.","cause":"Rule severity must be 0, 1, 2 or 'off', 'warn', 'error'. Using a string like 'error' is fine, but sometimes typos occur.","error":"Configuration for rule \"relay/graphql-syntax\" is invalid: Value \"error\" is not a valid severity."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}