Skip to content

fix(graphql): skip eslint directive comments in no-hashtag-description - #1257

Open
malept wants to merge 1 commit into
mainfrom
malept/dt-5641/fix/graphql-lint-hashtag-ignore-directives
Open

malept wants to merge 1 commit into
mainfrom
malept/dt-5641/fix/graphql-lint-hashtag-ignore-directives

Conversation

@malept

@malept malept commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it

no-hashtag-description reports a # comment placed directly above a definition as a description written the wrong way. That includes # eslint-disable ... directives, which the @graphql-eslint rule skips. The devbase port flagged them, so schemas that pass ESLint failed here.

Skip the comment when its text starts with eslint, as the ESLint rule does.

Jira ID

DT-5641

Notes for your reviewers

The test that expected # eslint-disable-next-line to be flagged is now a valid case. It had been inverted from the upstream suite because devbase had no suppression syntax at the time. Honoring the directives themselves is a separate change.

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

  • Rename isEslintDirective to isESLintDirective. Every identifier in this package that mentions ESLint uses lowercase eslint, so a single capitalized name would be inconsistent.

Intentional behavior

  • The check is case-sensitive and matches only when the comment text starts with eslint, as the upstream rule does.
  • Only the last comment of a group before a definition is examined, as upstream does. A group ending in prose is reported even if an earlier line is a directive.
  • Other rules do not look at eslint comments here. Acting on the directives is a separate change.

@graphql-eslint's no-hashtag-description ignores a comment whose text
starts with "eslint", so a directive such as "# eslint-disable ..."
above a definition is not reported. The devbase port treated it as a
description and flagged it, which made the rule report violations that
the ESLint rule it replaces does not.

Skip the last comment before a definition when its text starts with
"eslint", matching the ESLint rule.

Assisted-By: claude-sonnet 5.5 via opencode
@malept
malept added this pull request to stack #1261 October 24, 2026 00:22
@getoutreach-ci-1

Copy link
Copy Markdown
Contributor

Link to code coverage report (posted by coverbot 🤖)

@malept
malept marked this pull request as ready for review October 24, 2026 00:33
@malept
malept requested a review from a team as a code owner October 24, 2026 00:33
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