Skip to main content

Interface: AdvancedCSpellSettingsWithSourceTrace

Defined in: CSpellSettingsDef.ts:30

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.

Extends

Properties

__importRef?

optional __importRef: ImportFileRef

Defined in: CSpellSettingsDef.ts:26

Inherited from

CSpellSettingsWithSourceTrace.__importRef


__imports?

optional __imports: Map<string, ImportFileRef>

Defined in: CSpellSettingsDef.ts:27

Inherited from

CSpellSettingsWithSourceTrace.__imports


$schema?

optional $schema: string

Defined in: CSpellSettingsDef.ts:39

Url to JSON Schema

Default

"https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"

Inherited from

CSpellSettingsWithSourceTrace.$schema


allowCompoundWords?

optional allowCompoundWords: boolean

Defined in: CSpellSettingsDef.ts:475

True to enable compound word checking.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.allowCompoundWords


cache?

optional cache: CacheSettings

Defined in: CSpellSettingsDef.ts:386

Define cache settings.

Inherited from

CSpellSettingsWithSourceTrace.cache


caseSensitive?

optional caseSensitive: boolean

Defined in: CSpellSettingsDef.ts:488

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.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.caseSensitive


description?

optional description: string

Defined in: CSpellSettingsDef.ts:462

Optional description of configuration.

Inherited from

CSpellSettingsWithSourceTrace.description


dictionaries?

optional dictionaries: string[]

Defined in: CSpellSettingsDef.ts:514

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.

Inherited from

CSpellSettingsWithSourceTrace.dictionaries


dictionaryDefinitions?

optional dictionaryDefinitions: DictionaryDefinition[]

Defined in: CSpellSettingsDef.ts:502

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

Inherited from

CSpellSettingsWithSourceTrace.dictionaryDefinitions


enabled?

optional enabled: boolean

Defined in: CSpellSettingsDef.ts:468

Is the spell checker enabled.

Default

true

Inherited from

CSpellSettingsWithSourceTrace.enabled


enabledFileTypes?

optional enabledFileTypes: Record<string, boolean>

Defined in: CSpellSettingsDef.ts:247

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 TypeEnabledComment
*trueEnable all file types.
jsonfalseDisable checking for json files.

Title

Enabled File Types to Check

Since

8.8.1

Inherited from

CSpellSettingsWithSourceTrace.enabledFileTypes


enabledLanguageIds?

optional enabledLanguageIds: string[]

Defined in: CSpellSettingsDef.ts:195

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

Title

Enabled Language Ids

Unique Items

true

Inherited from

CSpellSettingsWithSourceTrace.enabledLanguageIds


enableFiletypes?

optional enableFiletypes: string[]

Defined in: CSpellSettingsDef.ts:224

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

Title

Enable File Types

Scope

resource

Unique Items

true

Inherited from

CSpellSettingsWithSourceTrace.enableFiletypes


enableGlobDot?

optional enableGlobDot: boolean

Defined in: CSpellSettingsDef.ts:91

Enable scanning files and directories beginning with . (period).

By default, CSpell does not scan hidden files.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.enableGlobDot


failFast?

optional failFast: boolean

Defined in: CSpellSettingsDef.ts:391

Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)

Default

false

Inherited from

CSpellSettingsWithSourceTrace.failFast


features?

optional features: Features

Defined in: CSpellSettingsDef.ts:151

Configure CSpell features.

Since

5.16.0

Inherited from

CSpellSettingsWithSourceTrace.features


files?

optional files: Glob[]

Defined in: CSpellSettingsDef.ts:82

Glob patterns of files to be checked.

Glob patterns are relative to the globRoot of the configuration file that defines them.

Inherited from

CSpellSettingsWithSourceTrace.files


flagWords?

optional flagWords: string[]

Defined in: InlineDictionary.ts:25

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

Inherited from

CSpellSettingsWithSourceTrace.flagWords


gitignoreRoot?

optional gitignoreRoot: string | string[]

Defined in: CSpellSettingsDef.ts:139

Tells the spell checker to stop searching for .gitignore files when it reaches a matching root.

Inherited from

CSpellSettingsWithSourceTrace.gitignoreRoot


globRoot?

optional globRoot: string

Defined in: CSpellSettingsDef.ts:75

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.

Inherited from

CSpellSettingsWithSourceTrace.globRoot


id?

optional id: string

Defined in: CSpellSettingsDef.ts:456

Optional identifier.

Inherited from

CSpellSettingsWithSourceTrace.id


ignorePaths?

optional ignorePaths: Glob[]

Defined in: CSpellSettingsDef.ts:98

Glob patterns of files to be ignored.

Glob patterns are relative to the globRoot of the configuration file that defines them.

Inherited from

CSpellSettingsWithSourceTrace.ignorePaths


ignoreRandomStrings?

optional ignoreRandomStrings: boolean

Defined in: CSpellReporter.ts:152

Ignore sequences of characters that look like random strings.

Default

true

Inherited from

CSpellSettingsWithSourceTrace.ignoreRandomStrings


ignoreRegExpList?

optional ignoreRegExpList: RegExpPatternList

Defined in: CSpellSettingsDef.ts:554

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.

Inherited from

CSpellSettingsWithSourceTrace.ignoreRegExpList


ignoreWords?

optional ignoreWords: string[]

Defined in: InlineDictionary.ts:31

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

Inherited from

CSpellSettingsWithSourceTrace.ignoreWords


import?

optional import: string | string[]

Defined in: CSpellSettingsDef.ts:58

Allows this configuration to inherit configuration for one or more other files.

See Importing / Extending Configuration for more details.

Inherited from

CSpellSettingsWithSourceTrace.import


includeRegExpList?

optional includeRegExpList: RegExpPatternList

Defined in: CSpellSettingsDef.ts:564

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.

Inherited from

CSpellSettingsWithSourceTrace.includeRegExpList


language?

optional language: string

Defined in: CSpellSettingsDef.ts:262

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.

Default

"en"

Inherited from

CSpellSettingsWithSourceTrace.language


languageId?

optional languageId: MatchingFileType

Defined in: CSpellSettingsDef.ts:273

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

Inherited from

CSpellSettingsWithSourceTrace.languageId


languageSettings?

optional languageSettings: LanguageSetting[]

Defined in: CSpellSettingsDef.ts:270

Additional settings for individual languages.

See Language Settings for more details.

Inherited from

CSpellSettingsWithSourceTrace.languageSettings


loadDefaultConfiguration?

optional loadDefaultConfiguration: boolean

Defined in: CSpellSettingsDef.ts:281

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

Default

true

Inherited from

CSpellSettingsWithSourceTrace.loadDefaultConfiguration


maxDuplicateProblems?

optional maxDuplicateProblems: number

Defined in: CSpellReporter.ts:138

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

Default

5

Inherited from

CSpellSettingsWithSourceTrace.maxDuplicateProblems


maxNumberOfProblems?

optional maxNumberOfProblems: number

Defined in: CSpellReporter.ts:131

The maximum number of problems to report in a file.

Default

10000

Inherited from

CSpellSettingsWithSourceTrace.maxNumberOfProblems


minRandomLength?

optional minRandomLength: number

Defined in: CSpellReporter.ts:159

The minimum length of a random string to be ignored.

Default

40

Inherited from

CSpellSettingsWithSourceTrace.minRandomLength


minWordLength?

optional minWordLength: number

Defined in: CSpellReporter.ts:145

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

Default

4

Inherited from

CSpellSettingsWithSourceTrace.minWordLength


name?

optional name: string

Defined in: CSpellSettingsDef.ts:459

Optional name of configuration.

Inherited from

CSpellSettingsWithSourceTrace.name


noConfigSearch?

optional noConfigSearch: boolean

Defined in: CSpellSettingsDef.ts:105

Prevents searching for local configuration when checking individual documents.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.noConfigSearch


noSuggestDictionaries?

optional noSuggestDictionaries: string[]

Defined in: CSpellSettingsDef.ts:525

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.

Inherited from

