Linter rulesGraphQLspell-check

spell-check

Since 0.9.0

This rule checks the spelling of descriptions and comments.

Rule Details

Descriptions are the documentation of a schema. The rule checks them, as Markdown, and the comments of the definitions that can have descriptions, with a built-in English dictionary. Code in backticks, identifiers and URLs are skipped.

Configuration

The configuration block is an object with the properties:

  • dictionary and affix: the paths of Hunspell dictionary and affix files that replace the built-in dictionary; they must be given together
  • words: extra words, e.g. product names
  • suggestions: the maximum number of suggestions, from 0 to 10, 3 by default
version: "1.0"
commands:
  lint:
    graphql:
      rules:
        spell-check: [warning, { words: [Acme], suggestions: 1 }]

The rule can be disabled for a node and everything nested in it with an # apigenie-lint-disable spell-check comment on the node, or for a whole file with the comment at the top of the file, separated from the first definition by a blank line. It applies to definitions.

Examples

Good.

"The users of the service."
type User { id: ID! }

Bad. The linter reports Misspelled word 'sevrice' in description (did you mean 'service'?).

"The users of the sevrice."
type User { id: ID! }