spell-check

Since 0.9.0 · In the rulesets: Strict at warning, All at warning

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.

The rule applies to definitions. An # apigenie-lint-disable spell-check comment on a node turns it off for the node and everything nested in it; at the top of the file, separated from the first definition by a blank line, the comment turns it off for the whole file.

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 }]

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! }

Turn it off or change its severity

In apigenie.yaml, off turns the rule off and warning or error sets its severity; a rule with options takes the severity and the options as a pair, [warning, options]. lint.graphql has the details.

commands:
  lint:
    graphql:
      rules:
        spell-check: off
Was this helpful?