Repository navigation
feat(graphql): add native devbase-lint suppression comments - #1260
Open
malept wants to merge 1 commit into
Conversation
Add suppression comments owned by devbase, so schemas can stop carrying ESLint-specific ones once ESLint is gone, and so devbase can enforce what other linters learned: name the rule, give a reason, and do not let stale suppressions rot. Support "# devbase-lint-disable-next-line", "-disable-line", "-disable" and "-enable" for Tier 2 and Tier 3 rules, named by their bare devbase name. A disable directive must name at least one rule and give a reason, either inline after "--" or as a "# Why:" comment block directly above a disable-next-line or disable directive. A description below a disable-next-line directive is skipped, since violations are reported on the name's line. A directive that is malformed, names an unknown or unsuppressible rule, or has no reason suppresses nothing and is reported as invalid-suppression. A valid directive that suppresses no violation of a rule it names is reported as unused-suppression. Both default to error, cannot be suppressed, and can be lowered or turned off in scripts/devbase.yaml. no-hashtag-description skips devbase-lint comments as it does eslint ones. Assisted-By: claude-sonnet 5.5 via opencode
malept
added this pull request to stack #1261
October 24, 2026 00:22
|
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 can only silence a rule today with
# eslint-disablecomments, which tie them to ESLint after the linter changes. Other linters have also learned that suppressions need a named rule and a reason, and that stale ones should be reported.Add suppression comments owned by devbase:
# devbase-lint-disable-next-line,-disable-line,-disableand-enable, for Tier 2 and Tier 3 rules named by their bare devbase name.--or as a# Why:comment block directly above adisable-next-lineordisabledirective.invalid-suppression.unused-suppression.error, cannot be suppressed, and can be lowered or turned off inscripts/devbase.yaml.no-hashtag-descriptionskipsdevbase-lint-comments, as it doeseslintones. Theeslint-directives keep working as before.Jira ID
DT-5644
Notes for your reviewers
The lexer gives a multi-line block string the line it ends on, not the line it starts on.
disable-next-lineskips a description below the directive, because violations are reported on the name's line, so it finds the description's start line from the token's rune offset.Rejected review findings and intentional non-goals
These were considered during design and deliberately left as they are. Do not raise them again unless the reasoning below no longer holds.
Rejected findings
Intentional behavior
# Why:block does not work fordisable-lineor for a trailing directive. A block above the code would be read byno-hashtag-descriptionas a description, so those forms take only an inline-- reason. Usedisable-next-linefor a long reason.@graphql-eslint/rule prefix is not accepted in native directives.eslint-directives are not reported.eslint-ones, so a violation covered by both counts as used for the native directive.scripts/devbase.yaml, and a way to list suppressed violations are out of scope.