Rules
No Hashtag Description

no-hashtag-description

✅ The "extends": "plugin:@graphql-eslint/schema-recommended" property in a configuration file enables this rule.

💡 This rule provides suggestions

  • Category: Schema
  • Rule name: @graphql-eslint/no-hashtag-description
  • Requires GraphQL Schema: false ℹ️
  • Requires GraphQL Operations: false ℹ️

Requires to use """ or " for adding a GraphQL description instead of #. Allows to use hashtag for comments, as long as it’s not attached to an AST definition.

Usage Examples

Incorrect

# eslint @graphql-eslint/no-hashtag-description: 'error'
 
# Represents a user
type User {
  id: ID!
  name: String
}

Correct

# eslint @graphql-eslint/no-hashtag-description: 'error'
 
" Represents a user "
type User {
  id: ID!
  name: String
}

Correct

# eslint @graphql-eslint/no-hashtag-description: 'error'
 
# This file defines the basic User type.
# This comment is valid because it's not attached specifically to an AST object.
 
" Represents a user "
type User {
  id: ID! # This one is also valid, since it comes after the AST object
  name: String
}

Resources