Skip to content

Using non-default cspell-dicts with pre-commit #3426

Discussion options

You must be logged in to vote

I have figured out something that works. Using French as example:

In one's pre-commit-config.yaml one needs:

    hooks:
      - id: cspell
        additional_dependencies:
          - "@cspell/dict-fr-fr"
          - "@cspell/dict-fr-reforme"
        args:
          - "lint"
          - "--locale"
          - "fr" # We do this for this doc's simplicity

You can of course use overrides to set the locale for some glob instead of checking all files with this locale. In this case it is just a convenient way to auto-enable the french dictionaries.

In one's cspell.json one needs:

"import": [
  "@cspell/dict-fr-fr/cspell-ext.json",
  "@cspell/dict-fr-reforme/cspell-ext.json"
]

cspell link add doe…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lwbt
Comment options

Answer selected by danielfdickinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants