diff --git a/cspell.schema.json b/cspell.schema.json index 1bc9f3bb8ef..b46e43dd552 100644 --- a/cspell.schema.json +++ b/cspell.schema.json @@ -233,7 +233,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -276,7 +276,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -291,7 +291,7 @@ }, "DictionaryDefinitionCustom": { "additionalProperties": false, - "description": "For Defining Custom dictionaries. They are generally scoped to a `user`, `workspace`, or `folder`. When `addWords` is true, indicates that the spell checker can add words to the file. Note: only plain text files with one word per line are supported at this moment.", + "description": "For Defining Custom dictionaries. They are generally scoped to a `user`, `workspace`, or `folder`. When `addWords` is true, indicates that the spell checker can add words to the file.\n\nNote: only plain text files with one word per line are supported at this moment.", "properties": { "addWords": { "description": "When `true`, let's the spell checker know that words can be added to this dictionary.", @@ -329,12 +329,12 @@ "type": "array" } ], - "description": "Defines the scope for when words will be added to the dictionary. Scope values: `user`, `workspace`, `folder`." + "description": "Defines the scope for when words will be added to the dictionary.\n\nScope values: `user`, `workspace`, `folder`." }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -370,7 +370,7 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, @@ -396,16 +396,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -433,10 +434,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "ignoreWords": { @@ -459,16 +461,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -496,10 +499,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "ignoreWords": { @@ -522,16 +526,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -577,7 +582,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -620,7 +625,8 @@ "type": "array" } ], - "description": "The accent characters.\n\nDefault: `\"\\u0300-\\u0341\"`" + "description": "The accent characters.", + "markdownDescription": "The accent characters.\n\nDefault: `\"\\u0300-\\u0341\"`" }, "adjustments": { "description": "A collection of patterns to test against the suggested words. If the word matches the pattern, then the penalty is applied.", @@ -757,7 +763,8 @@ "additionalProperties": false, "properties": { "aff": { - "description": "Selected Hunspell AFF content. The content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV\n\nExample: ```hunspell # Comment TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ` MAP aàâäAÀÂÄ MAP eéèêëEÉÈÊË MAP iîïyIÎÏY MAP oôöOÔÖ MAP (IJ)(IJ) ```", + "description": "Selected Hunspell AFF content.\nThe content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV", + "markdownDescription": "Selected Hunspell AFF content.\nThe content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV\n\nExample:\n```hunspell\n# Comment\nTRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`\nMAP aàâäAÀÂÄ\nMAP eéèêëEÉÈÊË\nMAP iîïyIÎÏY\nMAP oôöOÔÖ\nMAP (IJ)(IJ)\n```", "type": "string" }, "costs": { @@ -855,7 +862,8 @@ "properties": { "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "caseSensitive": { @@ -868,10 +876,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -887,10 +896,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "id": { @@ -899,7 +909,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -910,7 +921,8 @@ }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "languageId": { "$ref": "#/definitions/MatchingFileType", @@ -958,17 +970,19 @@ "type": "array" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "words": { @@ -1006,7 +1020,8 @@ "properties": { "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "caseSensitive": { @@ -1019,10 +1034,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -1036,7 +1052,7 @@ "items": { "$ref": "#/definitions/LanguageIdSingle" }, - "markdownDescription": "Enable / Disable checking file types (languageIds).\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", + "markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\n\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", "scope": "resource", "title": "File Types to Check", "type": "array", @@ -1069,10 +1085,11 @@ "description": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "id": { @@ -1081,7 +1098,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -1092,7 +1110,8 @@ }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "language": { "$ref": "#/definitions/LocaleId", @@ -1103,10 +1122,11 @@ "description": "Sets the programming language id to match file type." }, "languageSettings": { - "description": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", + "description": "Additional settings for individual languages.", "items": { "$ref": "#/definitions/LanguageSetting" }, + "markdownDescription": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", "type": "array" }, "loadDefaultConfiguration": { @@ -1146,10 +1166,11 @@ "type": "number" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "pnpFiles": { @@ -1164,15 +1185,17 @@ "type": "array" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "suggestionNumChanges": { "default": 3, - "description": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", + "description": "The maximum number of changes allowed on a word to be considered a suggestions.", + "markdownDescription": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", "type": "number" }, "suggestionsTimeout": { @@ -1442,7 +1465,8 @@ }, "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "cache": { @@ -1459,10 +1483,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -1476,7 +1501,7 @@ "items": { "$ref": "#/definitions/LanguageIdSingle" }, - "markdownDescription": "Enable / Disable checking file types (languageIds).\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", + "markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\n\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", "scope": "resource", "title": "File Types to Check", "type": "array", @@ -1513,13 +1538,15 @@ "items": { "$ref": "#/definitions/Glob" }, + "markdownDescription": "Glob patterns of files to be checked.\n\nGlob patterns are relative to the `globRoot` of the configuration file that defines them.", "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "gitignoreRoot": { @@ -1538,7 +1565,8 @@ }, "globRoot": { "$ref": "#/definitions/FSPathResolvable", - "description": "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}`.\n\nUse `globRoot` to define a different location. `globRoot` can be relative to the location of this configuration file. Defining globRoot, does not impact imported configurations.\n\nSpecial Values:\n- `${cwd}` - will be replaced with the current working directory.\n- `.` - will be the location of the containing configuration file." + "description": "The root to use for glob patterns found in this configuration.", + "markdownDescription": "The root to use for glob patterns found in this configuration.\nDefault: location of the configuration file.\n For compatibility reasons, config files with version 0.1, the glob root will\n default to be `${cwd}`.\n\nUse `globRoot` to define a different location.\n`globRoot` can be relative to the location of this configuration file.\nDefining globRoot, does not impact imported configurations.\n\nSpecial Values:\n- `${cwd}` - will be replaced with the current working directory.\n- `.` - will be the location of the containing configuration file." }, "id": { "description": "Optional identifier.", @@ -1553,7 +1581,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -1574,11 +1603,13 @@ "type": "array" } ], - "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details." + "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee https://cspell.org/configuration/imports/ for more details.", + "markdownDescription": "Allows this configuration to inherit configuration for one or more other files.\n\nSee [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details." }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "language": { "$ref": "#/definitions/LocaleId", @@ -1590,10 +1621,11 @@ "description": "Forces the spell checker to assume a give language id. Used mainly as an Override." }, "languageSettings": { - "description": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", + "description": "Additional settings for individual languages.", "items": { "$ref": "#/definitions/LanguageSetting" }, + "markdownDescription": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", "type": "array" }, "loadDefaultConfiguration": { @@ -1638,17 +1670,19 @@ "type": "number" }, "overrides": { - "description": "Overrides are used to apply settings for specific files in your project.\n\nFor example:\n\n```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\" } ] ```", + "description": "Overrides are used to apply settings for specific files in your project.", "items": { "$ref": "#/definitions/OverrideSettings" }, + "markdownDescription": "Overrides are used to apply settings for specific files in your project.\n\nFor example:\n\n```javascript\n\"overrides\": [\n // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:\n {\n \"filename\": \"**​/{*.hrr,*.crr}\",\n \"languageId\": \"cpp\"\n },\n // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):\n {\n \"language\": \"nl\",\n \"filename\": \"**​/dutch/**​/*.txt\"\n }\n]\n```", "type": "array" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "pnpFiles": { @@ -1671,10 +1705,11 @@ "default": [ "default" ], - "description": "Define which reports to use. `default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", + "description": "Define which reports to use.\n`default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", "items": { "$ref": "#/definitions/ReporterSettings" }, + "markdownDescription": "Define which reports to use.\n`default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", "type": "array" }, "showStatus": { @@ -1688,15 +1723,17 @@ "type": "number" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "suggestionNumChanges": { "default": 3, - "description": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", + "description": "The maximum number of changes allowed on a word to be considered a suggestions.", + "markdownDescription": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", "type": "number" }, "suggestionsTimeout": { diff --git a/package.json b/package.json index 2ddbb6d217a..ca7de0d82b5 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "test:bin-trace": "node ./bin.mjs trace test", "test-build-docs": "cd doc-generator && pnpm i && pnpm run test-build-docs", "test-integrations": "cd ./integration-tests && pnpm run integration-tests", - "test-schema": "ajv -s ./cspell.schema.json -d cspell.json -c ./packages/cspell-types/ajv.config.js", + "test-schema": "node ./test-packages/cspell-types/validate-schema/validate-schema.mjs", "update-packages": "pnpm run update-packages-src && pnpm run update-packages-docs", "update-packages-docs": "cd website && pnpm run update-packages", "update-packages-src": "pnpm -r up", @@ -87,6 +87,7 @@ "devDependencies": { "@cspell/dict-markdown": "^2.0.1", "@cspell/eslint-plugin": "workspace:*", + "@internal/scripts": "workspace:*", "@lerna-lite/cli": "^2.5.0", "@lerna-lite/publish": "^2.5.0", "@rollup/plugin-alias": "^5.0.0", @@ -101,7 +102,6 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "@vitest/coverage-istanbul": "^0.34.4", - "ajv-cli": "^5.0.0", "conventional-changelog-conventionalcommits": "^6.1.0", "eslint": "^8.49.0", "eslint-config-prettier": "^9.0.0", @@ -119,7 +119,6 @@ "prettier": "^3.0.3", "rollup": "^3.29.0", "rollup-plugin-dts": "^5.3.1", - "shelljs": "^0.8.5", "shx": "^0.3.4", "ts-jest": "^29.1.1", "ts2mjs": "^2.1.1", diff --git a/packages/cspell-eslint-plugin/assets/options.schema.json b/packages/cspell-eslint-plugin/assets/options.schema.json index 55b66a60efa..29bbb8dc67f 100644 --- a/packages/cspell-eslint-plugin/assets/options.schema.json +++ b/packages/cspell-eslint-plugin/assets/options.schema.json @@ -39,11 +39,11 @@ "properties": { "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", "type": "boolean" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "description": "Reference to a dictionary by name. One of:\n- {@link DictionaryRef } \n- {@link DictionaryNegRef }", "type": "string" @@ -85,7 +85,7 @@ }, "type": { "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules.", + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules.", "enum": [ "S", "W", @@ -111,14 +111,14 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, "type": "array" }, "ignoreRegExpList": { - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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).", + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", "items": { "description": "A PatternRef is a Pattern or PatternId.", "type": "string" @@ -146,10 +146,10 @@ "type": "array" } ], - "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details." + "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee https://cspell.org/configuration/imports/ for more details." }, "includeRegExpList": { - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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).", + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", "items": { "description": "A PatternRef is a Pattern or PatternId.", "type": "string" diff --git a/packages/cspell-tools/package.json b/packages/cspell-tools/package.json index 37b595eb18c..82407e1316a 100644 --- a/packages/cspell-tools/package.json +++ b/packages/cspell-tools/package.json @@ -62,7 +62,6 @@ }, "devDependencies": { "@types/glob": "^8.1.0", - "@types/shelljs": "^0.8.12", "lorem-ipsum": "^2.0.8", "ts-json-schema-generator": "^1.3.0" }, diff --git a/packages/cspell-types/ajv.config.js b/packages/cspell-types/ajv.config.js deleted file mode 100644 index 5e72af5bd98..00000000000 --- a/packages/cspell-types/ajv.config.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const keywords = ['deprecationMessage', 'markdownDescription', 'scope']; - -function addKeywords(ajv) { - for (const keyword of keywords) { - ajv.addKeyword(keyword); - } -} - -module.exports = addKeywords; diff --git a/packages/cspell-types/cspell.schema.json b/packages/cspell-types/cspell.schema.json index 1bc9f3bb8ef..b46e43dd552 100644 --- a/packages/cspell-types/cspell.schema.json +++ b/packages/cspell-types/cspell.schema.json @@ -233,7 +233,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -276,7 +276,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -291,7 +291,7 @@ }, "DictionaryDefinitionCustom": { "additionalProperties": false, - "description": "For Defining Custom dictionaries. They are generally scoped to a `user`, `workspace`, or `folder`. When `addWords` is true, indicates that the spell checker can add words to the file. Note: only plain text files with one word per line are supported at this moment.", + "description": "For Defining Custom dictionaries. They are generally scoped to a `user`, `workspace`, or `folder`. When `addWords` is true, indicates that the spell checker can add words to the file.\n\nNote: only plain text files with one word per line are supported at this moment.", "properties": { "addWords": { "description": "When `true`, let's the spell checker know that words can be added to this dictionary.", @@ -329,12 +329,12 @@ "type": "array" } ], - "description": "Defines the scope for when words will be added to the dictionary. Scope values: `user`, `workspace`, `folder`." + "description": "Defines the scope for when words will be added to the dictionary.\n\nScope values: `user`, `workspace`, `folder`." }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -370,7 +370,7 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, @@ -396,16 +396,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -433,10 +434,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "ignoreWords": { @@ -459,16 +461,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -496,10 +499,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "ignoreWords": { @@ -522,16 +526,17 @@ "description": "Replacement pairs." }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -577,7 +582,7 @@ "type": { "$ref": "#/definitions/DictionaryFileTypes", "default": "S", - "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules." + "description": "Type of file:\n- S - single word per line,\n- W - each line can contain one or more words separated by space,\n- C - each line is treated like code (Camel Case is allowed).\n\nDefault is S.\n\nC is the slowest to load due to the need to split each line based upon code splitting rules." }, "useCompounds": { "description": "Use Compounds.", @@ -620,7 +625,8 @@ "type": "array" } ], - "description": "The accent characters.\n\nDefault: `\"\\u0300-\\u0341\"`" + "description": "The accent characters.", + "markdownDescription": "The accent characters.\n\nDefault: `\"\\u0300-\\u0341\"`" }, "adjustments": { "description": "A collection of patterns to test against the suggested words. If the word matches the pattern, then the penalty is applied.", @@ -757,7 +763,8 @@ "additionalProperties": false, "properties": { "aff": { - "description": "Selected Hunspell AFF content. The content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV\n\nExample: ```hunspell # Comment TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ` MAP aàâäAÀÂÄ MAP eéèêëEÉÈÊË MAP iîïyIÎÏY MAP oôöOÔÖ MAP (IJ)(IJ) ```", + "description": "Selected Hunspell AFF content.\nThe content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV", + "markdownDescription": "Selected Hunspell AFF content.\nThe content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV\n\nExample:\n```hunspell\n# Comment\nTRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`\nMAP aàâäAÀÂÄ\nMAP eéèêëEÉÈÊË\nMAP iîïyIÎÏY\nMAP oôöOÔÖ\nMAP (IJ)(IJ)\n```", "type": "string" }, "costs": { @@ -855,7 +862,8 @@ "properties": { "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "caseSensitive": { @@ -868,10 +876,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -887,10 +896,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "id": { @@ -899,7 +909,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -910,7 +921,8 @@ }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "languageId": { "$ref": "#/definitions/MatchingFileType", @@ -958,17 +970,19 @@ "type": "array" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "words": { @@ -1006,7 +1020,8 @@ "properties": { "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "caseSensitive": { @@ -1019,10 +1034,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -1036,7 +1052,7 @@ "items": { "$ref": "#/definitions/LanguageIdSingle" }, - "markdownDescription": "Enable / Disable checking file types (languageIds).\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", + "markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\n\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", "scope": "resource", "title": "File Types to Check", "type": "array", @@ -1069,10 +1085,11 @@ "description": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "id": { @@ -1081,7 +1098,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -1092,7 +1110,8 @@ }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "language": { "$ref": "#/definitions/LocaleId", @@ -1103,10 +1122,11 @@ "description": "Sets the programming language id to match file type." }, "languageSettings": { - "description": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", + "description": "Additional settings for individual languages.", "items": { "$ref": "#/definitions/LanguageSetting" }, + "markdownDescription": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", "type": "array" }, "loadDefaultConfiguration": { @@ -1146,10 +1166,11 @@ "type": "number" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "pnpFiles": { @@ -1164,15 +1185,17 @@ "type": "array" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "suggestionNumChanges": { "default": 3, - "description": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", + "description": "The maximum number of changes allowed on a word to be considered a suggestions.", + "markdownDescription": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", "type": "number" }, "suggestionsTimeout": { @@ -1442,7 +1465,8 @@ }, "allowCompoundWords": { "default": false, - "description": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", + "description": "True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details.", + "markdownDescription": "True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.", "type": "boolean" }, "cache": { @@ -1459,10 +1483,11 @@ "type": "string" }, "dictionaries": { - "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/) and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", + "description": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.", "items": { "$ref": "#/definitions/DictionaryReference" }, + "markdownDescription": "Optional list of dictionaries to use. Each entry should match the name of the dictionary.\n\nTo remove a dictionary from the list, add `!` before the name.\n\nFor example, `!typescript` will turn off the dictionary with the name `typescript`.\n\nSee the [Dictionaries](https://cspell.org/docs/dictionaries/)\nand [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.", "type": "array" }, "dictionaryDefinitions": { @@ -1476,7 +1501,7 @@ "items": { "$ref": "#/definitions/LanguageIdSingle" }, - "markdownDescription": "Enable / Disable checking file types (languageIds).\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", + "markdownDescription": "Enable / Disable checking file types (languageIds).\n\nThese are in additional to the file types specified by `cSpell.enabledLanguageIds`.\n\nTo disable a language, prefix with `!` as in `!json`,\n\nExample:\n```\njsonc // enable checking for jsonc\n!json // disable checking for json\nkotlin // enable checking for kotlin\n```", "scope": "resource", "title": "File Types to Check", "type": "array", @@ -1513,13 +1538,15 @@ "items": { "$ref": "#/definitions/Glob" }, + "markdownDescription": "Glob patterns of files to be checked.\n\nGlob patterns are relative to the `globRoot` of the configuration file that defines them.", "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.", "items": { "type": "string" }, + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", "type": "array" }, "gitignoreRoot": { @@ -1538,7 +1565,8 @@ }, "globRoot": { "$ref": "#/definitions/FSPathResolvable", - "description": "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}`.\n\nUse `globRoot` to define a different location. `globRoot` can be relative to the location of this configuration file. Defining globRoot, does not impact imported configurations.\n\nSpecial Values:\n- `${cwd}` - will be replaced with the current working directory.\n- `.` - will be the location of the containing configuration file." + "description": "The root to use for glob patterns found in this configuration.", + "markdownDescription": "The root to use for glob patterns found in this configuration.\nDefault: location of the configuration file.\n For compatibility reasons, config files with version 0.1, the glob root will\n default to be `${cwd}`.\n\nUse `globRoot` to define a different location.\n`globRoot` can be relative to the location of this configuration file.\nDefining globRoot, does not impact imported configurations.\n\nSpecial Values:\n- `${cwd}` - will be replaced with the current working directory.\n- `.` - will be the location of the containing configuration file." }, "id": { "description": "Optional identifier.", @@ -1553,7 +1581,8 @@ }, "ignoreRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile 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)." + "description": "List of regular expression patterns or pattern names to exclude from spell checking.", + "markdownDescription": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON\n```json\n\"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"]\n```\n\nYAML\n```yaml\nignoreRegExpList:\n - >-\n /\\b[A-Z]+\\b/g\n```\n\nBy default, several patterns are excluded. See\n[Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "ignoreWords": { "description": "List of words to be ignored. An ignored word will not show up as an error, even if it is also in the `flagWords`.", @@ -1574,11 +1603,13 @@ "type": "array" } ], - "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details." + "description": "Allows this configuration to inherit configuration for one or more other files.\n\nSee https://cspell.org/configuration/imports/ for more details.", + "markdownDescription": "Allows this configuration to inherit configuration for one or more other files.\n\nSee [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details." }, "includeRegExpList": { "$ref": "#/definitions/RegExpPatternList", - "description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile 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)." + "description": "List of regular expression patterns or defined pattern names to match for spell checking.", + "markdownDescription": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are\n[built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html)." }, "language": { "$ref": "#/definitions/LocaleId", @@ -1590,10 +1621,11 @@ "description": "Forces the spell checker to assume a give language id. Used mainly as an Override." }, "languageSettings": { - "description": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", + "description": "Additional settings for individual languages.", "items": { "$ref": "#/definitions/LanguageSetting" }, + "markdownDescription": "Additional settings for individual languages.\n\nSee [Language Settings](https://cspell.org/configuration/language-settings/) for more details.", "type": "array" }, "loadDefaultConfiguration": { @@ -1638,17 +1670,19 @@ "type": "number" }, "overrides": { - "description": "Overrides are used to apply settings for specific files in your project.\n\nFor example:\n\n```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\" } ] ```", + "description": "Overrides are used to apply settings for specific files in your project.", "items": { "$ref": "#/definitions/OverrideSettings" }, + "markdownDescription": "Overrides are used to apply settings for specific files in your project.\n\nFor example:\n\n```javascript\n\"overrides\": [\n // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:\n {\n \"filename\": \"**​/{*.hrr,*.crr}\",\n \"languageId\": \"cpp\"\n },\n // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):\n {\n \"language\": \"nl\",\n \"filename\": \"**​/dutch/**​/*.txt\"\n }\n]\n```", "type": "array" }, "patterns": { - "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and `includeRegExpList` options.\n\nFor example:\n\n```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\"] } ] ```", + "description": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.", "items": { "$ref": "#/definitions/RegExpPatternDefinition" }, + "markdownDescription": "Defines a list of patterns that can be used with the `ignoreRegExpList` and\n`includeRegExpList` options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*​/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```", "type": "array" }, "pnpFiles": { @@ -1671,10 +1705,11 @@ "default": [ "default" ], - "description": "Define which reports to use. `default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", + "description": "Define which reports to use.\n`default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", "items": { "$ref": "#/definitions/ReporterSettings" }, + "markdownDescription": "Define which reports to use.\n`default` - is a special name for the default cli reporter.\n\nExamples:\n- `[\"default\"]` - to use the default reporter\n- `[\"@cspell/cspell-json-reporter\"]` - use the cspell JSON reporter.\n- `[[\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]`\n- `[ \"default\", [\"@cspell/cspell-json-reporter\", { \"outFile\": \"out.json\" }]]` - Use both the default reporter and the cspell-json-reporter.", "type": "array" }, "showStatus": { @@ -1688,15 +1723,17 @@ "type": "number" }, "suggestWords": { - "description": "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.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix) - `word: suggestion` - `word->suggestion`\n- Multiple suggestions (not auto fixable) - `word: first, second, third` - `word->first, second, third`", + "description": "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.", "items": { "type": "string" }, + "markdownDescription": "A list of suggested replacements for words.\nSuggested words provide a way to make preferred suggestions on word replacements.\nTo hint at a preferred change, but not to require it.\n\nFormat of `suggestWords`\n- Single suggestion (possible auto fix)\n - `word: suggestion`\n - `word->suggestion`\n- Multiple suggestions (not auto fixable)\n - `word: first, second, third`\n - `word->first, second, third`", "type": "array" }, "suggestionNumChanges": { "default": 3, - "description": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", + "description": "The maximum number of changes allowed on a word to be considered a suggestions.", + "markdownDescription": "The maximum number of changes allowed on a word to be considered a suggestions.\n\nFor example, appending an `s` onto `example` -> `examples` is considered 1 change.\n\nRange: between 1 and 5.", "type": "number" }, "suggestionsTimeout": { diff --git a/packages/cspell-types/cspell.test.yaml b/packages/cspell-types/cspell.test.yaml deleted file mode 100644 index e127857cce1..00000000000 --- a/packages/cspell-types/cspell.test.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -"$schema": https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json -version: "0.2" -id: cspell-project-config -name: cspell Project Config -language: en -words: - - ajv -languageSettings: - - languageId: "!cpp,!plaintext" - words: - - plaintext -maxNumberOfProblems: 1000 -ignorePaths: - - dictionaries/** - - node_modules/** - - "**/*.d.ts" - - coverage/** - - ".git/**" - - dist/** - - package.json - - ".vscode/**" -dictionaryDefinitions: [] -ignoreWords: [] diff --git a/packages/cspell-types/package.json b/packages/cspell-types/package.json index 2f31882085f..c725b28ea13 100644 --- a/packages/cspell-types/package.json +++ b/packages/cspell-types/package.json @@ -52,13 +52,11 @@ "scripts": { "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"", "build": "pnpm build:tsc && pnpm run build-schema", - "build:tsc": "tsc -b tsconfig.json", - "build-schema": "ts-json-schema-generator --no-top-ref --path src/CSpellSettingsDef.ts --type CSpellSettings --validation-keywords markdownDescription --validation-keywords scope --validation-keywords deprecated --validation-keywords deprecationMessage -o ./cspell.schema.json && shx cp ./cspell.schema.json ../..", + "build:tsc": "tsc -p tsconfig.json", + "build-schema": "pnpm build-cspell-schema", "clean-build": "pnpm run clean && pnpm run build", "coverage": "vitest run --coverage", - "test": "pnpm test:unit && pnpm test:schema", - "test:unit": "vitest run", - "test:schema": "ajv -s ./cspell.schema.json -d \"cspell.test.{json,yaml}\" -c ./ajv.config.js", + "test": "vitest run", "prepare": "echo Skip Building Types" }, "repository": { @@ -85,9 +83,5 @@ "license": "MIT", "engines": { "node": ">=16" - }, - "devDependencies": { - "ajv-cli": "^5.0.0", - "ts-json-schema-generator": "^1.3.0" } } diff --git a/packages/cspell-types/src/CSpellSettingsDef.ts b/packages/cspell-types/src/CSpellSettingsDef.ts index 099554da136..42d2a1906fe 100644 --- a/packages/cspell-types/src/CSpellSettingsDef.ts +++ b/packages/cspell-types/src/CSpellSettingsDef.ts @@ -50,13 +50,21 @@ export interface FileSettings extends ExtendableSettings, CommandLineSettings { userWords?: string[]; /** + * @markdownDescription * Allows this configuration to inherit configuration for one or more other files. * * See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details. + * + * @description + * Allows this configuration to inherit configuration for one or more other files. + * + * See https://cspell.org/configuration/imports/ for more details. + * */ import?: FsPath | FsPath[]; /** + * @markdownDescription * 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 @@ -70,10 +78,18 @@ export interface FileSettings extends ExtendableSettings, CommandLineSettings { * - `${cwd}` - will be replaced with the current working directory. * - `.` - will be the location of the containing configuration file. * + * @description + * The root to use for glob patterns found in this configuration. */ globRoot?: FSPathResolvable; /** + * @markdownDescription + * Glob patterns of files to be checked. + * + * Glob patterns are relative to the `globRoot` of the configuration file that defines them. + * + * @description * Glob patterns of files to be checked. * * Glob patterns are relative to the `globRoot` of the configuration file that defines them. @@ -113,6 +129,17 @@ export interface FileSettings extends ExtendableSettings, CommandLineSettings { readonly?: boolean; /** + * @markdownDescription + * 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. + * + * @description * Define which reports to use. * `default` - is a special name for the default cli reporter. * @@ -161,6 +188,7 @@ export interface FileSettings extends ExtendableSettings, CommandLineSettings { */ export interface ExtendableSettings extends Settings { /** + * @markdownDescription * Overrides are used to apply settings for specific files in your project. * * For example: @@ -179,6 +207,8 @@ export interface ExtendableSettings extends Settings { * } * ] * ``` + * @description + * Overrides are used to apply settings for specific files in your project. */ overrides?: OverrideSettings[]; } @@ -206,7 +236,9 @@ export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettin * @uniqueItems true * @markdownDescription * Enable / Disable checking file types (languageIds). + * * These are in additional to the file types specified by `cSpell.enabledLanguageIds`. + * * To disable a language, prefix with `!` as in `!json`, * * Example: @@ -219,9 +251,13 @@ export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettin enableFiletypes?: LanguageIdSingle[]; /** + * @markdownDescription * Additional settings for individual languages. * * See [Language Settings](https://cspell.org/configuration/language-settings/) for more details. + * + * @description + * Additional settings for individual languages. */ languageSettings?: LanguageSetting[]; @@ -255,12 +291,16 @@ export interface SuggestionsConfiguration { suggestionsTimeout?: number; /** + * @markdownDescription * 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. * + * @description + * The maximum number of changes allowed on a word to be considered a suggestions. + * * @default 3 */ suggestionNumChanges?: number; @@ -423,9 +463,13 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings enabled?: boolean; /** + * @markdownDescription * True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. * - * @default false + * @description + * True to enable compound word checking. See https://cspell.org/docs/case-sensitive/ for more details. + + * @default false */ allowCompoundWords?: boolean; @@ -455,6 +499,7 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings dictionaryDefinitions?: DictionaryDefinition[]; /** + * @markdownDescription * 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. @@ -463,6 +508,9 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings * * See the [Dictionaries](https://cspell.org/docs/dictionaries/) * and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details. + * + * @description + * Optional list of dictionaries to use. Each entry should match the name of the dictionary. */ dictionaries?: DictionaryReference[]; @@ -478,6 +526,7 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings noSuggestDictionaries?: DictionaryReference[]; /** + * @markdownDescription * List of regular expression patterns or pattern names to exclude from spell checking. * * Example: `["href"]` - to exclude html href pattern. @@ -503,20 +552,26 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings * * 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). + * @description + * List of regular expression patterns or pattern names to exclude from spell checking. */ ignoreRegExpList?: RegExpPatternList; /** + * @markdownDescription * 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). + * @description + * List of regular expression patterns or defined pattern names to match for spell checking. */ includeRegExpList?: RegExpPatternList; /** + * @markdownDescription * Defines a list of patterns that can be used with the `ignoreRegExpList` and * `includeRegExpList` options. * @@ -540,6 +595,9 @@ export interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings * } * ] * ``` + * @description + * Defines a list of patterns that can be used with the `ignoreRegExpList` and + * `includeRegExpList` options. */ patterns?: RegExpPatternDefinition[]; } diff --git a/packages/cspell-types/src/DictionaryDefinition.ts b/packages/cspell-types/src/DictionaryDefinition.ts index 904856f8a05..eaa6fa75e8a 100644 --- a/packages/cspell-types/src/DictionaryDefinition.ts +++ b/packages/cspell-types/src/DictionaryDefinition.ts @@ -41,10 +41,12 @@ export interface DictionaryDefinitionBase { noSuggest?: boolean; /** * Type of file: - * S - single word per line, - * W - each line can contain one or more words separated by space, - * C - each line is treated like code (Camel Case is allowed). + * - S - single word per line, + * - W - each line can contain one or more words separated by space, + * - C - each line is treated like code (Camel Case is allowed). + * * Default is S. + * * C is the slowest to load due to the need to split each line based upon code splitting rules. * @default "S" */ @@ -152,10 +154,12 @@ export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase { file: FsDictionaryPath; /** * Type of file: - * S - single word per line, - * W - each line can contain one or more words separated by space, - * C - each line is treated like code (Camel Case is allowed). + * - S - single word per line, + * - W - each line can contain one or more words separated by space, + * - C - each line is treated like code (Camel Case is allowed). + * * Default is S. + * * C is the slowest to load due to the need to split each line based upon code splitting rules. * @default "S" */ @@ -175,6 +179,7 @@ export type CustomDictionaryScope = 'user' | 'workspace' | 'folder'; * `user`, `workspace`, or `folder`. * When `addWords` is true, indicates that the spell checker can add words * to the file. + * * Note: only plain text files with one word per line are supported at this moment. */ export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred { @@ -183,6 +188,7 @@ export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferre /** * Defines the scope for when words will be added to the dictionary. + * * Scope values: `user`, `workspace`, `folder`. */ scope?: CustomDictionaryScope | CustomDictionaryScope[]; diff --git a/packages/cspell-types/src/DictionaryInformation.ts b/packages/cspell-types/src/DictionaryInformation.ts index 2a4bdfb72e9..d8700796a08 100644 --- a/packages/cspell-types/src/DictionaryInformation.ts +++ b/packages/cspell-types/src/DictionaryInformation.ts @@ -20,6 +20,8 @@ export interface DictionaryInformation { alphabet?: CharacterSet | CharacterSetCosts[]; /** + * The accent characters. + * @markdownDescription * The accent characters. * * Default: `"\u0300-\u0341"` @@ -63,6 +65,7 @@ export interface DictionaryInformation { export interface HunspellInformation { /** + * @markdownDescription * Selected Hunspell AFF content. * The content must be UTF-8 * @@ -84,6 +87,18 @@ export interface HunspellInformation { * MAP oôöOÔÖ * MAP (IJ)(IJ) * ``` + * + * @description + * Selected Hunspell AFF content. + * The content must be UTF-8 + * + * Sections: + * - TRY + * - MAP + * - REP + * - KEY + * - ICONV + * - OCONV */ aff: HunspellAffContent; diff --git a/packages/cspell-types/src/InlineDictionary.ts b/packages/cspell-types/src/InlineDictionary.ts index fb10cdcd866..ee64d3d9d01 100644 --- a/packages/cspell-types/src/InlineDictionary.ts +++ b/packages/cspell-types/src/InlineDictionary.ts @@ -6,6 +6,8 @@ export interface InlineDictionary { // cspell:ignore colour color canot /** + * List of words to always be considered incorrect. Words found in `flagWords` override `words`. + * @markdownDescription * List of words to always be considered incorrect. Words found in `flagWords` override `words`. * * Format of `flagWords` @@ -31,6 +33,11 @@ export interface InlineDictionary { ignoreWords?: string[]; /** + * 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. + * + * @markdownDescription * 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. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ad717f15db..b9f8c3b3964 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@cspell/eslint-plugin': specifier: workspace:* version: link:packages/cspell-eslint-plugin + '@internal/scripts': + specifier: workspace:* + version: link:scripts '@lerna-lite/cli': specifier: ^2.5.0 version: 2.5.0(@lerna-lite/publish@2.5.0)(@lerna-lite/version@2.5.0)(typescript@5.2.2) @@ -56,9 +59,6 @@ importers: '@vitest/coverage-istanbul': specifier: ^0.34.4 version: 0.34.4(vitest@0.34.4) - ajv-cli: - specifier: ^5.0.0 - version: 5.0.0 conventional-changelog-conventionalcommits: specifier: ^6.1.0 version: 6.1.0 @@ -110,9 +110,6 @@ importers: rollup-plugin-dts: specifier: ^5.3.1 version: 5.3.1(rollup@3.29.0)(typescript@5.2.2) - shelljs: - specifier: ^0.8.5 - version: 0.8.5 shx: specifier: ^0.3.4 version: 0.3.4 @@ -730,9 +727,6 @@ importers: '@types/glob': specifier: ^8.1.0 version: 8.1.0 - '@types/shelljs': - specifier: ^0.8.12 - version: 0.8.12 lorem-ipsum: specifier: ^2.0.8 version: 2.0.8 @@ -777,14 +771,7 @@ importers: specifier: ^3.0.0 version: 3.0.0 - packages/cspell-types: - devDependencies: - ajv-cli: - specifier: ^5.0.0 - version: 5.0.0 - ts-json-schema-generator: - specifier: ^1.3.0 - version: 1.3.0 + packages/cspell-types: {} packages/dynamic-import: dependencies: @@ -816,7 +803,14 @@ importers: specifier: workspace:* version: link:../../packages/cspell-types - scripts: {} + scripts: + dependencies: + safe-stable-stringify: + specifier: ^2.4.3 + version: 2.4.3 + ts-json-schema-generator: + specifier: ^1.3.0 + version: 1.3.0 test-packages/cspell-dictionary/test-cspell-dictionary: dependencies: @@ -1012,6 +1006,15 @@ importers: specifier: workspace:* version: link:../../../packages/cspell-types + test-packages/cspell-types/validate-schema: + dependencies: + ajv: + specifier: ^8.12.0 + version: 8.12.0 + find-up: + specifier: ^6.3.0 + version: 6.3.0 + test-packages/cspell/test-cspell: dependencies: '@cspell/cspell-types': @@ -4197,7 +4200,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 chalk: 4.1.2 jest-message-util: 29.6.3 jest-util: 29.6.3 @@ -4218,14 +4221,14 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.6.3 - jest-config: 29.6.4(@types/node@20.6.0) + jest-config: 29.6.4(@types/node@18.17.15) jest-haste-map: 29.6.4 jest-message-util: 29.6.3 jest-regex-util: 29.6.3 @@ -4253,7 +4256,7 @@ packages: dependencies: '@jest/fake-timers': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 jest-mock: 29.6.3 dev: true @@ -4280,7 +4283,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.6.0 + '@types/node': 18.17.15 jest-message-util: 29.6.3 jest-mock: 29.6.3 jest-util: 29.6.3 @@ -4313,7 +4316,7 @@ packages: '@jest/transform': 29.6.4 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 - '@types/node': 20.6.0 + '@types/node': 18.17.15 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -4400,7 +4403,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.6.0 + '@types/node': 18.17.15 '@types/yargs': 17.0.24 chalk: 4.1.2 @@ -5414,13 +5417,13 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.36 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/bonjour@3.5.10: resolution: {integrity: sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/braces@3.0.2: @@ -5445,13 +5448,13 @@ packages: resolution: {integrity: sha512-iaQslNbARe8fctL5Lk+DsmgWOM83lM+7FzP0eQUJs1jd3kBE8NWqBTIT2S8SqQOJjxvt2eyIjpOuYeRXq2AdMw==} dependencies: '@types/express-serve-static-core': 4.17.36 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/connect@3.4.36: resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/debug@4.1.8: @@ -5484,7 +5487,7 @@ packages: /@types/express-serve-static-core@4.17.36: resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 '@types/qs': 6.9.8 '@types/range-parser': 1.2.4 '@types/send': 0.17.1 @@ -5502,27 +5505,27 @@ packages: /@types/file-entry-cache@5.0.2: resolution: {integrity: sha512-6uLb9gNrW+e4JivzglLQ2eJSyd7xvu5gSkwKIlOZOmuFgz8U7O9ddTwWjmWgUaIeukdQhoWefI5fQ5/MRTw8XA==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: true /@types/glob@7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: true /@types/glob@8.1.0: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: true /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: true /@types/hast@2.3.5: @@ -5544,7 +5547,7 @@ packages: /@types/http-proxy@1.17.11: resolution: {integrity: sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/istanbul-lib-coverage@2.0.4: @@ -5577,7 +5580,7 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/mdast@3.0.12: @@ -5618,7 +5621,7 @@ packages: /@types/node-fetch@2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 form-data: 3.0.1 dev: true @@ -5629,9 +5632,6 @@ packages: /@types/node@18.17.15: resolution: {integrity: sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==} - /@types/node@20.6.0: - resolution: {integrity: sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==} - /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -5689,7 +5689,7 @@ packages: /@types/responselike@1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/retry@0.12.0: @@ -5699,7 +5699,7 @@ packages: /@types/sax@1.2.4: resolution: {integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==} dependencies: - '@types/node': 17.0.45 + '@types/node': 18.17.15 dev: false /@types/scheduler@0.16.3: @@ -5713,7 +5713,7 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/serve-index@1.9.1: @@ -5727,20 +5727,20 @@ packages: dependencies: '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/shelljs@0.8.12: resolution: {integrity: sha512-ZA8U81/gldY+rR5zl/7HSHrG2KDfEb3lzG6uCUDhW1DTQE9yC/VBQ45fXnXq8f3CgInfhZmjtdu/WOUlrXRQUg==} dependencies: '@types/glob': 7.2.0 - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: true /@types/sockjs@0.3.33: resolution: {integrity: sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/stack-utils@2.0.1: @@ -5761,7 +5761,7 @@ packages: /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 dev: false /@types/yargs-parser@21.0.0: @@ -6180,24 +6180,6 @@ packages: clean-stack: 2.2.0 indent-string: 4.0.0 - /ajv-cli@5.0.0: - resolution: {integrity: sha512-LY4m6dUv44HTyhV+u2z5uX4EhPYTM38Iv1jdgDJJJCyOOuqB8KtZEGjPZ2T+sh5ZIJrXUfgErYx/j3gLd3+PlQ==} - hasBin: true - peerDependencies: - ts-node: '>=9.0.0' - peerDependenciesMeta: - ts-node: - optional: true - dependencies: - ajv: 8.12.0 - fast-json-patch: 2.2.1 - glob: 7.2.3 - js-yaml: 3.14.1 - json-schema-migrate: 2.0.0 - json5: 2.2.3 - minimist: 1.2.8 - dev: true - /ajv-formats@2.1.1(ajv@8.12.0): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -6240,6 +6222,7 @@ packages: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 uri-js: 4.4.1 + dev: false /algoliasearch-helper@3.14.0(algoliasearch@4.19.1): resolution: {integrity: sha512-gXDXzsSS0YANn5dHr71CUXOo84cN4azhHKUbg71vAWnH+1JBiR4jf7to3t3JHXknXkbV0F7f055vUSBKrltHLQ==} @@ -8958,7 +8941,7 @@ packages: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 require-like: 0.1.2 dev: false @@ -9085,10 +9068,6 @@ packages: tmp: 0.0.33 dev: true - /fast-deep-equal@2.0.1: - resolution: {integrity: sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==} - dev: true - /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -9115,13 +9094,6 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 - /fast-json-patch@2.2.1: - resolution: {integrity: sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==} - engines: {node: '>= 0.4.0'} - dependencies: - fast-deep-equal: 2.0.1 - dev: true - /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -9719,7 +9691,6 @@ packages: inherits: 2.0.4 minimatch: 5.1.6 once: 1.4.0 - dev: true /global-dirs@3.0.1: resolution: {integrity: sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==} @@ -10922,7 +10893,7 @@ packages: '@jest/expect': 29.6.4 '@jest/test-result': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -11012,46 +10983,6 @@ packages: - supports-color dev: true - /jest-config@29.6.4(@types/node@20.6.0): - resolution: {integrity: sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.22.17 - '@jest/test-sequencer': 29.6.4 - '@jest/types': 29.6.3 - '@types/node': 20.6.0 - babel-jest: 29.6.4(@babel/core@7.22.17) - chalk: 4.1.2 - ci-info: 3.8.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.6.4 - jest-environment-node: 29.6.4 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.6.4 - jest-runner: 29.6.4 - jest-util: 29.6.3 - jest-validate: 29.6.3 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.6.3 - slash: 3.0.0 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - dev: true - /jest-diff@29.6.4: resolution: {integrity: sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -11086,7 +11017,7 @@ packages: '@jest/environment': 29.6.4 '@jest/fake-timers': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 jest-mock: 29.6.3 jest-util: 29.6.3 dev: true @@ -11101,7 +11032,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.6 - '@types/node': 20.6.0 + '@types/node': 18.17.15 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -11152,7 +11083,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 jest-util: 29.6.3 dev: true @@ -11207,7 +11138,7 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -11238,7 +11169,7 @@ packages: '@jest/test-result': 29.6.4 '@jest/transform': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -11314,7 +11245,7 @@ packages: dependencies: '@jest/test-result': 29.6.4 '@jest/types': 29.6.3 - '@types/node': 20.6.0 + '@types/node': 18.17.15 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -11326,7 +11257,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -11334,7 +11265,7 @@ packages: resolution: {integrity: sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.6.0 + '@types/node': 18.17.15 jest-util: 29.6.3 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -11424,17 +11355,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true - /json-schema-migrate@2.0.0: - resolution: {integrity: sha512-r38SVTtojDRp4eD6WsCqiE0eNDt4v1WalBXb9cyZYw9ai5cGtBwzRNWjHzJl38w6TxFkXAIA7h+fyX3tnrAFhQ==} - dependencies: - ajv: 8.12.0 - dev: true - /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: false /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -12534,7 +12460,6 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 - dev: true /minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} @@ -14763,6 +14688,7 @@ packages: /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + dev: false /require-like@0.1.2: resolution: {integrity: sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==} @@ -14945,7 +14871,6 @@ packages: /safe-stable-stringify@2.4.3: resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} engines: {node: '>=10'} - dev: true /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -15920,7 +15845,6 @@ packages: normalize-path: 3.0.0 safe-stable-stringify: 2.4.3 typescript: 5.1.6 - dev: true /ts-loader@9.4.4(typescript@5.2.2)(webpack@5.88.2): resolution: {integrity: sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==} diff --git a/scripts/build-cspell-schema.mjs b/scripts/build-cspell-schema.mjs new file mode 100755 index 00000000000..07d746083e5 --- /dev/null +++ b/scripts/build-cspell-schema.mjs @@ -0,0 +1,63 @@ +#!/usr/bin/env node + +import tsj from 'ts-json-schema-generator'; +import { writeFile } from 'node:fs/promises'; +import safeStableStringify from 'safe-stable-stringify'; +import { fileURLToPath } from 'node:url'; +import * as path from 'path'; + +const importDir = new URL('.', import.meta.url); +const rootUrl = new URL('..', importDir); +const typesDirUrl = new URL('packages/cspell-types', rootUrl); +const outFile = 'cspell.schema.json'; +const typesDir = fileURLToPath(typesDirUrl); + +const defaultConfig = { + expose: 'export', + topRef: true, + jsDoc: 'extended', + sortProps: true, + strictTuples: false, + skipTypeCheck: false, + encodeRefs: true, + minify: false, + extraTags: [], + additionalProperties: false, + discriminatorType: 'json-schema', +}; + +/** + * Build the schema. This method replaces the old command line that was run in `packages/cspell-types` + * ```sh + * ts-json-schema-generator \ + * --no-top-ref \ + * --path src/CSpellSettingsDef.ts \ + * --type CSpellSettings \ + * --validation-keywords markdownDescription \ + * --validation-keywords scope \ + * --validation-keywords deprecated \ + * --validation-keywords deprecationMessage \ + * -o ./cspell.schema.json + * ``` + */ +async function run() { + /** @type {import('ts-json-schema-generator/dist/src/Config').Config} */ + const config = { + ...defaultConfig, + path: path.join(typesDir, 'src/CSpellSettingsDef.ts'), + tsconfig: path.join(typesDir, './tsconfig.json'), + type: 'CSpellSettings', + topRef: false, + extraTags: ['markdownDescription', 'scope', 'deprecated', 'deprecationMessage'], + skipTypeCheck: true, + }; + + const schema = tsj.createGenerator(config).createSchema(config.type); + const stringify = config.sortProps ? safeStableStringify : JSON.stringify; + const schemaString = stringify(schema, null, 2); + + await writeFile(path.join(typesDir, outFile), schemaString); + await writeFile(new URL(outFile, rootUrl), schemaString); +} + +run(); diff --git a/scripts/package.json b/scripts/package.json index a6faccf6f89..4a646fc4bef 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -1,10 +1,11 @@ { - "name": "scripts", + "name": "@internal/scripts", "private": true, "version": "1.0.0", "description": "Tools and Scripts", "bin": { - "update-release-please": "./update-release-please.mjs" + "update-release-please": "./update-release-please.mjs", + "build-cspell-schema": "./build-cspell-schema.mjs" }, "scripts": { "test": "echo Ok" @@ -14,5 +15,10 @@ "license": "MIT", "engines": { "node": ">16.0" + }, + "devDependencies": {}, + "dependencies": { + "safe-stable-stringify": "^2.4.3", + "ts-json-schema-generator": "^1.3.0" } } diff --git a/test-fixtures/issues/issue-4814/cspell.jsonc b/test-fixtures/issues/issue-4814/cspell.jsonc new file mode 100644 index 00000000000..50acf2f1bb1 --- /dev/null +++ b/test-fixtures/issues/issue-4814/cspell.jsonc @@ -0,0 +1,9 @@ +{ + "$schema":"../../../cspell.schema.json", + "version": "0.2", + "import": [], + "maxDuplicateProblems": 5, + "flagWords": [ + "" + ] +} diff --git a/test-fixtures/issues/issue-4814/cspell.yml b/test-fixtures/issues/issue-4814/cspell.yml new file mode 100644 index 00000000000..1bac8fc1ff5 --- /dev/null +++ b/test-fixtures/issues/issue-4814/cspell.yml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=../../../cspell.schema.json + +version: "0.2" +maxDuplicateProblems: 5 +import: + - ../../../cspell.json +flagWords: + - "" diff --git a/packages/cspell-types/cspell.test.json b/test-packages/cspell-types/validate-schema/fixtures/cspell.test.json similarity index 85% rename from packages/cspell-types/cspell.test.json rename to test-packages/cspell-types/validate-schema/fixtures/cspell.test.json index 47a3c217a8e..a3b9453cadb 100644 --- a/packages/cspell-types/cspell.test.json +++ b/test-packages/cspell-types/validate-schema/fixtures/cspell.test.json @@ -4,11 +4,15 @@ "id": "cspell-project-config", "name": "cspell Project Config", "language": "en", - "words": ["ajv"], + "words": [ + "ajv" + ], "languageSettings": [ { "languageId": "!cpp,!plaintext", - "words": ["plaintext"] + "words": [ + "plaintext" + ] } ], "maxNumberOfProblems": 1000, diff --git a/test-packages/cspell-types/validate-schema/package.json b/test-packages/cspell-types/validate-schema/package.json new file mode 100644 index 00000000000..45d30a94465 --- /dev/null +++ b/test-packages/cspell-types/validate-schema/package.json @@ -0,0 +1,20 @@ +{ + "name": "@test-packages/validate-schema", + "version": "1.0.0", + "private": true, + "description": "Test Schema", + "type": "module", + "scripts": { + "test": "node ./validate-schema.mjs" + }, + "keywords": [], + "author": "", + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "find-up": "^6.3.0" + }, + "engines": { + "node": ">16.0.0" + } +} diff --git a/test-packages/cspell-types/validate-schema/validate-schema.mjs b/test-packages/cspell-types/validate-schema/validate-schema.mjs new file mode 100644 index 00000000000..bfab23ab7e9 --- /dev/null +++ b/test-packages/cspell-types/validate-schema/validate-schema.mjs @@ -0,0 +1,50 @@ +import assert from 'assert'; +import Ajv from 'ajv'; +import { findUp } from 'find-up'; +import { promises as fs } from 'node:fs'; + +const fixturesUrl = new URL('fixtures/', import.meta.url); +const fixtures = ['cspell.test.json']; + +const keywords = ['deprecationMessage', 'markdownDescription', 'scope']; + +let errors = 0; + +async function run() { + const schemaFile = await findUp('cspell.schema.json'); + + assert(schemaFile, 'Schema file: `cspell.schema.json` not found.'); + + const ajv = new Ajv({ keywords }); + + const schema = await readJson(schemaFile); + + const validateFn = ajv.compile(schema); + + for (const fixture of fixtures) { + const data = await readJsonFixture(fixture); + + const valid = validateFn(data); + if (valid) { + console.log('%s OK', fixture); + } else { + errors += 1; + console.log('%s Failed', fixture); + console.log('Errors: %o', validateFn.errors); + } + } + + if (errors) { + process.exitCode = 1; + } +} + +function readJsonFixture(file) { + return readJson(new URL(file, fixturesUrl)); +} + +async function readJson(file) { + return JSON.parse(await fs.readFile(file, 'utf8')); +} + +run();