Using non-default cspell-dicts with pre-commit #3426
-
It looks like the Unless I am mistaken, the automatic adding of the dictionaries to the It seems to me, the most realistic way to make non-default E.g. modifying from the fr_FR dictionary's README, with {
// …
"import": ["./cspell-dicts/dictionaries/fr_FR/cspell-ext.json"],
// …
} Is there a better way to do this with with EDIT: This 'almost' works, except the I don't think there is a way to get what I want without either writing a new So I found EDIT again: It may not be necessary to modify |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have figured out something that works. Using French as example: In one's 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 In one's "import": [
"@cspell/dict-fr-fr/cspell-ext.json",
"@cspell/dict-fr-reforme/cspell-ext.json"
]
|
Beta Was this translation helpful? Give feedback.
I have figured out something that works. Using French as example:
In one's
pre-commit-config.yaml
one needs: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:cspell link add
doe…