Repository navigation
feat(graphql): honor eslint-disable comments when linting schema - #1258
Open
malept wants to merge 1 commit into
Conversation
Repositories already carry "# eslint-disable ..." comments to silence @graphql-eslint rules, and the devbase port ignored them, so it reported violations those comments suppress. Honor eslint-disable, eslint-enable and eslint-disable-next-line comments for Tier 2 and Tier 3 rules, naming a rule as "@graphql-eslint/<rule>" or by its bare name, with an optional "--" reason. A directive naming no rule covers every suppressible rule. Tier 1 and unclassified gqlparser violations are never suppressed. eslint-disable-line is not supported. Assisted-By: claude-sonnet 5.5 via opencode
malept
added this pull request to stack #1261
October 24, 2026 00:22
Contributor
|
Link to code coverage report (posted by coverbot 🤖) |
malept
marked this pull request as ready for review
October 24, 2026 00:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
Schemas already carry
# eslint-disable ...comments to silence@graphql-eslintrules. Devbase ignored them and reported the violations they suppress, so it could not replace ESLint on those schemas.Honor
# eslint-disable,# eslint-enableand# eslint-disable-next-linefor Tier 2 and Tier 3 rules. A rule is named as@graphql-eslint/<rule>or by its bare name, a-- reasonsuffix is ignored, and a directive naming no rule covers every suppressible rule. Tier 1 violations are never suppressed, since they are parse and schema validity errors.eslint-disable-lineis not supported because the schemas this was tested against do not use it.Jira ID
DT-5642
Notes for your reviewers
Suppression is a filter over the violations a run produces, using each violation's file and line, so
--diffmode gets it too. Directives are read from real comment tokens, so text inside a description block string is never a directive.Rejected review findings and intentional non-goals
These were raised in earlier reviews and deliberately left as they are. Do not raise them again unless the reasoning below no longer holds.
Rejected findings
constblock of directive kinds. The repo'sdoculintrequires a comment on everyconstblock.var restinparseEslintDirective. The current form is acceptable and a rewrite would not be clearer.Intentional behavior
eslint-disable-lineis not supported, and a line using it silences nothing and produces no warning.unsuppressibleRulesguard cannot be reached today, because Tier 1 violations return fromFilesFromSourcesbefore suppression runs. It stays as protection against that order changing, and a test callswithoutSuppresseddirectly to cover it.suppressesreplays directives for each violation. That is not significant at schema scale.