Skip to content

Add GraphQL ESLint rules in subgraph package #3218

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

Issue tracking

This issue originated from a TODO comment in the subgraph package's .eslintrc file that needed to be addressed to improve code quality. No specific tracking issue was attached.

Context behind the change

This PR adds specific ESLint rules for GraphQL files in the TypeScript subgraph package:

  • Added no-anonymous-operations rule to enforce named operations
  • Added naming-convention rule to enforce camelCase styling for operations and fragments
  • Added require-description rule to encourage documentation for types and fields
  • Added no-duplicate-fields rule to prevent duplicate field definitions
  • Added fields-on-correct-type rule to validate field types
    These rules will improve code quality and consistency in GraphQL schemas and queries, helping to maintain a standardized codebase and reducing potential errors during development.

How has this been tested?

Testing was performed by:

  1. Running the linter on existing GraphQL files to ensure no critical errors were introduced
  2. Verifying that the new rules align with the project's existing code style
  3. Making sure the rules match industry best practices for GraphQL development
    This change doesn't affect runtime behavior and has no performance implications.

Release plan

This change is contained within the linting configuration and requires no special deployment steps.
Developers should be informed about the new GraphQL linting rules to ensure compliance in future code changes. A brief message in the team chat would be sufficient.

Potential risks; What to monitor; Rollback plan

  • Low risk change as it only affects development tooling, not runtime code
  • Some existing GraphQL files might initially fail linting with the new rules

What to monitor:

  • CI pipeline results for any linting failures on existing GraphQL files
  • Developer feedback on whether the rules are too strict or causing friction

Rollback plan:

If issues arise, we can:

  • Temporarily disable specific rules that cause problems
  • Revert to the previous configuration if necessary
  • Adjust rule severity from "error" to "warn" to allow for gradual adoption

Copy link

vercel bot commented Mar 21, 2025

@VolodymyrBg is attempting to deploy a commit to the HUMAN Protocol Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant