Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add language option to cspell eslint plugin #5251

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cspell-eslint-plugin/assets/options.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/cspell-eslint-plugin/src/common/options.cts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type CSpellOptions = Pick<
| 'ignoreRegExpList'
| 'includeRegExpList'
| 'import'
| 'language'
| 'words'
> & {
dictionaryDefinitions?: DictionaryDefinition[];
Expand Down
7 changes: 7 additions & 0 deletions packages/cspell-eslint-plugin/src/common/options.test.cts
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
});
});