CSpell Configuration
Settings
Field | Type | Description |
---|---|---|
$schema | string | Url to JSON Schema |
allowCompoundWords | boolean | True to enable compound word checking. |
cache | CacheSettings | Define cache settings. |
caseSensitive | boolean | Determines if words must match case and accent rules. |
description | string | Optional description of configuration. |
dictionaries | DictionaryReference [] | Optional list of dictionaries to use. Each entry should match the name of the dictionary. |
dictionaryDefinitions | DictionaryDefinition [] | Define additional available dictionaries. |
enableFiletypes | LanguageIdSingle [] | Enable / Disable checking file types (languageIds). |
enableGlobDot | boolean | Enable scanning files and directories beginning with . (period). |
enabled | boolean | Is the spell checker enabled. |
enabledFileTypes | object | Enable / Disable checking file types (languageIds). |
enabledLanguageIds | LanguageIdSingle [] | Specify a list of file types to spell check. It is better to use Settings.enabledFileTypes to Enable / Disable checking files types. |
failFast | boolean | Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks) |
features | Features | Configure CSpell features. |
files | Glob [] | Glob patterns of files to be checked. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
gitignoreRoot | FsPath FsPath [] | Tells the spell checker to stop searching for .gitignore files when it reaches a matching root. |
globRoot | FSPathResolvable | The root to use for glob patterns found in this configuration. |
id | string | Optional identifier. |
ignorePaths | Glob [] | Glob patterns of files to be ignored. |
ignoreRegExpList | RegExpPatternList | List of regular expression patterns or pattern names to exclude from spell checking. |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
import | FsPath FsPath [] | Allows this configuration to inherit configuration for one or more other files. |
includeRegExpList | RegExpPatternList | List of regular expression patterns or defined pattern names to match for spell checking. |
language | LocaleId | Current active spelling language. This specifies the language locale to use in choosing the |
languageId | MatchingFileType | Forces the spell checker to assume a give language id. Used mainly as an Override. |
languageSettings | LanguageSetting [] | Additional settings for individual languages. |
loadDefaultConfiguration | boolean | By default, the bundled dictionary configurations are loaded. Explicitly setting this to false |
maxDuplicateProblems | number | The maximum number of times the same word can be flagged as an error in a file. |
maxNumberOfProblems | number | The maximum number of problems to report in a file. |
minWordLength | number | The minimum length of a word before checking it against a dictionary. |
name | string | Optional name of configuration. |
noConfigSearch | boolean | Prevents searching for local configuration when checking individual documents. |
noSuggestDictionaries | DictionaryReference [] | Optional list of dictionaries that will not be used for suggestions. |
numSuggestions | number | Number of suggestions to make. |
overrides | OverrideSettings [] | Overrides are used to apply settings for specific files in your project. |
patterns | RegExpPatternDefinition [] | Defines a list of patterns that can be used with the ignoreRegExpList and |
pnpFiles | string [] | The PnP files to search for. Note: .mjs files are not currently supported. |
readonly | boolean | Indicate that the configuration file should not be modified. |
reporters | ReporterSettings [] | Define which reports to use. |
showStatus | boolean | Show status. |
spellCheckDelayMs | number | Delay in ms after a document has changed before checking it for spelling errors. |
suggestWords | string [] | A list of suggested replacements for words. |
suggestionNumChanges | number | The maximum number of changes allowed on a word to be considered a suggestions. |
suggestionsTimeout | number | The maximum amount of time in milliseconds to generate suggestions for a word. |
useGitignore | boolean | Tells the spell checker to load .gitignore files and skip files that match the globs in the .gitignore files found. |
usePnP | boolean | Packages managers like Yarn 2 use a .pnp.cjs file to assist in loading |
userWords | string [] | Words to add to global dictionary -- should only be in the user config file. |
validateDirectives | boolean | Verify that the in-document directives are correct. |
version | Version | Configuration format version of the settings file. |
words | string [] | List of words to be considered correct. |
Settings Fields
$schema
- Description
Url to JSON Schema
- Type
string
allowCompoundWords
- Description
True to enable compound word checking.
- Type
boolean
cache
- Description
Define cache settings.
- Type
caseSensitive
- Description
Determines if words must match case and accent rules.
See Case Sensitivity for more details.
false
- Case is ignored and accents can be missing on the entire word. Incorrect accents or partially missing accents will be marked as incorrect.true
- Case and accents are enforced.
- Type
boolean
description
- Description
Optional description of configuration.
- Type
string
dictionaries
- Description
Optional list of dictionaries to use. Each entry should match the name of the dictionary.
To remove a dictionary from the list, add
!
before the name.For example,
!typescript
will turn off the dictionary with the nametypescript
.See the Dictionaries and Custom Dictionaries for more details.
- Type
dictionaryDefinitions
- Description
Define additional available dictionaries.
For example, you can use the following to add a custom dictionary:
"dictionaryDefinitions": [
{ "name": "custom-words", "path": "./custom-words.txt"}
],
"dictionaries": ["custom-words"]- Type
enableFiletypes
- Description
Enable / Disable checking file types (languageIds).
These are in additional to the file types specified by Settings.enabledLanguageIds . To disable a language, prefix with
!
as in!json
,Example: individual file types
jsonc // enable checking for jsonc
!json // disable checking for json
kotlin // enable checking for kotlinExample: enable all file types
* // enable checking for all file types
!json // except for json- Type
enableGlobDot
- Description
Enable scanning files and directories beginning with
.
(period).By default, CSpell does not scan
hidden
files.- Type
boolean
enabled
- Description
Is the spell checker enabled.
- Type
boolean
enabledFileTypes
- Description
Enable / Disable checking file types (languageIds).
This setting replaces: Settings.enabledLanguageIds and Settings.enableFiletypes .
A Value of:
true
- enable checking for the file typefalse
- disable checking for the file type
A file type of
*
is a wildcard that enables all file types.Example: enable all file types
File Type Enabled Comment *
true
Enable all file types. json
false
Disable checking for json files. - Type
object
enabledLanguageIds
- Description
Specify a list of file types to spell check. It is better to use Settings.enabledFileTypes to Enable / Disable checking files types.
- Type
failFast
- Description
Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
- Type
boolean
features
- Description
Configure CSpell features.
- Type
files
- Description
Glob patterns of files to be checked.
Glob patterns are relative to the
globRoot
of the configuration file that defines them.- Type
Glob
[]
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
gitignoreRoot
- Description
Tells the spell checker to stop searching for
.gitignore
files when it reaches a matching root.- Type
globRoot
- Description
The root to use for glob patterns found in this configuration. Default: location of the configuration file. For compatibility reasons, config files with version 0.1, the glob root will default to be
${cwd}
.Use
globRoot
to define a different location.globRoot
can be relative to the location of this configuration file. Defining globRoot, does not impact imported configurations.Special Values:
${cwd}
- will be replaced with the current working directory..
- will be the location of the containing configuration file.
- Type
id
- Description
Optional identifier.
- Type
string
ignorePaths
- Description
Glob patterns of files to be ignored.
Glob patterns are relative to the globRoot of the configuration file that defines them.
- Type
Glob
[]
ignoreRegExpList
- Description
List of regular expression patterns or pattern names to exclude from spell checking.
Example:
["href"]
- to exclude html href pattern.Regular expressions use JavaScript regular expression syntax.
Example: to ignore ALL-CAPS words
JSON
"ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
YAML
ignoreRegExpList:
- >-
/\b[A-Z]+\b/gBy default, several patterns are excluded. See Configuration for more details.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
import
- Description
Allows this configuration to inherit configuration for one or more other files.
See Importing / Extending Configuration for more details.
- Type
includeRegExpList
- Description
List of regular expression patterns or defined pattern names to match for spell checking.
If this property is defined, only text matching the included patterns will be checked.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
language
- Description
Current active spelling language. This specifies the language locale to use in choosing the general dictionary.
For example:
- "en-GB" for British English.
- "en,nl" to enable both English and Dutch.
- Type
languageId
- Description
Forces the spell checker to assume a give language id. Used mainly as an Override.
- Type
languageSettings
- Description
Additional settings for individual languages.
See Language Settings for more details.
- Type
loadDefaultConfiguration
- Description
By default, the bundled dictionary configurations are loaded. Explicitly setting this to
false
will prevent ALL default configuration from being loaded.- Type
boolean
maxDuplicateProblems
- Description
The maximum number of times the same word can be flagged as an error in a file.
- Type
number
maxNumberOfProblems
- Description
The maximum number of problems to report in a file.
- Type
number
minWordLength
- Description
The minimum length of a word before checking it against a dictionary.
- Type
number
name
- Description
Optional name of configuration.
- Type
string
noConfigSearch
- Description
Prevents searching for local configuration when checking individual documents.
- Type
boolean
noSuggestDictionaries
- Description
Optional list of dictionaries that will not be used for suggestions. Words in these dictionaries are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in one of these dictionaries, it will be removed from the set of possible suggestions.
- Type
numSuggestions
- Description
Number of suggestions to make.
- Type
number
overrides
- Description
Overrides are used to apply settings for specific files in your project.
For example:
"overrides": [
// Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
{
"filename": "**/{*.hrr,*.crr}",
"languageId": "cpp"
},
// Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
{
"language": "nl",
"filename": "**/dutch/**/*.txt"
}
]- Type
patterns
- Description
Defines a list of patterns that can be used with the ignoreRegExpList and includeRegExpList options.
For example:
"ignoreRegExpList": ["comments"],
"patterns": [
{
"name": "comment-single-line",
"pattern": "/#.*/g"
},
{
"name": "comment-multi-line",
"pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
},
// You can also combine multiple named patterns into one single named pattern
{
"name": "comments",
"pattern": ["comment-single-line", "comment-multi-line"]
}
]- Type
pnpFiles
- Description
The PnP files to search for. Note:
.mjs
files are not currently supported.- Type
string
[]
readonly
- Description
Indicate that the configuration file should not be modified. This is used to prevent tools like the VS Code Spell Checker from modifying the file to add words and other configuration.
- Type
boolean
reporters
- Description
Define which reports to use.
default
- is a special name for the default cli reporter.Examples:
["default"]
- to use the default reporter["@cspell/cspell-json-reporter"]
- use the cspell JSON reporter.[["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]
[ "default", ["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]
- Use both the default reporter and the cspell-json-reporter.
- Type
showStatus
- Description
Show status.
- Type
boolean
spellCheckDelayMs
- Description
Delay in ms after a document has changed before checking it for spelling errors.
- Type
number
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
suggestionNumChanges
- Description
The maximum number of changes allowed on a word to be considered a suggestions.
For example, appending an
s
ontoexample
->examples
is considered 1 change.Range: between 1 and 5.
- Type
number
suggestionsTimeout
- Description
The maximum amount of time in milliseconds to generate suggestions for a word.
- Type
number
useGitignore
- Description
Tells the spell checker to load
.gitignore
files and skip files that match the globs in the.gitignore
files found.- Type
boolean
usePnP
- Description
Packages managers like Yarn 2 use a
.pnp.cjs
file to assist in loading packages stored in the repository.When true, the spell checker will search up the directory structure for the existence of a PnP file and load it.
- Type
boolean
userWords
- Description
Words to add to global dictionary -- should only be in the user config file.
- Type
string
[]
validateDirectives
- Description
Verify that the in-document directives are correct.
- Type
boolean
version
- Description
Configuration format version of the settings file.
This controls how the settings in the configuration file behave.
- Type
words
- Description
List of words to be considered correct.
- Type
string
[]
CacheFormat
- Type
string
CacheSettings
Field | Type | Description |
---|---|---|
cacheFormat | CacheFormat | Format of the cache file. |
cacheLocation | FSPathResolvable | Path to the cache location. Can be a file or a directory. |
cacheStrategy | CacheStrategy | Strategy to use for detecting changed files, default: metadata |
useCache | boolean | Store the results of processed files in order to only operate on the changed ones. |
CacheSettings Fields
cacheFormat
- Description
Format of the cache file.
legacy
- use absolute paths in the cache fileuniversal
- use a sharable format.
- Type
cacheLocation
- Description
Path to the cache location. Can be a file or a directory. If none specified
.cspellcache
will be used. Relative paths are relative to the config file in which it is defined.A prefix of
${cwd}
is replaced with the current working directory.- Type
cacheStrategy
- Description
Strategy to use for detecting changed files, default: metadata
- Type
useCache
- Description
Store the results of processed files in order to only operate on the changed ones.
- Type
boolean
CacheStrategy
- Description
The Strategy to use to detect if a file has changed.
metadata
- uses the file system timestamp and size to detect changes (fastest).content
- uses a hash of the file content to check file changes (slower - more accurate).
- Type
string
CharacterSet
- Description
This is a set of characters that can include
-
or|
-
- indicates a range of characters:a-c
=>abc
|
- is a group separator, indicating that the characters on either side are not related.
- Type
string
CharacterSetCosts
Field | Type | Description |
---|---|---|
characters | CharacterSet | This is a set of characters that can include - or ` |
cost | number | the cost to insert / delete / replace / swap the characters in a group |
penalty | number | The penalty cost to apply if the accent is used. |
CharacterSetCosts Fields
characters
- Description
This is a set of characters that can include
-
or|
-
- indicates a range of characters:a-c
=>abc
|
- is a group separator, indicating that the characters on either side are not related.
- Type
cost
- Description
the cost to insert / delete / replace / swap the characters in a group
- Type
number
penalty
- Description
The penalty cost to apply if the accent is used. This is used to discourage
- Type
number
CostMapDefInsDel
Field | Type | Description |
---|---|---|
description | string | A description to describe the purpose of the map. |
insDel | number | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. |
map | string | The set of substrings to map, these are generally single character strings. |
penalty | number | Add a penalty to the final cost. |
replace | number | The cost to replace of of the substrings in the map with another substring in the map. |
swap | number | The cost to swap two adjacent substrings found in the map. |
CostMapDefInsDel Fields
description
- Description
A description to describe the purpose of the map.
- Type
string
insDel
- Description
The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.
- Type
number
map
- Description
The set of substrings to map, these are generally single character strings.
Multiple sets can be defined by using a
|
to separate them.Example:
"eéê|aåá"
contains two different sets.To add a multi-character substring use
()
.Example:
"f(ph)(gh)"
results in the following set:f
,ph
,gh
.- To match the beginning of a word, use
^
:"(^I)""
. - To match the end of a word, use
$
:"(e$)(ing$)"
.
- To match the beginning of a word, use
- Type
string
penalty
- Description
Add a penalty to the final cost. This is used to discourage certain suggestions.
Example:
# Match adding/removing `-` to the end of a word.
map: "$(-$)"
replace: 50
penalty: 100This makes adding a
-
to the end of a word more expensive.Think of it as taking the toll way for speed but getting the bill later.
- Type
number
replace
- Description
The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute
a
withi
: Likebat
tobit
or the reverse.- Type
number
swap
- Description
The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change
ei
toie
or the reverse.- Type
number
CostMapDefReplace
Field | Type | Description |
---|---|---|
description | string | A description to describe the purpose of the map. |
insDel | number | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. |
map | string | The set of substrings to map, these are generally single character strings. |
penalty | number | Add a penalty to the final cost. |
replace | number | The cost to replace of of the substrings in the map with another substring in the map. |
swap | number | The cost to swap two adjacent substrings found in the map. |
CostMapDefReplace Fields
description
- Description
A description to describe the purpose of the map.
- Type
string
insDel
- Description
The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.
- Type
number
map
- Description
The set of substrings to map, these are generally single character strings.
Multiple sets can be defined by using a
|
to separate them.Example:
"eéê|aåá"
contains two different sets.To add a multi-character substring use
()
.Example:
"f(ph)(gh)"
results in the following set:f
,ph
,gh
.- To match the beginning of a word, use
^
:"(^I)""
. - To match the end of a word, use
$
:"(e$)(ing$)"
.
- To match the beginning of a word, use
- Type
string
penalty
- Description
Add a penalty to the final cost. This is used to discourage certain suggestions.
Example:
# Match adding/removing `-` to the end of a word.
map: "$(-$)"
replace: 50
penalty: 100This makes adding a
-
to the end of a word more expensive.Think of it as taking the toll way for speed but getting the bill later.
- Type
number
replace
- Description
The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute
a
withi
: Likebat
tobit
or the reverse.- Type
number
swap
- Description
The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change
ei
toie
or the reverse.- Type
number
CostMapDefSwap
Field | Type | Description |
---|---|---|
description | string | A description to describe the purpose of the map. |
insDel | number | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. |
map | string | The set of substrings to map, these are generally single character strings. |
penalty | number | Add a penalty to the final cost. |
replace | number | The cost to replace of of the substrings in the map with another substring in the map. |
swap | number | The cost to swap two adjacent substrings found in the map. |
CostMapDefSwap Fields
description
- Description
A description to describe the purpose of the map.
- Type
string
insDel
- Description
The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.
- Type
number
map
- Description
The set of substrings to map, these are generally single character strings.
Multiple sets can be defined by using a
|
to separate them.Example:
"eéê|aåá"
contains two different sets.To add a multi-character substring use
()
.Example:
"f(ph)(gh)"
results in the following set:f
,ph
,gh
.- To match the beginning of a word, use
^
:"(^I)""
. - To match the end of a word, use
$
:"(e$)(ing$)"
.
- To match the beginning of a word, use
- Type
string
penalty
- Description
Add a penalty to the final cost. This is used to discourage certain suggestions.
Example:
# Match adding/removing `-` to the end of a word.
map: "$(-$)"
replace: 50
penalty: 100This makes adding a
-
to the end of a word more expensive.Think of it as taking the toll way for speed but getting the bill later.
- Type
number
replace
- Description
The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute
a
withi
: Likebat
tobit
or the reverse.- Type
number
swap
- Description
The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change
ei
toie
or the reverse.- Type
number
CustomDictionaryPath
- Description
A File System Path to a dictionary file.
- Type
CustomDictionaryScope
- Description
Specifies the scope of a dictionary.
- Type
string
DictionaryDefinition
- Type
DictionaryDefinitionPreferred
DictionaryDefinitionCustom
DictionaryDefinitionAugmented
DictionaryDefinitionInline
DictionaryDefinitionAlternate
DictionaryDefinitionAlternate
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
file | DictionaryPath | Path to the file, only for legacy dictionary definitions. |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
repMap | ReplaceMap | Replacement pairs. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
DictionaryDefinitionAlternate Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
file
- Description
Path to the file, only for legacy dictionary definitions.
- Type
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
repMap
- Description
Replacement pairs.
- Type
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
DictionaryDefinitionAugmented
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
dictionaryInformation | DictionaryInformation | |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
path | DictionaryPath | Path to the file. |
repMap | ReplaceMap | Replacement pairs. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
DictionaryDefinitionAugmented Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
dictionaryInformation
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
path
- Description
Path to the file.
- Type
repMap
- Description
Replacement pairs.
- Type
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
DictionaryDefinitionCustom
Field | Type | Description |
---|---|---|
addWords | boolean | When true , let's the spell checker know that words can be added to this dictionary. |
description | string | Optional description of the contents / purpose of the dictionary. |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
path | CustomDictionaryPath | Path to custom dictionary text file. |
repMap | ReplaceMap | Replacement pairs. |
scope | CustomDictionaryScope CustomDictionaryScope [] | Defines the scope for when words will be added to the dictionary. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
DictionaryDefinitionCustom Fields
addWords
- Description
When
true
, let's the spell checker know that words can be added to this dictionary.- Type
boolean
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
path
- Description
Path to custom dictionary text file.
- Type
repMap
- Description
Replacement pairs.
- Type
scope
- Description
Defines the scope for when words will be added to the dictionary.
Scope values:
user
,workspace
,folder
.- Type
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
DictionaryDefinitionInline
- Description
Inline Dictionary Definitions
- Type
DictionaryDefinitionInlineWords
DictionaryDefinitionInlineIgnoreWords
DictionaryDefinitionInlineFlagWords
DictionaryDefinitionInlineSuggestWords
DictionaryDefinitionInlineFlagWords
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
repMap | ReplaceMap | Replacement pairs. |
suggestWords | string [] | A list of suggested replacements for words. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
words | string [] | List of words to be considered correct. |
DictionaryDefinitionInlineFlagWords Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
repMap
- Description
Replacement pairs.
- Type
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
words
- Description
List of words to be considered correct.
- Type
string
[]
DictionaryDefinitionInlineIgnoreWords
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
repMap | ReplaceMap | Replacement pairs. |
suggestWords | string [] | A list of suggested replacements for words. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
words | string [] | List of words to be considered correct. |
DictionaryDefinitionInlineIgnoreWords Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
repMap
- Description
Replacement pairs.
- Type
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
words
- Description
List of words to be considered correct.
- Type
string
[]
DictionaryDefinitionInlineSuggestWords
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
repMap | ReplaceMap | Replacement pairs. |
suggestWords | string [] | A list of suggested replacements for words. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
words | string [] | List of words to be considered correct. |
DictionaryDefinitionInlineSuggestWords Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
repMap
- Description
Replacement pairs.
- Type
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
words
- Description
List of words to be considered correct.
- Type
string
[]
DictionaryDefinitionInlineWords
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
repMap | ReplaceMap | Replacement pairs. |
suggestWords | string [] | A list of suggested replacements for words. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
words | string [] | List of words to be considered correct. |
DictionaryDefinitionInlineWords Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
repMap
- Description
Replacement pairs.
- Type
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
words
- Description
List of words to be considered correct.
- Type
string
[]
DictionaryDefinitionPreferred
Field | Type | Description |
---|---|---|
description | string | Optional description of the contents / purpose of the dictionary. |
name | DictionaryId | This is the name of a dictionary. |
noSuggest | boolean | Indicate that suggestions should not come from this dictionary. |
path | DictionaryPath | Path to the file. |
repMap | ReplaceMap | Replacement pairs. |
type | DictionaryFileTypes | Type of file: |
useCompounds | boolean | Use Compounds. |
DictionaryDefinitionPreferred Fields
description
- Description
Optional description of the contents / purpose of the dictionary.
- Type
string
name
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
noSuggest
- Description
Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.
- Type
boolean
path
- Description
Path to the file.
- Type
repMap
- Description
Replacement pairs.
- Type
type
- Description
Type of file:
- S - single word per line,
- W - each line can contain one or more words separated by space,
- C - each line is treated like code (Camel Case is allowed).
Default is S.
C is the slowest to load due to the need to split each line based upon code splitting rules.
Note: this settings does not apply to inline dictionaries or
.trie
files.- Type
useCompounds
- Description
Use Compounds.
- Type
boolean
DictionaryFileTypes
- Type
string
DictionaryId
- Description
This is the name of a dictionary.
Name Format:
- Must contain at least 1 number or letter.
- Spaces are allowed.
- Leading and trailing space will be removed.
- Names ARE case-sensitive.
- Must not contain
*
,!
,;
,,
,{
,}
,[
,]
,~
.
- Type
string
DictionaryInformation
Field | Type | Description |
---|---|---|
accents | CharacterSet CharacterSetCosts [] | The accent characters. |
adjustments | PatternAdjustment [] | A collection of patterns to test against the suggested words. |
alphabet | CharacterSet CharacterSetCosts [] | The alphabet to use. |
costs | EditCosts | Define edit costs. |
hunspellInformation | HunspellInformation | Used by dictionary authors |
ignore | CharacterSet | An optional set of characters that can possibly be removed from a word before |
locale | string | The locale of the dictionary. |
suggestionEditCosts | SuggestionCostsDefs | Used in making suggestions. The lower the value, the more likely the suggestion |
DictionaryInformation Fields
accents
- Description
The accent characters.
Default:
"\u0300-\u0341"
- Type
adjustments
- Description
A collection of patterns to test against the suggested words. If the word matches the pattern, then the penalty is applied.
- Type
alphabet
- Description
The alphabet to use.
- Type
costs
- Description
Define edit costs.
- Type
hunspellInformation
- Description
Used by dictionary authors
- Type
ignore
- Description
An optional set of characters that can possibly be removed from a word before checking it.
This is useful in languages like Arabic where Harakat accents are optional.
Note: All matching characters are removed or none. Partial removal is not supported.
- Type
locale
- Description
The locale of the dictionary. Example:
nl,nl-be
- Type
string
suggestionEditCosts
- Description
Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list.
- Type
DictionaryNegRef
- Description
This a negative reference to a named dictionary.
It is used to exclude or include a dictionary by name.
The reference starts with 1 or more
!
.!<dictionary_name>
- Used to exclude the dictionary matching<dictionary_name>
.!!<dictionary_name>
- Used to re-include a dictionary matching<dictionary_name>
. Overrides!<dictionary_name>
.!!!<dictionary_name>
- Used to exclude a dictionary matching<dictionary_name>
. Overrides!!<dictionary_name>
.
- Type
string
DictionaryPath
- Description
A File System Path to a dictionary file. Pattern:
^.*\.(?:txt|trie|dic)(?:\.gz)?$
- Type
string
DictionaryRef
- Description
This a reference to a named dictionary. It is expected to match the name of a dictionary.
- Type
DictionaryReference
- Description
Reference to a dictionary by name. One of:
- Type
EditCosts
Field | Type | Description |
---|---|---|
accentCosts | number | The cost to add / remove an accent |
baseCost | number | This is the base cost for making an edit. |
capsCosts | number | The cost to change capitalization. |
firstLetterPenalty | number | The extra cost incurred for changing the first letter of a word. |
nonAlphabetCosts | number | This is the cost for characters not in the alphabet. |
EditCosts Fields
accentCosts
- Description
The cost to add / remove an accent This should be very cheap, it helps with fixing accent issues.
- Type
number
baseCost
- Description
This is the base cost for making an edit.
- Type
number
capsCosts
- Description
The cost to change capitalization. This should be very cheap, it helps with fixing capitalization issues.
- Type
number
firstLetterPenalty
- Description
The extra cost incurred for changing the first letter of a word. This value should be less than
100 - baseCost
.- Type
number
nonAlphabetCosts
- Description
This is the cost for characters not in the alphabet.
- Type
number
FSPathResolvable
- Description
A File System Path.
Special Properties:
${cwd}
prefix - will be replaced with the current working directory.- Relative paths are relative to the configuration file.
- Type
FeatureEnableOnly
- Type
boolean
Features
Field | Type | Description |
---|---|---|
weighted-suggestions | FeatureEnableOnly | Enable/disable using weighted suggestions. |
Features Fields
weighted-suggestions
- Description
Enable/disable using weighted suggestions.
- Type
FsDictionaryPath
- Description
A File System Path. Relative paths are relative to the configuration file.
- Type
string
FsPath
- Description
A File System Path. Relative paths are relative to the configuration file.
- Type
string
Glob
- Description
These are glob expressions.
- Type
HunspellInformation
Field | Type | Description |
---|---|---|
aff | string | Selected Hunspell AFF content. |
costs | object | The costs to apply when using the hunspell settings |
HunspellInformation Fields
aff
- Description
Selected Hunspell AFF content. The content must be UTF-8
Sections:
- TRY
- MAP
- REP
- KEY
- ICONV
- OCONV
Example:
# Comment
TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
MAP aàâäAÀÂÄ
MAP eéèêëEÉÈÊË
MAP iîïyIÎÏY
MAP oôöOÔÖ
MAP (IJ)(IJ)- Type
string
costs
- Description
The costs to apply when using the hunspell settings
- Type
object
LanguageId
LanguageIdMultiple
- Description
A single string with a comma separated list of file types:
typescript,cpp
json,jsonc,yaml
- etc.
- Type
string
LanguageIdMultipleNeg
- Description
A Negative File Type used to exclude files of that type.
!typescript
- will exclude typescript files.!cpp,!json
- will exclude cpp and json files.!typescript,javascript
- will exclude typescript files and include javascript files.
- Type
string
LanguageIdSingle
- Description
A file type:
*
- will match ALL file types.typescript
,cpp
,json
, etc.
- Type
string
LanguageSetting
Field | Type | Description |
---|---|---|
allowCompoundWords | boolean | True to enable compound word checking. |
caseSensitive | boolean | Determines if words must match case and accent rules. |
description | string | Optional description of configuration. |
dictionaries | DictionaryReference [] | Optional list of dictionaries to use. Each entry should match the name of the dictionary. |
dictionaryDefinitions | DictionaryDefinition [] | Define additional available dictionaries. |
enabled | boolean | Is the spell checker enabled. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
id | string | Optional identifier. |
ignoreRegExpList | RegExpPatternList | List of regular expression patterns or pattern names to exclude from spell checking. |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
includeRegExpList | RegExpPatternList | List of regular expression patterns or defined pattern names to match for spell checking. |
languageId | MatchingFileType | The language id. Ex: typescript , html , or php . * -- will match all languages. |
local | LocaleId LocaleId [] | Deprecated - The locale filter, matches against the language. This can be a comma separated list. * will match all locales. |
locale | LocaleId LocaleId [] | The locale filter, matches against the language. This can be a comma separated list. * will match all locales. |
name | string | Optional name of configuration. |
noSuggestDictionaries | DictionaryReference [] | Optional list of dictionaries that will not be used for suggestions. |
patterns | RegExpPatternDefinition [] | Defines a list of patterns that can be used with the ignoreRegExpList and |
suggestWords | string [] | A list of suggested replacements for words. |
words | string [] | List of words to be considered correct. |
LanguageSetting Fields
allowCompoundWords
- Description
True to enable compound word checking.
- Type
boolean
caseSensitive
- Description
Determines if words must match case and accent rules.
See Case Sensitivity for more details.
false
- Case is ignored and accents can be missing on the entire word. Incorrect accents or partially missing accents will be marked as incorrect.true
- Case and accents are enforced.
- Type
boolean
description
- Description
Optional description of configuration.
- Type
string
dictionaries
- Description
Optional list of dictionaries to use. Each entry should match the name of the dictionary.
To remove a dictionary from the list, add
!
before the name.For example,
!typescript
will turn off the dictionary with the nametypescript
.See the Dictionaries and Custom Dictionaries for more details.
- Type
dictionaryDefinitions
- Description
Define additional available dictionaries.
For example, you can use the following to add a custom dictionary:
"dictionaryDefinitions": [
{ "name": "custom-words", "path": "./custom-words.txt"}
],
"dictionaries": ["custom-words"]- Type
enabled
- Description
Is the spell checker enabled.
- Type
boolean
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
id
- Description
Optional identifier.
- Type
string
ignoreRegExpList
- Description
List of regular expression patterns or pattern names to exclude from spell checking.
Example:
["href"]
- to exclude html href pattern.Regular expressions use JavaScript regular expression syntax.
Example: to ignore ALL-CAPS words
JSON
"ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
YAML
ignoreRegExpList:
- >-
/\b[A-Z]+\b/gBy default, several patterns are excluded. See Configuration for more details.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
includeRegExpList
- Description
List of regular expression patterns or defined pattern names to match for spell checking.
If this property is defined, only text matching the included patterns will be checked.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
languageId
- Description
The language id. Ex:
typescript
,html
, orphp
.*
-- will match all languages.- Type
local
- Description
Deprecated - The locale filter, matches against the language. This can be a comma separated list.
*
will match all locales.- Type
locale
- Description
The locale filter, matches against the language. This can be a comma separated list.
*
will match all locales.- Type
name
- Description
Optional name of configuration.
- Type
string
noSuggestDictionaries
- Description
Optional list of dictionaries that will not be used for suggestions. Words in these dictionaries are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in one of these dictionaries, it will be removed from the set of possible suggestions.
- Type
patterns
- Description
Defines a list of patterns that can be used with the ignoreRegExpList and includeRegExpList options.
For example:
"ignoreRegExpList": ["comments"],
"patterns": [
{
"name": "comment-single-line",
"pattern": "/#.*/g"
},
{
"name": "comment-multi-line",
"pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
},
// You can also combine multiple named patterns into one single named pattern
{
"name": "comments",
"pattern": ["comment-single-line", "comment-multi-line"]
}
]- Type
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
words
- Description
List of words to be considered correct.
- Type
string
[]
LocaleId
- Description
This is a written language locale like:
en
,en-GB
,fr
,es
,de
oren,fr
for both English and French- Type
string
MatchingFileType
- Type
OverrideSettings
Field | Type | Description |
---|---|---|
allowCompoundWords | boolean | True to enable compound word checking. |
caseSensitive | boolean | Determines if words must match case and accent rules. |
description | string | Optional description of configuration. |
dictionaries | DictionaryReference [] | Optional list of dictionaries to use. Each entry should match the name of the dictionary. |
dictionaryDefinitions | DictionaryDefinition [] | Define additional available dictionaries. |
enableFiletypes | LanguageIdSingle [] | Enable / Disable checking file types (languageIds). |
enabled | boolean | Is the spell checker enabled. |
enabledFileTypes | object | Enable / Disable checking file types (languageIds). |
enabledLanguageIds | LanguageIdSingle [] | Specify a list of file types to spell check. It is better to use Settings.enabledFileTypes to Enable / Disable checking files types. |
filename | Glob Glob [] | Glob pattern or patterns to match against. |
flagWords | string [] | List of words to always be considered incorrect. Words found in flagWords override words . |
id | string | Optional identifier. |
ignoreRegExpList | RegExpPatternList | List of regular expression patterns or pattern names to exclude from spell checking. |
ignoreWords | string [] | List of words to be ignored. An ignored word will not show up as an error, even if it is |
includeRegExpList | RegExpPatternList | List of regular expression patterns or defined pattern names to match for spell checking. |
language | LocaleId | Sets the locale. |
languageId | MatchingFileType | Sets the programming language id to match file type. |
languageSettings | LanguageSetting [] | Additional settings for individual languages. |
loadDefaultConfiguration | boolean | By default, the bundled dictionary configurations are loaded. Explicitly setting this to false |
maxDuplicateProblems | number | The maximum number of times the same word can be flagged as an error in a file. |
maxNumberOfProblems | number | The maximum number of problems to report in a file. |
minWordLength | number | The minimum length of a word before checking it against a dictionary. |
name | string | Optional name of configuration. |
noSuggestDictionaries | DictionaryReference [] | Optional list of dictionaries that will not be used for suggestions. |
numSuggestions | number | Number of suggestions to make. |
patterns | RegExpPatternDefinition [] | Defines a list of patterns that can be used with the ignoreRegExpList and |
pnpFiles | string [] | The PnP files to search for. Note: .mjs files are not currently supported. |
suggestWords | string [] | A list of suggested replacements for words. |
suggestionNumChanges | number | The maximum number of changes allowed on a word to be considered a suggestions. |
suggestionsTimeout | number | The maximum amount of time in milliseconds to generate suggestions for a word. |
usePnP | boolean | Packages managers like Yarn 2 use a .pnp.cjs file to assist in loading |
words | string [] | List of words to be considered correct. |
OverrideSettings Fields
allowCompoundWords
- Description
True to enable compound word checking.
- Type
boolean
caseSensitive
- Description
Determines if words must match case and accent rules.
See Case Sensitivity for more details.
false
- Case is ignored and accents can be missing on the entire word. Incorrect accents or partially missing accents will be marked as incorrect.true
- Case and accents are enforced.
- Type
boolean
description
- Description
Optional description of configuration.
- Type
string
dictionaries
- Description
Optional list of dictionaries to use. Each entry should match the name of the dictionary.
To remove a dictionary from the list, add
!
before the name.For example,
!typescript
will turn off the dictionary with the nametypescript
.See the Dictionaries and Custom Dictionaries for more details.
- Type
dictionaryDefinitions
- Description
Define additional available dictionaries.
For example, you can use the following to add a custom dictionary:
"dictionaryDefinitions": [
{ "name": "custom-words", "path": "./custom-words.txt"}
],
"dictionaries": ["custom-words"]- Type
enableFiletypes
- Description
Enable / Disable checking file types (languageIds).
These are in additional to the file types specified by Settings.enabledLanguageIds . To disable a language, prefix with
!
as in!json
,Example: individual file types
jsonc // enable checking for jsonc
!json // disable checking for json
kotlin // enable checking for kotlinExample: enable all file types
* // enable checking for all file types
!json // except for json- Type
enabled
- Description
Is the spell checker enabled.
- Type
boolean
enabledFileTypes
- Description
Enable / Disable checking file types (languageIds).
This setting replaces: Settings.enabledLanguageIds and Settings.enableFiletypes .
A Value of:
true
- enable checking for the file typefalse
- disable checking for the file type
A file type of
*
is a wildcard that enables all file types.Example: enable all file types
File Type Enabled Comment *
true
Enable all file types. json
false
Disable checking for json files. - Type
object
enabledLanguageIds
- Description
Specify a list of file types to spell check. It is better to use Settings.enabledFileTypes to Enable / Disable checking files types.
- Type
filename
flagWords
- Description
List of words to always be considered incorrect. Words found in
flagWords
overridewords
.Format of
flagWords
- single word entry -
word
- with suggestions -
word:suggestion
orword->suggestion, suggestions
Example:
"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]- single word entry -
- Type
string
[]
id
- Description
Optional identifier.
- Type
string
ignoreRegExpList
- Description
List of regular expression patterns or pattern names to exclude from spell checking.
Example:
["href"]
- to exclude html href pattern.Regular expressions use JavaScript regular expression syntax.
Example: to ignore ALL-CAPS words
JSON
"ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
YAML
ignoreRegExpList:
- >-
/\b[A-Z]+\b/gBy default, several patterns are excluded. See Configuration for more details.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
ignoreWords
- Description
List of words to be ignored. An ignored word will not show up as an error, even if it is also in the
flagWords
.- Type
string
[]
includeRegExpList
- Description
List of regular expression patterns or defined pattern names to match for spell checking.
If this property is defined, only text matching the included patterns will be checked.
While you can create your own patterns, you can also leverage several patterns that are built-in to CSpell.
- Type
language
- Description
Sets the locale.
- Type
languageId
- Description
Sets the programming language id to match file type.
- Type
languageSettings
- Description
Additional settings for individual languages.
See Language Settings for more details.
- Type
loadDefaultConfiguration
- Description
By default, the bundled dictionary configurations are loaded. Explicitly setting this to
false
will prevent ALL default configuration from being loaded.- Type
boolean
maxDuplicateProblems
- Description
The maximum number of times the same word can be flagged as an error in a file.
- Type
number
maxNumberOfProblems
- Description
The maximum number of problems to report in a file.
- Type
number
minWordLength
- Description
The minimum length of a word before checking it against a dictionary.
- Type
number
name
- Description
Optional name of configuration.
- Type
string
noSuggestDictionaries
- Description
Optional list of dictionaries that will not be used for suggestions. Words in these dictionaries are considered correct, but will not be used when making spell correction suggestions.
Note: if a word is suggested by another dictionary, but found in one of these dictionaries, it will be removed from the set of possible suggestions.
- Type
numSuggestions
- Description
Number of suggestions to make.
- Type
number
patterns
- Description
Defines a list of patterns that can be used with the ignoreRegExpList and includeRegExpList options.
For example:
"ignoreRegExpList": ["comments"],
"patterns": [
{
"name": "comment-single-line",
"pattern": "/#.*/g"
},
{
"name": "comment-multi-line",
"pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
},
// You can also combine multiple named patterns into one single named pattern
{
"name": "comments",
"pattern": ["comment-single-line", "comment-multi-line"]
}
]- Type
pnpFiles
- Description
The PnP files to search for. Note:
.mjs
files are not currently supported.- Type
string
[]
suggestWords
- Description
A list of suggested replacements for words. Suggested words provide a way to make preferred suggestions on word replacements. To hint at a preferred change, but not to require it.
Format of
suggestWords
- Single suggestion (possible auto fix)
word: suggestion
word->suggestion
- Multiple suggestions (not auto fixable)
word: first, second, third
word->first, second, third
- Single suggestion (possible auto fix)
- Type
string
[]
suggestionNumChanges
- Description
The maximum number of changes allowed on a word to be considered a suggestions.
For example, appending an
s
ontoexample
->examples
is considered 1 change.Range: between 1 and 5.
- Type
number
suggestionsTimeout
- Description
The maximum amount of time in milliseconds to generate suggestions for a word.
- Type
number
usePnP
- Description
Packages managers like Yarn 2 use a
.pnp.cjs
file to assist in loading packages stored in the repository.When true, the spell checker will search up the directory structure for the existence of a PnP file and load it.
- Type
boolean
words
- Description
List of words to be considered correct.
- Type
string
[]
Pattern
- Type
string
PatternAdjustment
Field | Type | Description |
---|---|---|
id | string | Id of the Adjustment, i.e. short-compound |
penalty | number | The amount of penalty to apply. |
regexp | string | RegExp pattern to match |
PatternAdjustment Fields
id
- Description
Id of the Adjustment, i.e.
short-compound
- Type
string
penalty
- Description
The amount of penalty to apply.
- Type
number
regexp
- Description
RegExp pattern to match
- Type
string
PatternId
- Description
This matches the name in a pattern definition.
- Type
string
PatternRef
- Description
A PatternRef is a Pattern or PatternId.
- Type
PredefinedPatterns
- Type
string
RegExpPatternDefinition
Field | Type | Description |
---|---|---|
description | string | Description of the pattern. |
name | PatternId | Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList. |
pattern | Pattern Pattern [] | RegExp pattern or array of RegExp patterns. |
RegExpPatternDefinition Fields
description
- Description
Description of the pattern.
- Type
string
name
- Description
Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList. It is possible to redefine one of the predefined patterns to override its value.
- Type
pattern
RegExpPatternList
- Description
A list of pattern names or regular expressions.
- Type
PatternRef
[]
ReplaceEntry
- Type
string
[]
ReplaceMap
- Type
ReplaceEntry
[]
ReporterModuleName
- Description
The module or path to the the reporter to load.
- Type
string
ReporterOptions
- Description
Options to send to the reporter. These are defined by the reporter.
- Type
ReporterSettings
- Description
Declare a reporter to use.
default
- is a special name for the default cli reporter.Examples:
"default"
- to use the default reporter"@cspell/cspell-json-reporter"
- use the cspell JSON reporter.["@cspell/cspell-json-reporter", { "outFile": "out.json" }]
- Type
ReporterModuleName
ReporterModuleName
[]
Unknown
[]
Serializable
- Type
number
string
boolean
null
object
SimpleGlob
- Description
Simple Glob string, the root will be globRoot.
- Type
string
SuggestionCostMapDef
- Description
A WeightedMapDef enables setting weights for edits between related characters and substrings.
Multiple groups can be defined using a
|
. A multi-character substring is defined using()
.For example, in some languages, some letters sound alike.
map: 'sc(sh)(sch)(ss)|t(tt)' # two groups.
replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.The following could be used to make inserting, removing, or replacing vowels cheaper.
map: 'aeiouy'
insDel: 50 # Make it is cheaper to insert or delete a vowel.
replace: 45 # It is even cheaper to replace one with another.Note: the default edit distance is 100.
- Type
SuggestionCostsDefs
- Type
Version
VersionLatest
- Description
Configuration File Version.
- Type
string
VersionLegacy
- Description
Legacy Configuration File Versions.
- Type
string