-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
CSpellSettingsDef.ts
885 lines (781 loc) · 25.1 KB
/
CSpellSettingsDef.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
import type { ReporterConfigurationBase } from './CSpellReporter.js';
import type { DictionaryDefinition, DictionaryReference } from './DictionaryDefinition.js';
import type { Features } from './features.js';
import type { InlineDictionary } from './InlineDictionary.js';
import type { Parser, ParserName } from './Parser/index.js';
import type { Serializable } from './types.js';
/**
* These settings come from user and workspace settings.
*/
export type CSpellPackageSettings = CSpellUserSettings;
export type CSpellUserSettings = CSpellSettings;
export interface CSpellSettings extends FileSettings, LegacySettings {}
export interface ImportFileRef {
/** filename or URL */
filename: string;
error?: Error | undefined;
referencedBy?: Source[];
}
export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
source?: Source | undefined;
__importRef?: ImportFileRef;
__imports?: Map<string, ImportFileRef>;
}
export interface AdvancedCSpellSettingsWithSourceTrace
extends CSpellSettingsWithSourceTrace,
ExperimentalFileSettings {}
export interface FileSettings extends ExtendableSettings, CommandLineSettings {
/**
* Url to JSON Schema
* @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
*/
$schema?: string;
/**
* Configuration format version of the settings file.
*
* This controls how the settings in the configuration file behave.
*
* @default "0.2"
*/
version?: Version;
/** Words to add to global dictionary -- should only be in the user config file. */
userWords?: string[];
/**
* Allows this configuration to inherit configuration for one or more other files.
*
* See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details.
*/
import?: FsPath | FsPath[];
/**
* 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.
*
*/
globRoot?: FSPathResolvable;
/**
* Glob patterns of files to be checked.
*
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
*/
files?: Glob[];
/**
* Enable scanning files and directories beginning with `.` (period).
*
* By default, CSpell does not scan `hidden` files.
*
* @default false
*/
enableGlobDot?: boolean;
/**
* Glob patterns of files to be ignored.
*
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
*/
ignorePaths?: Glob[];
/**
* Prevents searching for local configuration when checking individual documents.
*
* @default false
*/
noConfigSearch?: boolean;
/**
* 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
*/
readonly?: boolean;
/**
* 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"]
*/
reporters?: ReporterSettings[];
/**
* Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
* @default false
*/
useGitignore?: boolean;
/**
* Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root.
*/
gitignoreRoot?: FsPath | FsPath[];
/**
* Verify that the in-document directives are correct.
*/
validateDirectives?: boolean;
/**
* Configure CSpell features.
*
* @since 5.16.0
*/
features?: Features;
}
/* eslint-disable no-irregular-whitespace */
/**
* 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.
*/
export interface ExtendableSettings extends Settings {
/**
* Overrides are used to apply settings for specific files in your project.
*
* For example:
*
* ```javascript
* "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"
* }
* ]
* ```
*/
overrides?: OverrideSettings[];
}
export interface SpellCheckerExtensionSettings {
// * @deprecated true
// * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
/**
* Specify a list of file types to spell check. It is better to use {@link Settings.enabledFileTypes} to Enable / Disable checking files types.
* @title Enabled Language Ids
* @uniqueItems true
*/
enabledLanguageIds?: LanguageIdSingle[];
// * @deprecated true
// * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
/**
* Enable / Disable checking file types (languageIds).
*
* These are in additional to the file types specified by {@link 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
* @uniqueItems true
*/
enableFiletypes?: LanguageIdSingle[];
/**
* Enable / Disable checking file types (languageIds).
*
* This setting replaces: {@link Settings.enabledLanguageIds} and {@link 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. |
*
* @title Enabled File Types to Check
* @since 8.8.1
*/
enabledFileTypes?: Record<string, boolean>;
}
export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings, SpellCheckerExtensionSettings {
/**
* 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"
*/
language?: LocaleId;
/**
* Additional settings for individual languages.
*
* See [Language Settings](https://cspell.org/configuration/language-settings/) for more details.
*
*/
languageSettings?: LanguageSetting[];
/** Forces the spell checker to assume a give language id. Used mainly as an Override. */
languageId?: MatchingFileType;
/**
* By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
* will prevent ALL default configuration from being loaded.
*
* @default true
*/
loadDefaultConfiguration?: boolean;
}
export interface ReportingConfiguration extends ReporterConfigurationBase, SuggestionsConfiguration {}
export interface SuggestionsConfiguration {
/**
* Number of suggestions to make.
*
* @default 10
*/
numSuggestions?: number;
/**
* The maximum amount of time in milliseconds to generate suggestions for a word.
*
* @default 500
*/
suggestionsTimeout?: 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.
*
* @default 3
*/
suggestionNumChanges?: number;
}
/**
* Plug N Play settings to support package systems like Yarn 2.
*/
export interface PnPSettings {
/**
* 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
*/
usePnP?: boolean;
/**
* The PnP files to search for. Note: `.mjs` files are not currently supported.
*
* @default [".pnp.js", ".pnp.cjs"]
*/
pnpFiles?: string[];
}
/**
* 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).
*/
export type CacheStrategy = 'metadata' | 'content';
export type CacheFormat = 'legacy' | 'universal';
export interface CacheSettings {
/**
* Store the results of processed files in order to only operate on the changed ones.
* @default false
*/
useCache?: boolean;
// cspell:word cspellcache
/**
* 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.
*/
cacheLocation?: FSPathResolvable;
/**
* Strategy to use for detecting changed files, default: metadata
* @default 'metadata'
*/
cacheStrategy?: CacheStrategy;
/**
* Format of the cache file.
* - `legacy` - use absolute paths in the cache file
* - `universal` - use a sharable format.
* @default 'legacy'
*/
cacheFormat?: CacheFormat | undefined;
}
/**
* These are settings only used by the command line application.
*/
export interface CommandLineSettings {
/**
* Define cache settings.
*/
cache?: CacheSettings;
/**
* Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
* @default false
*/
failFast?: boolean;
}
/**
* To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
* are use to set the trust levels.
*
* Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
* In an untrusted location, these files will NOT be used.
*
* This will also prevent any associated plugins from being loaded.
*/
export interface WorkspaceTrustSettings {
/**
* Glob patterns of locations that contain ALWAYS trusted files.
*/
trustedFiles?: Glob[];
/**
* Glob patterns of locations that contain NEVER trusted files.
*/
untrustedFiles?: Glob[];
/**
* Sets the default trust level.
* @default "trusted"
*/
trustLevel?: TrustLevel;
}
/**
* VS Code Spell Checker Settings.
* To be Removed.
* @deprecated true
*/
export interface LegacySettings {
/**
* Show status.
* @deprecated true
*/
showStatus?: boolean;
/**
* Delay in ms after a document has changed before checking it for spelling errors.
* @deprecated true
*/
spellCheckDelayMs?: number;
/************************/
}
export interface OverrideSettings extends Settings, OverrideFilterFields {
/** Sets the programming language id to match file type. */
languageId?: MatchingFileType;
/** Sets the locale. */
language?: LocaleId;
}
export interface OverrideFilterFields {
/** Glob pattern or patterns to match against. */
filename: Glob | Glob[];
}
export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings {
/** Optional identifier. */
id?: string;
/** Optional name of configuration. */
name?: string;
/** Optional description of configuration. */
description?: string;
/**
* Is the spell checker enabled.
* @default true
*/
enabled?: boolean;
/**
* True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.
*
* @default false
*/
allowCompoundWords?: boolean;
/**
* Determines if words must match case and accent rules.
*
* - `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
*/
caseSensitive?: boolean;
/**
* Define additional available dictionaries.
*
* For example, you can use the following to add a custom dictionary:
*
* ```json
* "dictionaryDefinitions": [
* { "name": "custom-words", "path": "./custom-words.txt"}
* ],
* "dictionaries": ["custom-words"]
* ```
*/
dictionaryDefinitions?: DictionaryDefinition[];
/**
* 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](https://cspell.org/docs/dictionaries/)
* and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.
*/
dictionaries?: DictionaryReference[];
/**
* 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.
*/
noSuggestDictionaries?: DictionaryReference[];
/**
* 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
* ```json
* "ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
* ```
*
* YAML
* ```yaml
* ignoreRegExpList:
* - >-
* /\b[A-Z]+\b/g
* ```
*
* By default, several patterns are excluded. See
* [Configuration](https://cspell.org/configuration/patterns) for more details.
*
* While you can create your own patterns, you can also leverage several patterns that are
* [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
*/
ignoreRegExpList?: 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](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
*/
includeRegExpList?: RegExpPatternList;
/**
* Defines a list of patterns that can be used with the `ignoreRegExpList` and
* `includeRegExpList` options.
*
* For example:
*
* ```javascript
* "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"]
* }
* ]
* ```
* Defines a list of patterns that can be used with the `ignoreRegExpList` and
* `includeRegExpList` options.
*/
patterns?: RegExpPatternDefinition[];
}
export interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
export interface LanguageSettingFilterFields
extends LanguageSettingFilterFieldsPreferred,
LanguageSettingFilterFieldsDeprecated {}
export interface LanguageSettingFilterFieldsPreferred {
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
languageId: MatchingFileType;
/** The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. */
locale?: LocaleId | LocaleId[];
}
export interface LanguageSettingFilterFieldsDeprecated {
/** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
languageId: MatchingFileType;
/**
* Deprecated - The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales.
* @deprecated true
* @deprecationMessage Use `locale` instead.
*/
local?: LocaleId | LocaleId[];
}
/** @hidden */
type InternalRegExp = RegExp;
export type Pattern = string | InternalRegExp;
export type PredefinedPatterns =
| 'Base64'
| 'Base64MultiLine'
| 'Base64SingleLine'
| 'CStyleComment'
| 'CStyleHexValue'
| 'CSSHexValue'
| 'CommitHash'
| 'CommitHashLink'
| 'Email'
| 'EscapeCharacters'
| 'HexValues'
| 'href'
| 'PhpHereDoc'
| 'PublicKey'
| 'RsaCert'
| 'SshRsa'
| 'SHA'
| 'HashStrings'
| 'SpellCheckerDisable'
| 'SpellCheckerDisableBlock'
| 'SpellCheckerDisableLine'
| 'SpellCheckerDisableNext'
| 'SpellCheckerIgnoreInDocSetting'
| 'string'
| 'UnicodeRef'
| 'Urls'
| 'UUID'
| 'Everything';
/** This matches the name in a pattern definition. */
export type PatternId = string;
/** A PatternRef is a Pattern or PatternId. */
export type PatternRef = Pattern | PatternId | PredefinedPatterns;
/** A list of pattern names or regular expressions. */
export type RegExpPatternList = PatternRef[];
/** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
export type LocaleId = string;
/**
* Configuration File Version.
*/
export type VersionLatest = '0.2';
/**
* Legacy Configuration File Versions.
* @deprecated true
* @deprecationMessage Use `0.2` instead.
*/
export type VersionLegacy = '0.1';
export type Version = VersionLatest | VersionLegacy;
/**
* @deprecated true
* @deprecationMessage Use `LocaleId` instead.
*/
export type LocalId = LocaleId;
/** These are glob expressions. */
export type Glob = SimpleGlob | GlobDef;
/** Simple Glob string, the root will be globRoot. */
export type SimpleGlob = string;
/**
* Used to define fully qualified glob patterns.
* It is currently hidden to make the json-schema a bit easier to use
* when crafting cspell.json files by hand.
* @hidden
*/
export interface GlobDef {
/** Glob pattern to match. */
glob: string;
/** Optional root to use when matching the glob. Defaults to current working dir. */
root?: string;
/**
* Optional source of the glob, used when merging settings to determine the origin.
* @hidden
*/
source?: string;
}
/**
* This can be '*', 'typescript', 'cpp', 'json', etc.
* @pattern ^(!?[-\w_\s]+)|(\*)$
*/
export type LanguageIdSingle = string;
/**
* This can be 'typescript,cpp,json,literal haskell', etc.
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
*/
export type LanguageIdMultiple = string;
/**
* This can be 'typescript,cpp,json,literal haskell', etc.
* @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
*/
export type LanguageIdMultipleNeg = string;
export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
export type MatchingFileType = LanguageId | LanguageId[];
/**
* A File System Path. Relative paths are relative to the configuration file.
*/
export type FsPath = string;
/**
* A File System Path.
*
* Special Properties:
* - `${cwd}` prefix - will be replaced with the current working directory.
* - Relative paths are relative to the configuration file.
*/
export type FSPathResolvable = FsPath;
/** Trust Security Level. */
export type TrustLevel = 'trusted' | 'untrusted';
export interface RegExpPatternDefinition {
/**
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
* It is possible to redefine one of the predefined patterns to override its value.
*/
name: PatternId;
/**
* RegExp pattern or array of RegExp patterns.
*/
pattern: Pattern | Pattern[];
/**
* Description of the pattern.
*/
description?: string | undefined;
}
export type CSpellUserSettingsWithComments = CSpellUserSettings;
// Remove BaseSource from the Source list when the code is ready.
export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
export interface FileSource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename: string;
/** The two settings that were merged to. */
sources?: undefined;
/** The configuration read. */
fileSource: CSpellSettings;
}
export interface MergeSource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: undefined;
/** The two settings that were merged to. */
sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
/** The configuration read. */
fileSource?: undefined;
}
export interface InMemorySource extends BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: undefined;
/** The two settings that were merged to. */
sources?: undefined;
/** The configuration read. */
fileSource?: undefined;
}
interface BaseSource {
/** Name of source. */
name: string;
/** Filename if this came from a file. */
filename?: string | undefined;
/** The two settings that were merged to. */
sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
/** The configuration read. */
fileSource?: CSpellSettings | undefined;
}
/**
* The module or path to the the reporter to load.
*/
export type ReporterModuleName = string;
/**
* Options to send to the reporter. These are defined by the reporter.
*/
export type ReporterOptions = Serializable;
/**
* 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" }]`
*/
export type ReporterSettings =
| ReporterModuleName
| [name: ReporterModuleName]
| [name: ReporterModuleName, options: ReporterOptions];
/**
* Experimental Configuration / Options
*
* This Configuration is subject to change without warning.
* @experimental
* @hidden
*/
export interface ExperimentalFileSettings {
/**
* Future Plugin support
* @experimental
* @since 6.2.0
*/
plugins?: Plugin[];
}
/**
* Extends CSpellSettings with ExperimentalFileSettings
* @experimental
* @hidden
*/
export interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {}
/**
* Experimental Configuration / Options
*
* This Configuration is subject to change without warning.
* @experimental
* @hidden
*/
export interface ExperimentalBaseSettings {
/**
* Parser to use for the file content
* @experimental
* @since 6.2.0
*/
parser?: ParserName;
}
/**
* Plugin API
* @experimental
* @since 6.2.0
*/
export interface Plugin {
parsers?: Parser[];
}