-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
CSpellSettingsServer.test.ts
602 lines (537 loc) · 24.7 KB
/
CSpellSettingsServer.test.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
import {
mergeSettings,
readSettings,
getGlobalSettings,
clearCachedSettingsFiles,
getCachedFileSize,
checkFilenameMatchesGlob,
calcOverrideSettings,
getSources,
extractImportErrors,
searchForConfig,
loadConfig,
ImportFileRefWithError,
readRawSettings,
__testing__,
ENV_CSPELL_GLOB_ROOT,
loadPnP,
loadPnPSync,
readSettingsFiles,
} from './CSpellSettingsServer';
import { getDefaultSettings, _defaultSettings } from './DefaultSettings';
import { CSpellSettingsWithSourceTrace, CSpellUserSettings, ImportFileRef } from '@cspell/cspell-types';
import { logError, logWarning } from '../util/logger';
import { mocked } from 'ts-jest/utils';
import * as path from 'path';
import { URI } from 'vscode-uri';
const { normalizeSettings, validateRawConfigVersion, validateRawConfigExports } = __testing__;
const rootCspellLib = path.resolve(path.join(__dirname, '../..'));
const samplesDir = path.resolve(rootCspellLib, 'samples');
const samplesSrc = path.join(samplesDir, 'src');
jest.mock('../util/logger');
const mockedLogError = mocked(logError);
const mockedLogWarning = mocked(logWarning);
describe('Validate CSpellSettingsServer', () => {
test('tests mergeSettings with conflicting "name"', () => {
const left = { name: 'Left' };
const right = { name: 'Right' };
expect(mergeSettings(left, right)).toEqual({
name: 'Left|Right',
id: '|',
enabledLanguageIds: [],
languageSettings: [],
source: { name: 'Left|Right', sources: [left, right] },
});
});
test('tests mergeSettings with conflicting "id"', () => {
const left = { id: 'left' };
const enabled = { id: 'enabledId', name: 'enabledName', enabled: true };
expect(mergeSettings(left, enabled)).toEqual({
enabled: true,
name: '|enabledName',
id: 'left|enabledId',
enabledLanguageIds: [],
languageSettings: [],
source: { name: 'left|enabledName', sources: [left, enabled] },
});
});
test('tests mergeSettings with conflicting "enabled"', () => {
const right = { id: 'right', enabled: false };
const left = { id: 'left', enabled: true };
expect(mergeSettings({}, right)).toEqual(right);
expect(mergeSettings(left, {})).toEqual(left);
expect(mergeSettings(left, right)).toEqual({
enabled: right.enabled,
name: '|',
id: [left.id, right.id].join('|'),
enabledLanguageIds: [],
languageSettings: [],
source: { name: 'left|right', sources: [left, right] },
});
});
test('tests mergeSettings with inline object', () => {
expect(mergeSettings({ enabled: true }, { enabled: false })).toEqual({
enabled: false,
name: '|',
id: '|',
enabledLanguageIds: [],
languageSettings: [],
source: { name: 'left|right', sources: [{ enabled: true }, { enabled: false }] },
});
});
test('tests mergeSettings with ignorePaths, files, and overrides', () => {
const left: CSpellUserSettings = {
id: 'left',
files: ['left/**/*.*'],
ignorePaths: ['node_modules'],
overrides: [
{
filename: '*.ts',
dictionaries: ['ts-extra'],
},
],
};
const right: CSpellUserSettings = {
id: 'right',
enabled: true,
files: ['right/**/*.*'],
overrides: [{ filename: '*.jsxx', languageId: 'javascript' }], // cspell:ignore jsxx
};
expect(mergeSettings({}, right)).toEqual(right);
expect(mergeSettings(left, {})).toEqual(left);
expect(mergeSettings(left, right)).toEqual({
enabled: right.enabled,
name: '|',
id: [left.id, right.id].join('|'),
enabledLanguageIds: [],
languageSettings: [],
files: left.files?.concat(right.files || []),
ignorePaths: left.ignorePaths?.concat(right.ignorePaths || []),
overrides: left.overrides?.concat(right.overrides || []),
source: { name: 'left|right', sources: [left, right] },
});
});
test('tests mergeSettings with ignorePaths, files, and overrides compatibility', () => {
const left: CSpellUserSettings = {
id: 'left',
files: ['left/**/*.*'],
ignorePaths: ['node_modules'],
overrides: [
{
filename: '*.ts',
dictionaries: ['ts-extra'],
},
],
};
const right: CSpellUserSettings = {
id: 'right',
version: '0.1',
enabled: true,
files: ['right/**/*.*'],
ignorePaths: ['node_modules'],
overrides: [{ filename: '*.jsxx', languageId: 'javascript' }], // cspell:ignore jsxx
};
expect(mergeSettings({}, right)).toEqual(right);
expect(mergeSettings(left, {})).toEqual(left);
expect(mergeSettings(left, right)).toEqual({
enabled: right.enabled,
name: '|',
id: [left.id, right.id].join('|'),
version: right.version,
enabledLanguageIds: [],
languageSettings: [],
files: left.files?.concat(right.files || []),
ignorePaths: right.ignorePaths,
overrides: right.overrides,
source: { name: 'left|right', sources: [left, right] },
});
});
test('tests mergeSettings when left/right are the same', () => {
expect(mergeSettings(_defaultSettings, _defaultSettings)).toBe(_defaultSettings);
});
test('tests mergeSettings when lefts are the same', () => {
const base = mergeSettings(_defaultSettings, {});
const setting1 = mergeSettings(base, {});
const setting2 = mergeSettings(base, setting1);
expect(setting2).toBe(setting1);
const setting3 = mergeSettings(_defaultSettings, setting1);
expect(setting3).toBe(setting1);
});
test('tests mergeSettings when rights are the same', () => {
const base = mergeSettings(_defaultSettings, { id: 'right' });
const setting1 = mergeSettings({ id: 'setting1' }, base);
const setting2 = mergeSettings(setting1, base);
expect(setting2).toBe(setting1);
const setting3 = mergeSettings(_defaultSettings, setting1);
expect(setting3).not.toBe(setting1);
const setting4 = mergeSettings(setting3, base);
expect(setting4).toBe(setting3);
});
test('tests loading a missing cSpell.json file', () => {
const filename = path.join(__dirname, '..', '..', 'cspell.config.json');
const settings = readSettings(filename);
expect(settings.__importRef?.filename).toBe(path.resolve(filename));
expect(settings.__importRef?.error).toBeUndefined();
expect(settings.import).toBeUndefined();
});
test('tests loading project cspell.json file', () => {
const filename = path.join(__dirname, '..', '..', 'samples', 'linked', 'cspell-missing.json');
const settings = readSettings(filename);
expect(Object.keys(settings)).not.toHaveLength(0);
expect(settings.words).toBeUndefined();
});
test('tests loading a cSpell.json file', () => {
const filename = path.join(__dirname, '..', '..', 'samples', 'linked', 'cspell-import.json');
const settings = readSettings(filename);
expect(Object.keys(settings)).not.toHaveLength(0);
expect(settings.words).toEqual(expect.arrayContaining(['import']));
});
test('readSettingsFiles cSpell.json', () => {
const filename = path.join(__dirname, '..', '..', 'samples', 'linked', 'cspell-import.json');
const settings = readSettingsFiles([filename]);
expect(Object.keys(settings)).not.toHaveLength(0);
expect(settings.words).toEqual(expect.arrayContaining(['import']));
});
test('tests loading a cSpell.json with multiple imports file', () => {
const filename = path.join(__dirname, '..', '..', 'samples', 'linked', 'cspell-imports.json');
const settings = readSettings(filename);
expect(Object.keys(settings)).not.toHaveLength(0);
expect(settings.words).toEqual(expect.arrayContaining(['import']));
expect(settings.words).toEqual(expect.arrayContaining(['imports']));
// cspell:word leuk
expect(settings.words).toEqual(expect.arrayContaining(['leuk']));
});
test('tests loading a cSpell.json with a missing import file', () => {
const filename = path.join(__dirname, '..', '..', 'samples', 'linked', 'cspell-import-missing.json');
const settings = readSettings(filename);
expect(settings.__importRef?.filename).toBe(path.resolve(filename));
expect(settings.__imports?.size).toBe(2);
const errors = extractImportErrors(settings);
expect(errors).toHaveLength(1);
expect(errors.map((ref) => ref.error.toString())).toContainEqual(
expect.stringMatching('intentionally-missing-file.json')
);
expect(errors.map((ref) => ref.error.toString())).toContainEqual(expect.stringMatching('Failed to read'));
});
test('makes sure global settings is an object', () => {
const settings = getGlobalSettings();
expect(Object.keys(settings)).not.toHaveLength(0);
const merged = mergeSettings(getDefaultSettings(), getGlobalSettings());
expect(Object.keys(merged)).not.toHaveLength(0);
});
test('verify clearing the file cache works', () => {
mergeSettings(getDefaultSettings(), getGlobalSettings());
expect(getCachedFileSize()).toBeGreaterThan(0);
clearCachedSettingsFiles();
expect(getCachedFileSize()).toBe(0);
});
test('the loaded defaults contain expected settings', () => {
const settings = getDefaultSettings();
const sources = getSources(settings);
const sourceNames = sources.map((s) => s.name || '?');
expect(sourceNames).toEqual(expect.arrayContaining([_defaultSettings.name]));
});
test('loading circular imports (readSettings)', async () => {
const configFile = path.join(samplesDir, 'linked/cspell.circularA.json');
const config = readSettings(configFile);
expect(config?.ignorePaths).toEqual(
expect.arrayContaining([
{
glob: 'node_modules',
root: path.dirname(configFile),
source: configFile,
},
])
);
const errors = extractImportErrors(config);
expect(errors).toEqual([]);
const sources = getSources(config);
expect(sources.length).toBe(2);
});
test('loading circular imports (loadConfig)', async () => {
const configFile = path.join(samplesDir, 'linked/cspell.circularA.json');
const config = await loadConfig(configFile);
expect(config?.ignorePaths).toEqual(
expect.arrayContaining([
{
glob: 'node_modules',
root: path.dirname(configFile),
source: configFile,
},
])
);
const errors = extractImportErrors(config);
expect(errors).toEqual([]);
const sources = getSources(config);
expect(sources.length).toBe(2);
});
});
describe('Validate Overrides', () => {
test.each`
file | glob | expected
${'nested/dir/spell.test.ts'} | ${'nested/**'} | ${false /* nested/** tests against the current dir not __dirname */}
${'nested/dir/spell.test.ts'} | ${{ glob: 'nested/**', root: __dirname }} | ${true /* setting the root to __dirname will allow this to be true. */}
${'nested/dir/spell.test.ts'} | ${'nested'} | ${true}
${'nested/dir/spell.test.ts'} | ${'*.ts'} | ${true}
${'nested/dir/spell.test.ts'} | ${'**/*.ts'} | ${true}
${'nested/dir/spell.test.ts'} | ${['**/*.ts']} | ${true}
${'nested/dir/spell.test.ts'} | ${['**/dir/**/*.ts']} | ${true}
${'nested/dir/spell.test.js'} | ${['**/*.ts']} | ${false}
${'nested/dir/spell.test.js'} | ${['*.ts', '*.test.js']} | ${true}
${'/cspell-dicts/nl_NL/Dutch.txt'} | ${'**/nl_NL/**'} | ${false /* the file is a root filename */}
${'cspell-dicts/nl_NL/Dutch.txt'} | ${'**/nl_NL/**'} | ${true}
`('checkFilenameMatchesGlob "$file" against "$glob" expect: $expected', ({ file, glob, expected }) => {
file = path.resolve(__dirname, file);
expect(checkFilenameMatchesGlob(file, glob)).toBe(expected);
});
test.each`
file | expected
${'nested/dir/spell.test.ts'} | ${{ languageId: 'typescript' }}
${'nested/docs/NL/myDoc.lex'} | ${{ languageId: 'lex', language: 'en' }}
${'nested/docs/NL/myDoc.txt'} | ${{ languageId: 'plaintext', language: 'en,nl' }}
`('calcOverrideSettings $file expected $expected', ({ file, expected }) => {
file = path.resolve(__dirname, file);
const r = calcOverrideSettings(sampleSettings, file);
expect(r).toEqual(expect.objectContaining(expected));
});
});
describe('Validate Glob resolution', () => {
beforeAll(() => {
delete process.env[ENV_CSPELL_GLOB_ROOT];
});
test('normalized settings', () => {
expect(sampleSettings).not.toEqual(sampleSettingsV1);
expect(sampleSettings.globRoot).not.toEqual(sampleSettingsV1.globRoot);
expect(sampleSettings.globRoot).toBe(__dirname);
expect(sampleSettingsV1.globRoot).toContain(process.cwd());
expect(sampleSettings.ignorePaths).toEqual(
expect.arrayContaining([
{ glob: 'node_modules', root: sampleSettings.globRoot, source: sampleSettingsFilename },
])
);
expect(sampleSettingsV1.ignorePaths).toEqual(
expect.arrayContaining([
{ glob: 'node_modules', root: sampleSettingsV1.globRoot, source: sampleSettingsFilename },
])
);
});
test('Using ENV_CSPELL_GLOB_ROOT as __dirname', () => {
process.env[ENV_CSPELL_GLOB_ROOT] = __dirname;
const settingsV = normalizeSettings(rawSampleSettings, __filename, {});
const settingsV1 = normalizeSettings(rawSampleSettingsV1, __filename, {});
expect(settingsV).toEqual(sampleSettings);
expect(settingsV1).not.toEqual(sampleSettingsV1);
delete settingsV1.version;
expect(settingsV1).toEqual(sampleSettings);
});
test('Using ENV_CSPELL_GLOB_ROOT as without shared hierarchy', () => {
process.env[ENV_CSPELL_GLOB_ROOT] = path.resolve(__dirname, '../../samples');
const settingsV = normalizeSettings(rawSampleSettings, __filename, {});
const settingsV1 = normalizeSettings(rawSampleSettingsV1, __filename, {});
expect(settingsV).not.toEqual(sampleSettings);
expect(settingsV1).not.toEqual(sampleSettingsV1);
delete settingsV1.version;
expect(settingsV1).toEqual(settingsV);
});
test('globs with relative globRoot', async () => {
const configFilename = path.resolve(samplesDir, 'cspell.relative-glob-root.json');
const configDir = path.dirname(configFilename);
const config = await loadConfig(configFilename);
expect(config).toEqual(
oc({
ignorePaths: expect.arrayContaining([
{
glob: 'node_modules',
root: path.resolve(configDir, '../../..'),
source: configFilename,
},
]),
})
);
});
test('globs from config file (search)', async () => {
const config = await searchForConfig(__dirname);
expect(config?.ignorePaths).toEqual(
expect.arrayContaining([
{
glob: 'node_modules/**',
root: rootCspellLib,
source: path.join(rootCspellLib, 'cspell.config.json'),
},
])
);
});
test('globs from config file (readSettings)', async () => {
const configFile = path.join(rootCspellLib, 'cspell.config.json');
const config = readSettings(configFile);
expect(config?.ignorePaths).toEqual(
expect.arrayContaining([
{
glob: 'node_modules/**',
root: rootCspellLib,
source: configFile,
},
])
);
});
});
describe('Validate search/load config files', () => {
beforeEach(() => {
mockedLogError.mockClear();
mockedLogWarning.mockClear();
});
function importRefWithError(filename: string): ImportFileRefWithError {
return {
filename,
error: new Error(`Failed to find config file at: "${filename}"`),
};
}
function readError(filename: string): ImportFileRefWithError {
return {
filename,
error: new Error(`Failed to read config file: "${filename}"`),
};
}
function cfg(
filename: string | ImportFileRefWithError,
values: CSpellSettingsWithSourceTrace = {}
): CSpellSettingsWithSourceTrace {
const __importRef = importFileRef(filename);
return {
__importRef,
...values,
};
}
/**
* Create an ImportFileRef that has an `error` field.
*/
function importFileRef(filenameOrRef: string | ImportFileRef | ImportFileRefWithError): ImportFileRef {
const { filename, error } = iRef(filenameOrRef);
return { filename, error };
}
/**
* Create an ImportFileRef with an optional `error` field.
*/
function iRef(filenameOrRef: string | ImportFileRef | ImportFileRefWithError): ImportFileRef {
return typeof filenameOrRef === 'string' ? { filename: filenameOrRef } : filenameOrRef;
}
function s(filename: string): string {
return relSamples(filename);
}
interface TestSearchFrom {
dir: string;
expectedConfig: CSpellSettingsWithSourceTrace;
expectedImportErrors: string[];
}
test.each`
dir | expectedConfig | expectedImportErrors
${samplesSrc} | ${cfg(s('.cspell.json'))} | ${[]}
${s('bug-fixes/bug345.ts')} | ${cfg(s('bug-fixes/cspell.json'))} | ${[]}
${s('linked')} | ${cfg(s('linked/cspell.config.js'))} | ${[]}
${s('yaml-config')} | ${cfg(s('yaml-config/cspell.yaml'), { id: 'Yaml Example Config' })} | ${['cspell-imports.json']}
`('Search from $dir', async ({ dir, expectedConfig, expectedImportErrors }: TestSearchFrom) => {
const searchResult = await searchForConfig(dir);
expect(searchResult).toEqual(expect.objectContaining(expectedConfig));
if (searchResult?.__importRef) {
const loadResult = await loadConfig(searchResult.__importRef?.filename);
// eslint-disable-next-line jest/no-conditional-expect
expect(loadResult).toEqual(searchResult);
}
const errors = extractImportErrors(searchResult || {});
expect(errors).toHaveLength(expectedImportErrors.length);
expect(errors).toEqual(
expect.arrayContaining(
expectedImportErrors.map((filename) =>
expect.objectContaining({ filename: expect.stringContaining(filename) })
)
)
);
});
interface TestLoadConfig {
file: string;
expectedConfig: CSpellSettingsWithSourceTrace;
}
test.each`
file | expectedConfig
${samplesSrc} | ${cfg(importRefWithError(samplesSrc))}
${s('bug-fixes')} | ${cfg(importRefWithError(s('bug-fixes')))}
${s('linked/cspell.config.js')} | ${cfg(s('linked/cspell.config.js'))}
${s('js-config/cspell.config.js')} | ${cfg(s('js-config/cspell.config.js'))}
`('Load from $file', async ({ file, expectedConfig }: TestLoadConfig) => {
const searchResult = await loadConfig(file);
expect(searchResult).toEqual(expectedConfig ? expect.objectContaining(expectedConfig) : undefined);
});
test.each`
file | expectedConfig
${samplesSrc} | ${cfg(readError(samplesSrc))}
${s('bug-fixes')} | ${cfg(readError(s('bug-fixes')))}
${s('linked/cspell.config.js')} | ${cfg(s('linked/cspell.config.js'), { description: 'cspell.config.js file in samples/linked', import: ['./cspell-imports.json'] })}
${s('js-config/cspell.config.js')} | ${cfg(s('js-config/cspell.config.js'), { description: 'cspell.config.js file in samples/js-config' })}
${s('js-config/cspell-no-export.js')} | ${cfg(s('js-config/cspell-no-export.js'))}
${s('js-config/cspell-bad.js')} | ${cfg(readError(s('js-config/cspell-bad.js')))}
`('ReadRawSettings from $file', async ({ file, expectedConfig }: TestLoadConfig) => {
const searchResult = await readRawSettings(file);
expect(searchResult).toEqual(expectedConfig ? expect.objectContaining(expectedConfig) : undefined);
});
test('loadPnP', async () => {
await expect(loadPnP({}, URI.file(__dirname))).resolves.toBeUndefined();
// Look for a pnp file from the current location, but it won't be found.
await expect(loadPnP({ usePnP: true }, URI.file(__dirname))).resolves.toBeUndefined();
});
test('loadPnPSync', () => {
expect(loadPnPSync({}, URI.file(__dirname))).toBeUndefined();
// Look for a pnp file from the current location, but it won't be found.
expect(loadPnPSync({ usePnP: true }, URI.file(__dirname))).toBeUndefined();
});
test('config needing PnP', async () => {
const uriTestPackages = path.join(__dirname, '../../../../test-packages');
const uriYarn2TestMedCspell = path.join(uriTestPackages, 'yarn2/test-yarn2-med/cspell.json');
const result = await loadConfig(uriYarn2TestMedCspell, {});
expect(result.dictionaries).toEqual(['medical terms']);
});
test.each`
config | mocked | expected
${{ version: 'hello' }} | ${mockedLogError} | ${'Unsupported config file version: "hello"\n File: "filename"'}
${{ version: '0.1' }} | ${mockedLogWarning} | ${'Legacy config file version found: "0.1", upgrade to "0.2"\n File: "filename"'}
${{ version: '0.3' }} | ${mockedLogWarning} | ${'Newer config file version found: "0.3". Supported version is "0.2"\n File: "filename"'}
`('validateRawConfigVersion $config', ({ config, mocked, expected }) => {
validateRawConfigVersion(config, { filename: 'filename' });
expect(mocked).toHaveBeenCalledWith(expected);
});
test('validateRawConfigExports', () => {
const d = { default: {}, name: '' };
const c: CSpellUserSettings = d;
expect(() => validateRawConfigExports(c, { filename: 'filename' })).toThrowError(
'Module `export default` is not supported.\n Use `module.exports =` instead.\n File: "filename"'
);
});
});
function oc<T>(v: Partial<T>): T {
return expect.objectContaining(v);
}
function relSamples(file: string) {
return path.resolve(samplesDir, file);
}
const rawSampleSettings: CSpellUserSettings = {
language: 'en',
languageId: 'plaintext',
ignorePaths: ['node_modules'],
overrides: [
{
filename: '**/*.ts',
languageId: 'typescript',
},
{
filename: '**/*.lex',
languageId: 'lex',
},
{
filename: '**/NL/*.txt',
language: 'en,nl',
},
],
};
const rawSampleSettingsV1: CSpellUserSettings = { ...rawSampleSettings, version: '0.1' };
const sampleSettingsFilename = __filename;
const sampleSettings: CSpellUserSettings = normalizeSettings(rawSampleSettings, sampleSettingsFilename, {});
const sampleSettingsV1: CSpellUserSettings = normalizeSettings(rawSampleSettingsV1, sampleSettingsFilename, {});