Skip to content

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

Merged
malept merged 1 commit into
mainfrom
malept/dt-5641/fix/graphql-lint-hashtag-ignore-directives
Oct 27, 2026
Merged

malept merged 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.

@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

@Ned-el-ch Ned-el-ch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@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 force-pushed the malept/dt-5641/fix/graphql-lint-hashtag-ignore-directives branch from eb6c9fb to d4a6535 Compare October 27, 2026 15:28
@malept
malept merged commit 53ee6ec into main Oct 27, 2026
14 checks passed
@malept
malept deleted the malept/dt-5641/fix/graphql-lint-hashtag-ignore-directives branch October 27, 2026 15:59
@getoutreach-ci-2

Copy link
Copy Markdown

🎉 This PR is included in version 2.41.0-rc.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants