Interface ExtendableSettings

In the below JSDoc comment, we helpfully specify an example configuration for the end-user to reference. And this example will get captured by the automatic documentation generator.

However, specifying the glob pattern inside of a JSDoc is tricky, because the glob contains the same symbol as the end-of-JSDoc symbol. To work around this, we insert a zero-width space in between the "*" and the "/" symbols.

interface ExtendableSettings {
    allowCompoundWords?: boolean;
    caseSensitive?: boolean;
    description?: string;
    dictionaries?: string[];
    dictionaryDefinitions?: DictionaryDefinition[];
    enabled?: boolean;
    enabledFileTypes?: Record<string, boolean>;
    enabledLanguageIds?: string[];
    enableFiletypes?: string[];
    flagWords?: string[];
    id?: string;
    ignoreRegExpList?: RegExpPatternList;
    ignoreWords?: string[];
    includeRegExpList?: RegExpPatternList;
    language?: string;
    languageId?: MatchingFileType;
    languageSettings?: LanguageSetting[];
    loadDefaultConfiguration?: boolean;
    maxDuplicateProblems?: number;
    maxNumberOfProblems?: number;
    minWordLength?: number;
    name?: string;
    noSuggestDictionaries?: string[];
    numSuggestions?: number;
    overrides?: OverrideSettings[];
    parser?: string;
    patterns?: RegExpPatternDefinition[];
    pnpFiles?: string[];
    suggestionNumChanges?: number;
    suggestionsTimeout?: number;
    suggestWords?: string[];
    usePnP?: boolean;
    words?: string[];
}

Hierarchy (view full)

Properties

allowCompoundWords?: boolean

True to enable compound word checking.

false
caseSensitive?: boolean

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.
false
description?: string

Optional description of configuration.

dictionaries?: string[]

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 name typescript.

See the Dictionaries and Custom Dictionaries for more details.

dictionaryDefinitions?: DictionaryDefinition[]

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"]
enabled?: boolean

Is the spell checker enabled.

true
enabledFileTypes?: Record<string, boolean>

Enable / Disable checking file types (languageIds).

This setting replaces: Settings.enabledLanguageIds and Settings.enableFiletypes.

A Value of:

  • true - enable checking for the file type
  • false - 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.

Enabled File Types to Check

8.8.1

enabledLanguageIds?: string[]

Specify a list of file types to spell check. It is better to use Settings.enabledFileTypes to Enable / Disable checking files types.

Enabled Language Ids

true

enableFiletypes?: string[]

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 kotlin

Example: enable all file types

*           // enable checking for all file types
!json // except for json

Enable File Types

resource

true

flagWords?: string[]

List of words to always be considered incorrect. Words found in flagWords override words.

Format of flagWords

  • single word entry - word
  • with suggestions - word:suggestion or word->suggestion, suggestions

Example:

"flagWords": [
"color: colour",
"incase: in case, encase",
"canot->cannot",
"cancelled->canceled"
]
id?: string

Optional identifier.

ignoreRegExpList?: RegExpPatternList

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/g

By 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.

ignoreWords?: string[]

List of words to be ignored. An ignored word will not show up as an error, even if it is also in the flagWords.

includeRegExpList?: RegExpPatternList

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.

language?: string

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.
"en"
languageId?: MatchingFileType

Forces the spell checker to assume a give language id. Used mainly as an Override.

languageSettings?: LanguageSetting[]

Additional settings for individual languages.

See Language Settings for more details.

loadDefaultConfiguration?: boolean

By default, the bundled dictionary configurations are loaded. Explicitly setting this to false will prevent ALL default configuration from being loaded.

true
maxDuplicateProblems?: number

The maximum number of times the same word can be flagged as an error in a file.

5
maxNumberOfProblems?: number

The maximum number of problems to report in a file.

10000
minWordLength?: number

The minimum length of a word before checking it against a dictionary.

4
name?: string

Optional name of configuration.

noSuggestDictionaries?: string[]

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.

numSuggestions?: number

Number of suggestions to make.

10
overrides?: OverrideSettings[]

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"
}
]
parser?: string

Parser to use for the file content

6.2.0

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"]
}
]
pnpFiles?: string[]

The PnP files to search for. Note: .mjs files are not currently supported.

[".pnp.js", ".pnp.cjs"]
suggestionNumChanges?: number

The maximum number of changes allowed on a word to be considered a suggestions.

For example, appending an s onto example -> examples is considered 1 change.

Range: between 1 and 5.

3
suggestionsTimeout?: number

The maximum amount of time in milliseconds to generate suggestions for a word.

500
suggestWords?: string[]

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
usePnP?: boolean

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.

false
words?: string[]

List of words to be considered correct.