diff --git a/packages/cspell-eslint-plugin/assets/options.schema.json b/packages/cspell-eslint-plugin/assets/options.schema.json index 41298158a1f..5e257f0e545 100644 --- a/packages/cspell-eslint-plugin/assets/options.schema.json +++ b/packages/cspell-eslint-plugin/assets/options.schema.json @@ -158,6 +158,11 @@ }, "type": "array" }, + "language": { + "default": "en", + "description": "Current active spelling language. This specifies the language locale to use in choosing the general dictionary.\n\nFor example:\n\n- \"en-GB\" for British English.\n- \"en,nl\" to enable both English and Dutch.", + "type": "string" + }, "words": { "description": "List of words to be considered correct.", "items": { diff --git a/packages/cspell-eslint-plugin/src/common/options.cts b/packages/cspell-eslint-plugin/src/common/options.cts index 061bd8949c7..884b4abb347 100644 --- a/packages/cspell-eslint-plugin/src/common/options.cts +++ b/packages/cspell-eslint-plugin/src/common/options.cts @@ -41,6 +41,7 @@ export type CSpellOptions = Pick< | 'ignoreRegExpList' | 'includeRegExpList' | 'import' + | 'language' | 'words' > & { dictionaryDefinitions?: DictionaryDefinition[]; diff --git a/packages/cspell-eslint-plugin/src/common/options.test.cts b/packages/cspell-eslint-plugin/src/common/options.test.cts index 6723ed36525..8d5cfc496a8 100644 --- a/packages/cspell-eslint-plugin/src/common/options.test.cts +++ b/packages/cspell-eslint-plugin/src/common/options.test.cts @@ -11,4 +11,11 @@ describe('options', () => { const settings: CSpellSettings = options.cspell; assert(settings, 'it is expected to compile.'); }); + + test('Make sure `language` is allowed.', () => { + const options: Options = { ...defaultOptions, cspell: { language: 'en-gb' } }; + assert(options.cspell); + const settings: CSpellSettings = options.cspell; + assert(settings, 'it is expected to compile.'); + }); });