What is GraphQL-ESLint?
masterGraphQL-ESLint is a tool that integrates GraphQL with ESLint to improve the developer experience. It allows you to lint both GraphQL schemas and GraphQL operations (queries, mutations, etc.) using the ESLint engine. It works by acting as an ESTree parser within the ESLint ecosystem.
Key capabilities include:
- Multi-format support: Lints
.graphqlfiles,gqltemplate literal usages, and/* GraphQL */magic comments. - Comprehensive linting: Validates, lints, and prettifies GraphQL schemas and operations, checking for best practices.
- Advanced Type Information: Provides extended type info for complex linting rules.
- Extensibility: Supports custom rules built on GraphQL's AST and the ESLint API.
- IDE Integration: Visualizes linting issues directly in popular IDEs like VSCode and WebStorm.
- Standard Tooling Support: Integrates with ESLint directives (e.g.,
eslint-disable-next-line) and GraphQL Config.