CSpellSettingsWithSourceTrace.noSuggestDictionaries


numSuggestions?

optional numSuggestions: number

Defined in: CSpellSettingsDef.ts:292

Number of suggestions to make.

Default

10

Inherited from

CSpellSettingsWithSourceTrace.numSuggestions


overrides?

optional overrides: OverrideSettings[]

Defined in: CSpellSettingsDef.ts:184

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

Inherited from

CSpellSettingsWithSourceTrace.overrides


parser?

optional parser: string

Defined in: CSpellSettingsDef.ts:884

Experimental

Parser to use for the file content

Since

6.2.0

Inherited from

CSpellSettingsWithSourceTrace.parser


patterns?

optional patterns: RegExpPatternDefinition[]

Defined in: CSpellSettingsDef.ts:591

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

Inherited from

CSpellSettingsWithSourceTrace.patterns


plugins?

optional plugins: Plugin[]

Defined in: CSpellSettingsDef.ts:861

Experimental

Future Plugin support

Since

6.2.0

Inherited from

ExperimentalFileSettings.plugins


pnpFiles?

optional pnpFiles: string[]

Defined in: CSpellSettingsDef.ts:333

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

Default

[".pnp.js", ".pnp.cjs"]

Inherited from

CSpellSettingsWithSourceTrace.pnpFiles


readonly?

optional readonly: boolean

Defined in: CSpellSettingsDef.ts:114

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.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.readonly


reporters?

optional reporters: ReporterSettings[]

Defined in: CSpellSettingsDef.ts:128

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.

Default

["default"]

Inherited from

CSpellSettingsWithSourceTrace.reporters


showStatus?

optional showStatus: boolean

Defined in: CSpellSettingsDef.ts:431

Show status.

Deprecated

true

Inherited from

CSpellSettingsWithSourceTrace.showStatus


source?

optional source: Source

Defined in: CSpellSettingsDef.ts:25

Inherited from

CSpellSettingsWithSourceTrace.source


spellCheckDelayMs?

optional spellCheckDelayMs: number

Defined in: CSpellSettingsDef.ts:437

Delay in ms after a document has changed before checking it for spelling errors.

Deprecated

true

Inherited from

CSpellSettingsWithSourceTrace.spellCheckDelayMs


suggestionNumChanges?

optional suggestionNumChanges: number

Defined in: CSpellSettingsDef.ts:310

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.

Default

3

Inherited from

CSpellSettingsWithSourceTrace.suggestionNumChanges


suggestionsTimeout?

optional suggestionsTimeout: number

Defined in: CSpellSettingsDef.ts:299

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

Default

500

Inherited from

CSpellSettingsWithSourceTrace.suggestionsTimeout


suggestWords?

optional suggestWords: string[]

Defined in: InlineDictionary.ts:46

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

Inherited from

CSpellSettingsWithSourceTrace.suggestWords


useGitignore?

optional useGitignore: boolean

Defined in: CSpellSettingsDef.ts:134

Tells the spell checker to load .gitignore files and skip files that match the globs in the .gitignore files found.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.useGitignore


usePnP?

optional usePnP: boolean

Defined in: CSpellSettingsDef.ts:326

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.

Default

false

Inherited from

CSpellSettingsWithSourceTrace.usePnP


userWords?

optional userWords: string[]

Defined in: CSpellSettingsDef.ts:51

Words to add to global dictionary -- should only be in the user config file.

Inherited from

CSpellSettingsWithSourceTrace.userWords


validateDirectives?

optional validateDirectives: boolean

Defined in: CSpellSettingsDef.ts:144

Verify that the in-document directives are correct.

Inherited from

CSpellSettingsWithSourceTrace.validateDirectives


version?

optional version: Version

Defined in: CSpellSettingsDef.ts:48

Configuration format version of the settings file.

This controls how the settings in the configuration file behave.

Default

"0.2"

Inherited from

CSpellSettingsWithSourceTrace.version


words?

optional words: string[]

Defined in: InlineDictionary.ts:5

List of words to be considered correct.

Inherited from

CSpellSettingsWithSourceTrace.words