diff --git a/packages/cspell-eslint-plugin/README.md b/packages/cspell-eslint-plugin/README.md index 278717e958af..db2e71c82fdb 100644 --- a/packages/cspell-eslint-plugin/README.md +++ b/packages/cspell-eslint-plugin/README.md @@ -192,6 +192,7 @@ interface Options { /** Define dictionaries. */ dictionaryDefinitions?: DictionaryDefinition[]; }; + /** * Specify a path to a custom word list file. * @@ -201,6 +202,35 @@ interface Options { * ``` */ customWordListFile?: string | { path: string }; + + /** + * Scope selectors to spell check. + * This is a list of scope selectors to spell check. + * + * Example: + * ```js + * checkScope: [ + * ['YAMLPair[key] YAMLScalar', true], + * ['YAMLPair[value] YAMLScalar', true], + * ['YAMLSequence[entries] YAMLScalar', true], + * ['JSONProperty[key] JSONLiteral', true], + * ['JSONProperty[value] JSONLiteral', true], + * ['JSONArrayExpression JSONLiteral', true], + * ], + * ``` + * + * To turn off checking JSON keys, use the following: + * + * ```js + * checkScope: [ + * ['JSONProperty[key] JSONLiteral', false], + * ], + * ``` + * + * @since 8.9.0 + */ + checkScope?: ScopeSelectorList; + /** * Output debug logs * @default false @@ -294,6 +324,24 @@ When spell checking, if `colour` is not in one of the dictionaries, then `color` CSpell will match case, but not word stems. `blacklist` and `Blacklist` will get replaced, but not `blacklists`. +## Checking Custom AST Nodes + +The `checkScope` setting is used to enable / disable checking AST Nodes. ESLint uses parsers to generate the AST (Abstract Syntax Tree) to evaluate a document. Each PlugIn gets access to the AST. `checkScope` can be used to handle new AST nodes when a custom parser is added. Some knowledge of the AST output by the parser is necessary. + +```js +rules: { + '@cspell/spellchecker': ['warn', { checkScope: [ + ['JSONLiteral': true], // will match AST Nodes of type `JSONLiteral` and spell check the value. + ['JSONProperty[key] JSONLiteral', false] // will turn off checking the JSON Property keys. + ['JSONProperty JSONLiteral', false] // will turn off checking the JSON Property keys and values. + ['JSONProperty[value] JSONLiteral', true] // will turn on checking the JSON Property values. + ['YAMLPair[key] YAMLScalar', true], + ['YAMLPair[value] YAMLScalar', true], + ['YAMLSequence YAMLScalar', true], + ] }], +}, +``` + ## In Combination with CSpell Due to the nature of how files are parsed, the `cspell` command line tool and this ESLint plugin will give different results. diff --git a/packages/cspell-eslint-plugin/assets/options.schema.json b/packages/cspell-eslint-plugin/assets/options.schema.json index b031ef15b5cc..3e47ae200eec 100644 --- a/packages/cspell-eslint-plugin/assets/options.schema.json +++ b/packages/cspell-eslint-plugin/assets/options.schema.json @@ -23,6 +23,25 @@ "description": "Spell check JSX Text", "type": "boolean" }, + "checkScope": { + "description": "Scope selectors to spell check. This is a list of scope selectors to spell check.\n\nExample: ```js checkScope: [ ['YAMLPair[key] YAMLScalar', true], ['YAMLPair[value] YAMLScalar', true], ['YAMLSequence[entries] YAMLScalar', true], ['JSONProperty[key] JSONLiteral', true], ['JSONProperty[value] JSONLiteral', true], ['JSONArrayExpression JSONLiteral', true], ], ```", + "items": { + "description": "A scope selector entry is a tuple that defines a scope selector and whether to spell check it.", + "items": [ + { + "description": "The scope selector is a string that defines the context in which a rule applies. Examples:\n- `YAMLPair[value] YAMLScalar` - check the value of a YAML pair.\n- `YAMLPair[key] YAMLScalar` - check the key of a YAML pair.", + "type": "string" + }, + { + "type": "boolean" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "type": "array" + }, "checkStringTemplates": { "default": true, "description": "Spell check template strings", diff --git a/packages/cspell-eslint-plugin/fixtures/json-support/README.md b/packages/cspell-eslint-plugin/fixtures/json-support/README.md new file mode 100644 index 000000000000..9ea1e7c242a5 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/json-support/README.md @@ -0,0 +1,3 @@ +# JSON Support + +This directory contains sample to test JSON support. diff --git a/packages/cspell-eslint-plugin/fixtures/json-support/eslint.config.mjs b/packages/cspell-eslint-plugin/fixtures/json-support/eslint.config.mjs new file mode 100644 index 000000000000..76b2aea420e1 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/json-support/eslint.config.mjs @@ -0,0 +1,24 @@ +// @ts-check +import eslint from '@eslint/js'; +import cspellRecommended from '@cspell/eslint-plugin/recommended'; +import eslintPluginJsonc from 'eslint-plugin-jsonc'; + +/** + * @type { import("eslint").Linter.FlatConfig[] } + */ +const config = [ + eslint.configs.recommended, + cspellRecommended, + ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'], + { + ignores: ['eslint.config.mjs'], + }, + { + files: ['**/*.json', '**/*.jsonc'], + rules: { + '@cspell/spellchecker': ['warn', { debugMode: true }], + }, + }, +]; + +export default config; diff --git a/packages/cspell-eslint-plugin/fixtures/json-support/package.json b/packages/cspell-eslint-plugin/fixtures/json-support/package.json new file mode 100644 index 000000000000..f55d40f752b8 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/json-support/package.json @@ -0,0 +1,16 @@ +{ + "name": "markdown-support", + "version": "1.0.0", + "description": "", + "scripts": { + "test": "eslint ." + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@cspell/eslint-plugin": "workspace:*", + "eslint-plugin-mdx": "^3.1.5", + "eslint": "^8.50.0" + } +} diff --git a/packages/cspell-eslint-plugin/fixtures/json-support/sample.jsonc b/packages/cspell-eslint-plugin/fixtures/json-support/sample.jsonc new file mode 100644 index 000000000000..02df017d885b --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/json-support/sample.jsonc @@ -0,0 +1,17 @@ +{ + "address": { + "street": "123 Main St", + "city": "Metropolis", + "state": "AA", + "zip": "12345" + }, + "phone": "123-456-7890", + // This is a line commment + "email": "user@example.com", + + "places": ["Home", "Work", "Vacation", "Schooll", "Park", "Library", "Store"] + + /* + This is a block comment + */ +} diff --git a/packages/cspell-eslint-plugin/fixtures/mdx-support/README.md b/packages/cspell-eslint-plugin/fixtures/mdx-support/README.md new file mode 100644 index 000000000000..5f9a35b5f799 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/mdx-support/README.md @@ -0,0 +1,12 @@ +# Markdown Support + +**NOTE:** Markdown is not yet supported. See [#3464](https://github.com/streetsidesoftware/cspell/issues/3464) + +This is a sample file to test out support for spell checking Markdown files. + +## Table + +| col 1 | col 2 | col 3 | +| ----- | ----- | ------ | +| a | 22 | b | +| b | 42 | `null` | diff --git a/packages/cspell-eslint-plugin/fixtures/mdx-support/eslint.config.mjs b/packages/cspell-eslint-plugin/fixtures/mdx-support/eslint.config.mjs new file mode 100644 index 000000000000..b9c9c6e7a12e --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/mdx-support/eslint.config.mjs @@ -0,0 +1,23 @@ +import eslint from '@eslint/js'; +import cspellRecommended from '@cspell/eslint-plugin/recommended'; +import * as mdx from 'eslint-plugin-mdx'; + +/** + * @type { import("eslint").Linter.FlatConfig[] } + */ +const config = [ + eslint.configs.recommended, + cspellRecommended, + mdx.configs.flat, + { + ignores: ['eslint.config.mjs'], + }, + { + files: ['**/*.mdx', '**/*.md'], + rules: { + '@cspell/spellchecker': ['warn', { debugMode: true }], + }, + }, +]; + +export default config; diff --git a/packages/cspell-eslint-plugin/fixtures/mdx-support/md-with-code.mdx b/packages/cspell-eslint-plugin/fixtures/mdx-support/md-with-code.mdx new file mode 100644 index 000000000000..9fa9df75b1e8 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/mdx-support/md-with-code.mdx @@ -0,0 +1,12 @@ +# Markdown Support with Code + +This is a sample file to test out support for spell checking Markdown files. + +```js +/* Example Function */ +function sampleFn() {} +``` + +```ts +const msg = 'A bit of typescript.'; +``` diff --git a/packages/cspell-eslint-plugin/fixtures/mdx-support/package.json b/packages/cspell-eslint-plugin/fixtures/mdx-support/package.json new file mode 100644 index 000000000000..f55d40f752b8 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/mdx-support/package.json @@ -0,0 +1,16 @@ +{ + "name": "markdown-support", + "version": "1.0.0", + "description": "", + "scripts": { + "test": "eslint ." + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@cspell/eslint-plugin": "workspace:*", + "eslint-plugin-mdx": "^3.1.5", + "eslint": "^8.50.0" + } +} diff --git a/packages/cspell-eslint-plugin/fixtures/yaml-support/eslint.config.mjs b/packages/cspell-eslint-plugin/fixtures/yaml-support/eslint.config.mjs new file mode 100644 index 000000000000..97c686f9b772 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/yaml-support/eslint.config.mjs @@ -0,0 +1,27 @@ +import eslint from '@eslint/js'; +import cspellRecommended from '@cspell/eslint-plugin/recommended'; +import parserYml from 'yaml-eslint-parser'; +import pluginYml from 'eslint-plugin-yml'; + +/** + * @type { import("eslint").Linter.FlatConfig[] } + */ +const config = [ + eslint.configs.recommended, + cspellRecommended, + ...pluginYml.configs['flat/standard'], + { + files: ['**/*.yaml', '**/*.yml'], + languageOptions: { + parser: parserYml, + }, + // plugins: { + // yml: pluginYml, + // }, + rules: { + '@cspell/spellchecker': 'warn', + }, + }, +]; + +export default config; diff --git a/packages/cspell-eslint-plugin/fixtures/yaml-support/sample.yaml b/packages/cspell-eslint-plugin/fixtures/yaml-support/sample.yaml new file mode 100644 index 000000000000..effc74b4ee44 --- /dev/null +++ b/packages/cspell-eslint-plugin/fixtures/yaml-support/sample.yaml @@ -0,0 +1,24 @@ +--- +# Starting comment +list: + - one + - two + - three + - 4 + - 5 + - true + - false +obj: + key: value + key2: value2 # comment after value + key3: value3 + command: | + echo "Hello, World!" + echo "Goodbye, World!" + command2: >- + line 1 + line 2 + 'command three': > + line 3 + line 4 + # comment diff --git a/packages/cspell-eslint-plugin/package.json b/packages/cspell-eslint-plugin/package.json index f84f7c200e77..07dcc7870371 100644 --- a/packages/cspell-eslint-plugin/package.json +++ b/packages/cspell-eslint-plugin/package.json @@ -45,9 +45,10 @@ "assets", "dist", "!**/__mocks__", - "!**/*.tsbuildInfo", - "!**/*.test.*", "!**/*.spec.*", + "!**/*.test.*", + "!**/test*/**", + "!**/*.tsbuildInfo", "!**/*.map" ], "scripts": { @@ -60,6 +61,7 @@ "clean-build": "pnpm run clean && pnpm run build", "coverage": "echo coverage", "test-watch": "pnpm run test -- --watch", + "test-yaml": "npx mocha --timeout 10000 \"dist/**/yaml.test.mjs\"", "test": "npx mocha --timeout 10000 \"dist/**/*.test.mjs\"" }, "repository": { @@ -81,19 +83,23 @@ "@typescript-eslint/parser": "^7.13.0", "@typescript-eslint/types": "^7.13.0", "eslint": "^9.4.0", + "eslint-plugin-jsonc": "^2.16.0", + "eslint-plugin-mdx": "^3.1.5", "eslint-plugin-n": "^17.8.1", "eslint-plugin-react": "^7.34.2", "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-yml": "^1.14.0", "globals": "^15.4.0", + "jsonc-eslint-parser": "^2.4.0", "mocha": "^10.4.0", "ts-json-schema-generator": "^2.3.0", "typescript": "^5.4.5", - "typescript-eslint": "^7.13.0" + "typescript-eslint": "^7.13.0", + "yaml-eslint-parser": "^1.2.3" }, "dependencies": { "@cspell/cspell-types": "workspace:*", "cspell-lib": "workspace:*", - "estree-walker": "^3.0.3", "synckit": "^0.9.0" }, "peerDependencies": { diff --git a/packages/cspell-eslint-plugin/src/common/options.cts b/packages/cspell-eslint-plugin/src/common/options.cts index 607348d1cdde..f3480621d427 100644 --- a/packages/cspell-eslint-plugin/src/common/options.cts +++ b/packages/cspell-eslint-plugin/src/common/options.cts @@ -112,6 +112,26 @@ export interface Check { * ``` */ customWordListFile?: CustomWordListFilePath | CustomWordListFile | undefined; + + /** + * Scope selectors to spell check. + * This is a list of scope selectors to spell check. + * + * Example: + * ```js + * checkScope: [ + * ['YAMLPair[key] YAMLScalar', true], + * ['YAMLPair[value] YAMLScalar', true], + * ['YAMLSequence[entries] YAMLScalar', true], + * ['JSONProperty[key] JSONLiteral', true], + * ['JSONProperty[value] JSONLiteral', true], + * ['JSONArrayExpression JSONLiteral', true], + * ], + * ``` + * + * @since 8.9.0 + */ + checkScope?: ScopeSelectorList; } /** @@ -134,3 +154,21 @@ export const defaultOptions: Options = { generateSuggestions: true, autoFix: false, }; + +/** + * The scope selector is a string that defines the context in which a rule applies. + * Examples: + * - `YAMLPair[value] YAMLScalar` - check the value of a YAML pair. + * - `YAMLPair[key] YAMLScalar` - check the key of a YAML pair. + */ +export type ScopeSelector = string; + +/** + * A scope selector entry is a tuple that defines a scope selector and whether to spell check it. + */ +export type ScopeSelectorEntry = [ScopeSelector, boolean]; + +/** + * A list of scope selectors. + */ +export type ScopeSelectorList = ScopeSelectorEntry[]; diff --git a/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts b/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts index 21d07b716fe8..a0df2e7dfc66 100644 --- a/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts +++ b/packages/cspell-eslint-plugin/src/plugin/cspell-eslint-plugin.cts @@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs'; import { join as pathJoin } from 'node:path'; import type { ESLint, Rule } from 'eslint'; +import type { Program } from 'estree'; import { createSyncFn } from 'synckit'; import { getDefaultLogger } from '../common/logger.cjs'; @@ -120,10 +121,11 @@ function create(context: Rule.RuleContext): Rule.RuleListener { context.report(des); } - function checkProgram() { + function checkProgram(_node: Program) { + const filename = context.filename || context.getFilename(); const sc = context.sourceCode || context.getSourceCode(); if (!sc) return; - const { issues, errors } = spellCheck(context.filename || context.getFilename(), sc.text, sc.ast, options); + const { issues, errors } = spellCheck(filename, sc.text, sc.ast, options); if (errors && errors.length) { log( 'errors: %o', diff --git a/packages/cspell-eslint-plugin/src/plugin/defaultCheckOptions.cts b/packages/cspell-eslint-plugin/src/plugin/defaultCheckOptions.cts index 6fafbefcae21..d371a1ea85df 100644 --- a/packages/cspell-eslint-plugin/src/plugin/defaultCheckOptions.cts +++ b/packages/cspell-eslint-plugin/src/plugin/defaultCheckOptions.cts @@ -15,6 +15,7 @@ export const defaultCheckOptions: Required = { customWordListFile: undefined, ignoreImportProperties: true, ignoreImports: true, + checkScope: [], }; export const defaultOptions: RequiredOptions = { diff --git a/packages/cspell-eslint-plugin/src/test-util/testEach.mts b/packages/cspell-eslint-plugin/src/test-util/testEach.mts new file mode 100644 index 000000000000..23c72939fed3 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/test-util/testEach.mts @@ -0,0 +1,24 @@ +import 'mocha'; + +export function testEach(cases: T[]): (title: string, fn: (arg: T) => void) => void { + function fixTitle(title: string, testData: T) { + const parts = title.split(/\b/g); + for (let i = parts.length - 1; i >= 0; i--) { + const prev = parts[i - 1]; + if (prev && prev.endsWith('$')) { + parts[i - 1] = prev.slice(0, -1); + parts[i] = '$' + parts[i]; + } + } + + const map = new Map(Object.entries(testData).map(([key, value]) => ['$' + key, `"${value}"`])); + + return parts.map((part) => map.get(part) ?? part).join(''); + } + + return (title, fn) => { + for (const c of cases) { + it(fixTitle(title, c), () => fn(c)); + } + }; +} diff --git a/packages/cspell-eslint-plugin/src/test-util/tsconfig.json b/packages/cspell-eslint-plugin/src/test-util/tsconfig.json new file mode 100644 index 000000000000..1191668eeff3 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/test-util/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "tsBuildInfoFile": "../../dist/test-util/compile.tsbuildInfo", + "rootDir": ".", + "outDir": "../../dist/test-util" + }, + "include": ["."] +} diff --git a/packages/cspell-eslint-plugin/src/test/index.test.mts b/packages/cspell-eslint-plugin/src/test/index.test.mts index a562a1870707..0cfe4bf8c07f 100644 --- a/packages/cspell-eslint-plugin/src/test/index.test.mts +++ b/packages/cspell-eslint-plugin/src/test/index.test.mts @@ -4,8 +4,6 @@ import { fileURLToPath } from 'node:url'; import typeScriptParser from '@typescript-eslint/parser'; import { RuleTester } from 'eslint'; -import react from 'eslint-plugin-react'; -import globals from 'globals'; import type { Options as RuleOptions } from '../plugin/index.cjs'; import Rule from '../plugin/index.cjs'; @@ -25,13 +23,11 @@ type Options = Partial; const ruleTester = new RuleTester({}); const KnownErrors: TestCaseError[] = [ - ce('Unknown word: "Summmer"', 8), ce('Unknown word: "friendz"', 8), ce('Forbidden word: "Bluelist"', 8), ce('Forbidden word: "bluelist"', 8), ce('Forbidden word: "café"', 8), ce('Unknown word: "uuug"', 8), - ce('Unknown word: "Welcomeeeee"', 0), ce('Unknown word: "bestbusiness"', 0), ce('Unknown word: "muawhahaha"', 0), ce('Unknown word: "uuuug"', 0), @@ -206,39 +202,6 @@ ruleTester.run('cspell', Rule.rules.spellchecker, { ], }); -const ruleTesterReact = new RuleTester({ - files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], - plugins: { - react, - }, - languageOptions: { - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - }, - globals: { - ...globals.browser, - }, - }, - // ... others are omitted for brevity -}); - -ruleTesterReact.run('cspell with React', Rule.rules.spellchecker, { - valid: [readSample('react/sample.jsx'), readSample('react/sample.tsx')], - invalid: [ - // cspell:ignore Welcomeeeee Summmer - readInvalid('with-errors/react/sample.jsx', ['Unknown word: "Welcomeeeee"', 'Unknown word: "Summmer"']), - readInvalid('with-errors/react/sample.tsx', ['Unknown word: "Welcomeeeee"', 'Unknown word: "Summmer"']), - readInvalid('with-errors/react/sample.tsx', ['Unknown word: "Summmer"'], { - checkJSXText: false, - }), - readInvalid('with-errors/react/sample.jsx', ['Unknown word: "Summmer"'], { - checkJSXText: false, - }), - ], -}); - function resolveFix(filename: string): string { return path.resolve(fixturesDir, filename); } diff --git a/packages/cspell-eslint-plugin/src/test/json.test.mts b/packages/cspell-eslint-plugin/src/test/json.test.mts new file mode 100644 index 000000000000..be65182b2f37 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/test/json.test.mts @@ -0,0 +1,113 @@ +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import typeScriptParser from '@typescript-eslint/parser'; +import { RuleTester } from 'eslint'; +import eslintPluginJsonc from 'eslint-plugin-jsonc'; +import parser from 'jsonc-eslint-parser'; + +import type { Options as RuleOptions } from '../plugin/index.cjs'; +import Rule from '../plugin/index.cjs'; + +const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const root = path.resolve(__dirname, '../..'); +const fixturesDir = path.join(root, 'fixtures'); + +const parsers: Record = { + // Note: it is possible for @typescript-eslint/parser to break the path + '.ts': typeScriptParser, +}; + +type ValidTestCase = RuleTester.ValidTestCase; +type Options = Partial; + +const KnownErrors: TestCaseError[] = []; + +const ruleTester = new RuleTester({ + files: ['**/*.json', '**/*.jsonc'], + plugins: { jsonc: eslintPluginJsonc }, + languageOptions: { + parser, + }, +}); + +ruleTester.run('cspell', Rule.rules.spellchecker, { + valid: [ + readFix('json-support/sample.jsonc', { + checkComments: false, + checkScope: [['JSONArrayExpression JSONLiteral', false]], + }), + readFix('json-support/sample.jsonc', { + checkComments: false, + checkScope: [['JSONArrayExpression[elements] JSONLiteral', false]], + }), + ], + invalid: [ + // cspell:ignore commment Schooll + readInvalid('json-support/sample.jsonc', [ce('Unknown word: "commment"', 8), ce('Unknown word: "Schooll"', 8)]), + ], +}); + +function resolveFix(filename: string): string { + return path.resolve(fixturesDir, filename); +} + +interface ValidTestCaseEsLint9 extends ValidTestCase { + languageOptions?: { + parser?: unknown; + }; +} + +function readFix(filename: string, options?: Options): ValidTestCase { + const __filename = resolveFix(filename); + const code = fs.readFileSync(__filename, 'utf8'); + + const sample: ValidTestCaseEsLint9 = { + code, + filename: __filename, + }; + if (options) { + sample.options = [options]; + } + + const parser = parsers[path.extname(__filename)]; + if (parser) { + sample.languageOptions ??= {}; + sample.languageOptions.parser = parser; + } + + return sample; +} + +interface TestCaseError { + message?: string | RegExp | undefined; + messageId?: string | undefined; + type?: string | undefined; + data?: unknown | undefined; + line?: number | undefined; + column?: number | undefined; + endLine?: number | undefined; + endColumn?: number | undefined; + suggestions?: RuleTester.SuggestionOutput[] | undefined | number; +} + +type InvalidTestCaseError = RuleTester.TestCaseError | TestCaseError | string; + +function readInvalid(filename: string, errors: (TestCaseError | string)[], options?: Options) { + const sample = readFix(filename, options); + return { + ...sample, + errors: errors.map((err) => csError(err)), + }; +} + +function ce(message: string, suggestions?: number): RuleTester.TestCaseError { + return { message, suggestions } as RuleTester.TestCaseError; +} + +function csError(error: InvalidTestCaseError, suggestions?: number): RuleTester.TestCaseError { + if (error && typeof error === 'object') return error as RuleTester.TestCaseError; + const found = KnownErrors.find((e) => e.message === error) as RuleTester.TestCaseError | undefined; + return found || ce(error, suggestions); +} diff --git a/packages/cspell-eslint-plugin/src/test/jsx.test.mts b/packages/cspell-eslint-plugin/src/test/jsx.test.mts new file mode 100644 index 000000000000..0e26f1603f93 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/test/jsx.test.mts @@ -0,0 +1,125 @@ +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import typeScriptParser from '@typescript-eslint/parser'; +import { RuleTester } from 'eslint'; +import react from 'eslint-plugin-react'; +import globals from 'globals'; + +import type { Options as RuleOptions } from '../plugin/index.cjs'; +import Rule from '../plugin/index.cjs'; + +const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const root = path.resolve(__dirname, '../..'); +const fixturesDir = path.join(root, 'fixtures'); + +const parsers: Record = { + // Note: it is possible for @typescript-eslint/parser to break the path + '.ts': typeScriptParser, +}; + +type ValidTestCase = RuleTester.ValidTestCase; +type Options = Partial; + +const KnownErrors: TestCaseError[] = [ce('Unknown word: "Summmer"', 8)]; + +const ruleTesterReact = new RuleTester({ + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], + plugins: { + react, + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + ...globals.browser, + }, + }, + // ... others are omitted for brevity +}); + +ruleTesterReact.run('cspell with React', Rule.rules.spellchecker, { + valid: [readSample('react/sample.jsx'), readSample('react/sample.tsx')], + invalid: [ + // cspell:ignore Welcomeeeee Summmer + readInvalid('with-errors/react/sample.jsx', ['Unknown word: "Welcomeeeee"', 'Unknown word: "Summmer"']), + readInvalid('with-errors/react/sample.tsx', ['Unknown word: "Welcomeeeee"', 'Unknown word: "Summmer"']), + readInvalid('with-errors/react/sample.tsx', ['Unknown word: "Summmer"'], { + checkJSXText: false, + }), + readInvalid('with-errors/react/sample.jsx', ['Unknown word: "Summmer"'], { + checkJSXText: false, + }), + ], +}); + +function resolveFix(filename: string): string { + return path.resolve(fixturesDir, filename); +} + +interface ValidTestCaseEsLint9 extends ValidTestCase { + languageOptions?: { + parser?: unknown; + }; +} + +function readFix(filename: string, options?: Options): ValidTestCase { + const __filename = resolveFix(filename); + const code = fs.readFileSync(__filename, 'utf8'); + + const sample: ValidTestCaseEsLint9 = { + code, + filename: __filename, + }; + if (options) { + sample.options = [options]; + } + + const parser = parsers[path.extname(__filename)]; + if (parser) { + sample.languageOptions ??= {}; + sample.languageOptions.parser = parser; + } + + return sample; +} + +function readSample(sampleFile: string, options?: Options) { + return readFix(path.join('samples', sampleFile), options); +} + +interface TestCaseError { + message?: string | RegExp | undefined; + messageId?: string | undefined; + type?: string | undefined; + data?: unknown | undefined; + line?: number | undefined; + column?: number | undefined; + endLine?: number | undefined; + endColumn?: number | undefined; + suggestions?: RuleTester.SuggestionOutput[] | undefined | number; +} + +type InvalidTestCaseError = RuleTester.TestCaseError | TestCaseError | string; + +function readInvalid(filename: string, errors: (TestCaseError | string)[], options?: Options) { + const sample = readFix(filename, options); + return { + ...sample, + errors: errors.map((err) => csError(err)), + }; +} + +function ce(message: string, suggestions?: number): RuleTester.TestCaseError { + return { message, suggestions } as RuleTester.TestCaseError; +} + +function csError(error: InvalidTestCaseError, suggestions?: number): RuleTester.TestCaseError { + if (error && typeof error === 'object') return error as RuleTester.TestCaseError; + const found = KnownErrors.find((e) => e.message === error) as RuleTester.TestCaseError | undefined; + return found || ce(error, suggestions); +} diff --git a/packages/cspell-eslint-plugin/src/test/yaml.test.mts b/packages/cspell-eslint-plugin/src/test/yaml.test.mts new file mode 100644 index 000000000000..8cbdf3192044 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/test/yaml.test.mts @@ -0,0 +1,66 @@ +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import typeScriptParser from '@typescript-eslint/parser'; +import { RuleTester } from 'eslint'; +import parserYml from 'yaml-eslint-parser'; + +import type { Options as RuleOptions } from '../plugin/index.cjs'; +import Rule from '../plugin/index.cjs'; + +const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const root = path.resolve(__dirname, '../..'); +const fixturesDir = path.join(root, 'fixtures'); + +const parsers: Record = { + // Note: it is possible for @typescript-eslint/parser to break the path + '.ts': typeScriptParser, +}; + +type ValidTestCase = RuleTester.ValidTestCase; +type Options = Partial; + +const ruleTester = new RuleTester({ + files: ['**/*.{yml,yaml}'], + languageOptions: { + parser: parserYml, + }, + // ... others are omitted for brevity +}); + +ruleTester.run('cspell', Rule.rules.spellchecker, { + valid: [readFix('yaml-support/sample.yaml')], + invalid: [], +}); + +function resolveFix(filename: string): string { + return path.resolve(fixturesDir, filename); +} + +interface ValidTestCaseEsLint9 extends ValidTestCase { + languageOptions?: { + parser?: unknown; + }; +} + +function readFix(filename: string, options?: Options): ValidTestCase { + const __filename = resolveFix(filename); + const code = fs.readFileSync(__filename, 'utf8'); + + const sample: ValidTestCaseEsLint9 = { + code, + filename: __filename, + }; + if (options) { + sample.options = [options]; + } + + const parser = parsers[path.extname(__filename)]; + if (parser) { + sample.languageOptions ??= {}; + sample.languageOptions.parser = parser; + } + + return sample; +} diff --git a/packages/cspell-eslint-plugin/src/worker/ASTNode.cts b/packages/cspell-eslint-plugin/src/worker/ASTNode.cts index 53a372a5e15e..03f6a8143789 100644 --- a/packages/cspell-eslint-plugin/src/worker/ASTNode.cts +++ b/packages/cspell-eslint-plugin/src/worker/ASTNode.cts @@ -4,6 +4,6 @@ export interface JSXText extends Omit { type: 'JSXText'; } -export type ASTNode = (Node | Comment | JSXText) & { parent?: Node }; +export type ASTNode = Readonly<(Node | Comment | JSXText) & { parent?: Node }>; export type NodeType = ASTNode['type']; diff --git a/packages/cspell-eslint-plugin/src/worker/ASTPath.mts b/packages/cspell-eslint-plugin/src/worker/ASTPath.mts new file mode 100644 index 000000000000..359196b01d06 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/worker/ASTPath.mts @@ -0,0 +1,14 @@ +import type { ASTNode } from './ASTNode.cjs'; + +export type Key = string | number | symbol | null | undefined; + +export interface ASTPathElement { + node: ASTNode; + parent: ASTNode | undefined; + key: Key; + index?: number | undefined; +} + +export interface ASTPath extends ASTPathElement { + prev: ASTPath | undefined; +} diff --git a/packages/cspell-eslint-plugin/src/worker/customScopes.mts b/packages/cspell-eslint-plugin/src/worker/customScopes.mts new file mode 100644 index 000000000000..c199933dfe86 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/worker/customScopes.mts @@ -0,0 +1,15 @@ +import type { RequiredOptions } from '../common/options.cjs'; + +export const defaultCheckedScopes: RequiredOptions['checkScope'] = [ + ['YAMLPair YAMLScalar', true], + ['YAMLSequence YAMLScalar', true], + ['JSONProperty JSONLiteral', true], + ['JSONArrayExpression JSONLiteral', true], + + // ['YAMLPair[key] YAMLScalar', true], + // ['YAMLPair[value] YAMLScalar', true], + // ['YAMLSequence[entries] YAMLScalar', true], + // ['JSONProperty[key] JSONLiteral', true], + // ['JSONProperty[value] JSONLiteral', true], + // ['JSONArrayExpression[elements] JSONLiteral', true], +]; diff --git a/packages/cspell-eslint-plugin/src/worker/scope.mts b/packages/cspell-eslint-plugin/src/worker/scope.mts new file mode 100644 index 000000000000..c1ac6dcec4e5 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/worker/scope.mts @@ -0,0 +1,187 @@ +import assert from 'node:assert'; + +import type { ASTPath, Key } from './ASTPath.mjs'; + +export type ScopeScore = number; + +export class AstScopeMatcher { + constructor(readonly scope: ScopeItem[]) {} + + static fromScopeSelector(scopeSelector: string): AstScopeMatcher { + return new AstScopeMatcher(parseScope(scopeSelector).reverse()); + } + + /** + * Score the astScope based on the given scope. + * @param astScope The scope to score. + * @returns The score of the scope. 0 = no match, higher the score the better the match. + */ + score(astScope: string[]): ScopeScore { + try { + const scopeItems = astScope.map(parseScopeItem).reverse(); + return this.scoreItems(scopeItems); + } catch { + console.error('Failed to parse scope: %o', astScope); + return 0; + } + } + + /** + * Score the astScope based on the given scope. + * @param astScope The scope to score. + * @returns The score of the scope. 0 = no match, higher the score the better the match. + */ + scoreItems(scopeItems: ScopeItem[]): ScopeScore { + const scope = this.scope; + let score = 0; + let scale = 1; + let matchKey = false; + + for (let i = 0; i < scope.length; i++) { + const item = scopeItems[i]; + if (!item) return 0; + const curr = scope[i]; + if (curr.type !== item.type) return 0; + if (curr.childKey && item.childKey && curr.childKey !== item.childKey) return 0; + if (curr.childKey && !item.childKey && matchKey) return 0; + if (curr.childKey && (curr.childKey == item.childKey || !matchKey)) { + score += scale; + } + score += scale * 2; + matchKey = true; + scale *= 4; + } + + return score; + } + + matchPath(path: ASTPath): ScopeScore { + const s = this.scope[0]; + // Early out + if (s?.type !== path.node.type) return 0; + + const items = astPathToScopeItems(path); + return this.scoreItems(items); + } + + scopeField(): string { + return this.scope[0]?.childKey || 'value'; + } + + scopeType(): string { + return this.scope[0]?.type || ''; + } +} + +export interface ScopeItem { + type: string; + childKey: string | undefined; +} + +export function scopeItem(type: string, childKey?: string): ScopeItem { + return { type, childKey }; +} + +const regexValidScope = /^([\w.-]+)(?:\[([\w<>.-]*)\])?$/; + +function parseScopeItem(item: string): ScopeItem { + const match = item.match(regexValidScope); + assert(match, `Invalid scope item: ${item}`); + const [_, type, key] = match; + return { type, childKey: key || undefined }; +} + +export function parseScope(scope: string): ScopeItem[] { + return scope + .split(' ') + .filter((s) => s) + .map(parseScopeItem); +} + +export interface ASTPathNodeToScope { + /** + * Convert a path node into a scope. + * @param node - The node to convert + * @param childKey - The key to the child node. + */ + (node: ASTPath, childKey: Key | undefined): ScopeItem; +} + +export function keyToString(key: Key): string | undefined { + return key === undefined || key === null + ? undefined + : typeof key === 'symbol' + ? `<${Symbol.keyFor(key)}>` + : `${key}`; +} + +export function mapNodeToScope(p: ASTPath, key: Key | undefined): ScopeItem { + return mapNodeToScopeItem(p, key); +} + +export function mapNodeToScopeItem(p: ASTPath, childKey: Key | undefined): ScopeItem { + return scopeItem(p.node.type, keyToString(childKey)); +} + +export function mapScopeItemToString(item: ScopeItem): string { + const { type, childKey: k } = item; + return k === undefined ? type : `${type}[${k}]`; +} + +/** + * Convert an ASTPath to a scope. + * @param path - The path to convert to a scope. + * @returns + */ +export function astPathToScope(path: ASTPath | undefined, mapFn: ASTPathNodeToScope = mapNodeToScope): string[] { + return astPathToScopeItems(path, mapFn).map(mapScopeItemToString).reverse(); +} + +export function astScopeToString(path: ASTPath | undefined, sep = ' ', mapFn?: ASTPathNodeToScope): string { + return astPathToScope(path, mapFn).join(sep); +} + +export function astPathToScopeItems( + path: ASTPath | undefined, + mapFn: ASTPathNodeToScope = mapNodeToScope, +): ScopeItem[] { + const parts: ScopeItem[] = []; + + let key: Key | undefined = undefined; + + while (path) { + parts.push(mapFn(path, key)); + key = path?.key; + path = path.prev; + } + + return parts; +} + +export class AstPathScope { + private items: ScopeItem[]; + constructor(readonly path: ASTPath) { + this.items = astPathToScopeItems(path); + } + + get scope(): string[] { + return this.items.map(mapScopeItemToString).reverse(); + } + + get scopeItems(): ScopeItem[] { + return this.items; + } + + get scopeString(): string { + return this.scope.join(' '); + } + + score(matcher: AstScopeMatcher): ScopeScore { + const field = matcher.scopeField(); + const node = this.path.node; + if (field in node && typeof (node as unknown as Record)[field] === 'string') { + return matcher.scoreItems(this.items); + } + return 0; + } +} diff --git a/packages/cspell-eslint-plugin/src/worker/scope.test.mts b/packages/cspell-eslint-plugin/src/worker/scope.test.mts new file mode 100644 index 000000000000..e0a7430abe83 --- /dev/null +++ b/packages/cspell-eslint-plugin/src/worker/scope.test.mts @@ -0,0 +1,48 @@ +import 'mocha'; + +import assert from 'node:assert'; + +import { testEach } from '../test-util/testEach.mjs'; +import { AstScopeMatcher, parseScope, scopeItem } from './scope.mjs'; + +describe('scope', () => { + testEach([ + { + scope: 'YAMLPair[value] YAMLScalar', + expected: [scopeItem('YAMLPair', 'value'), scopeItem('YAMLScalar')], + }, + { + scope: 'YAMLPair[key] YAMLScalar[value]', + expected: [scopeItem('YAMLPair', 'key'), scopeItem('YAMLScalar', 'value')], + }, + { + scope: 'YAMLPair', + expected: [scopeItem('YAMLPair')], + }, + ])('parseScope $scope', ({ scope, expected }) => { + assert.deepStrictEqual(parseScope(scope), expected); + }); + + testEach([ + { scope: 'YAMLScalar', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 2 }, + { scope: 'YAMLScalar[value]', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 3 }, + { scope: 'YAMLPair', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 0 }, + { scope: 'YAMLPair YAMLScalar', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 10 }, + { scope: 'YAMLPair[key] YAMLScalar', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 14 }, + { scope: 'YAMLPair[value] YAMLScalar', astScope: ['YAMLPair[key]', 'YAMLScalar'], expected: 0 }, + ])('score $scope', ({ scope, astScope, expected }) => { + const s = AstScopeMatcher.fromScopeSelector(scope); + assert.strictEqual(s.score(astScope), expected); + }); + + testEach([ + { scope: 'YAMLScalar', expected: 'value' }, + { scope: 'YAMLScalar[value]', expected: 'value' }, + { scope: 'YAMLPair[key]', expected: 'key' }, + { scope: 'YAMLPair[key] YAMLScalar[rawValue]', expected: 'rawValue' }, + { scope: '', expected: 'value' }, + ])('scope field $scope', ({ scope, expected }) => { + const s = AstScopeMatcher.fromScopeSelector(scope); + assert.equal(s.scopeField(), expected); + }); +}); diff --git a/packages/cspell-eslint-plugin/src/worker/spellCheck.mts b/packages/cspell-eslint-plugin/src/worker/spellCheck.mts index c92c1565fd82..9dca99f044f2 100644 --- a/packages/cspell-eslint-plugin/src/worker/spellCheck.mts +++ b/packages/cspell-eslint-plugin/src/worker/spellCheck.mts @@ -1,7 +1,6 @@ // cspell:ignore TSESTree import assert from 'node:assert'; import * as path from 'node:path'; -import { format } from 'node:util'; import type { TSESTree } from '@typescript-eslint/types'; import type { CSpellSettings, TextDocument, ValidationIssue } from 'cspell-lib'; @@ -15,8 +14,12 @@ import { import type { Comment, Identifier, ImportSpecifier, Literal, Node, TemplateElement } from 'estree'; import { getDefaultLogger } from '../common/logger.cjs'; -import type { CustomWordListFile, WorkerOptions } from '../common/options.cjs'; +import type { CustomWordListFile, ScopeSelectorList, WorkerOptions } from '../common/options.cjs'; import type { ASTNode, JSXText, NodeType } from './ASTNode.cjs'; +import type { ASTPath, Key } from './ASTPath.mjs'; +import { defaultCheckedScopes } from './customScopes.mjs'; +import type { ScopeItem } from './scope.mjs'; +import { AstPathScope, AstScopeMatcher, astScopeToString, mapNodeToScope, scopeItem } from './scope.mjs'; import type { Issue, SpellCheckResults, Suggestions } from './types.cjs'; import { walkTree } from './walkTree.mjs'; @@ -32,6 +35,7 @@ const defaultSettings: CSpellSettings = { }; const isDebugModeExtended = false; +const forceLogging = false; const knownConfigErrors = new Set(); @@ -42,10 +46,12 @@ export async function spellCheck( options: WorkerOptions, ): Promise { const logger = getDefaultLogger(); - const debugMode = options.debugMode || false; - logger.enabled = options.debugMode ?? (logger.enabled || isDebugModeExtended); + const debugMode = forceLogging || options.debugMode || false; + logger.enabled = forceLogging || (options.debugMode ?? (logger.enabled || isDebugModeExtended)); const log = logger.log; + const mapScopes = groupScopes([...defaultCheckedScopes, ...(options.checkScope || [])]); + log('options: %o', options); const toIgnore = new Set(); @@ -67,36 +73,40 @@ export async function spellCheck( return found; } - function checkLiteral(node: Literal | ASTNode) { + function checkLiteral(path: ASTPath) { + const node: Literal | ASTNode = path.node; if (node.type !== 'Literal') return; if (!options.checkStrings) return; if (typeof node.value === 'string') { - debugNode(node, node.value); + debugNode(path, node.value); if (options.ignoreImports && isImportOrRequired(node)) return; if (options.ignoreImportProperties && isImportedProperty(node)) return; - checkNodeText(node, node.value); + checkNodeText(path, node.value); } } - function checkJSXText(node: JSXText | ASTNode) { + function checkJSXText(path: ASTPath) { + const node: JSXText | ASTNode = path.node; if (node.type !== 'JSXText') return; if (!options.checkJSXText) return; if (typeof node.value === 'string') { - debugNode(node, node.value); - checkNodeText(node, node.value); + debugNode(path, node.value); + checkNodeText(path, node.value); } } - function checkTemplateElement(node: TemplateElement | ASTNode) { + function checkTemplateElement(path: ASTPath) { + const node: TemplateElement | ASTNode = path.node; if (node.type !== 'TemplateElement') return; if (!options.checkStringTemplates) return; - debugNode(node, node.value); - checkNodeText(node, node.value.cooked || node.value.raw); + debugNode(path, node.value); + checkNodeText(path, node.value.cooked || node.value.raw); } - function checkIdentifier(node: Identifier | ASTNode) { + function checkIdentifier(path: ASTPath) { + const node: Identifier | ASTNode = path.node; if (node.type !== 'Identifier') return; - debugNode(node, node.name); + debugNode(path, node.name); if (options.ignoreImports) { if (isRawImportIdentifier(node)) { toIgnore.add(node.name); @@ -105,7 +115,7 @@ export async function spellCheck( if (isImportIdentifier(node)) { importedIdentifiers.add(node.name); if (isLocalImportIdentifierUnique(node)) { - checkNodeText(node, node.name); + checkNodeText(path, node.name); } return; } else if (options.ignoreImportProperties && isImportedProperty(node)) { @@ -115,28 +125,30 @@ export async function spellCheck( if (!options.checkIdentifiers) return; if (toIgnore.has(node.name) && !isObjectProperty(node)) return; if (skipCheckForRawImportIdentifiers(node)) return; - checkNodeText(node, node.name); + checkNodeText(path, node.name); } - function checkComment(node: Comment | ASTNode) { + function checkComment(path: ASTPath) { + const node: Comment | ASTNode = path.node; if (node.type !== 'Line' && node.type !== 'Block') return; if (!options.checkComments) return; - debugNode(node, node.value); - checkNodeText(node, node.value); + debugNode(path, node.value); + checkNodeText(path, node.value); } - function checkNodeText(node: ASTNode, text: string) { + function checkNodeText(path: ASTPath, text: string) { + const node: ASTNode = path.node; if (!node.range) return; const adj = node.type === 'Literal' ? 1 : 0; const range = [node.range[0] + adj, node.range[1] - adj] as const; - const scope: string[] = calcScope(node); + const scope: string[] = calcScope(path); const result = validator.checkText(range, text, scope); result.forEach((issue) => reportIssue(issue, node.type)); } - function calcScope(_node: ASTNode): string[] { + function calcScope(_path: ASTPath): string[] { // inheritance(node); return []; } @@ -201,7 +213,7 @@ export async function spellCheck( type NodeTypes = Node['type'] | Comment['type'] | 'JSXText'; type Handlers = { - [K in NodeTypes]?: (n: ASTNode) => void; + [K in NodeTypes]?: (p: ASTPath) => void; }; const processors: Handlers = { @@ -213,78 +225,65 @@ export async function spellCheck( JSXText: checkJSXText, }; - function checkNode(node: ASTNode) { - processors[node.type]?.(node); - } - - function mapNode(node: ASTNode | TSESTree.Node, index: number, nodes: ASTNode[]): string { - const child = nodes[index + 1]; - if (node.type === 'ImportSpecifier') { - const extra = node.imported === child ? '.imported' : node.local === child ? '.local' : ''; - return node.type + extra; - } - if (node.type === 'ImportDeclaration') { - const extra = node.source === child ? '.source' : ''; - return node.type + extra; - } - if (node.type === 'ExportSpecifier') { - const extra = node.exported === child ? '.exported' : node.local === child ? '.local' : ''; - return node.type + extra; - } - if (node.type === 'ExportNamedDeclaration') { - const extra = node.source === child ? '.source' : ''; - return node.type + extra; - } - if (node.type === 'Property') { - const extra = node.key === child ? 'key' : node.value === child ? 'value' : ''; - return [node.type, node.kind, extra].join('.'); - } - if (node.type === 'MemberExpression') { - const extra = node.property === child ? 'property' : node.object === child ? 'object' : ''; - return node.type + '.' + extra; - } - if (node.type === 'ArrowFunctionExpression') { - const extra = node.body === child ? 'body' : 'param'; - return node.type + '.' + extra; + function needToCheckFields(path: ASTPath): Record | undefined { + const possibleScopes = mapScopes.get(path.node.type); + if (!possibleScopes) { + _dumpNode(path); + return undefined; } - if (node.type === 'FunctionDeclaration') { - const extra = node.id === child ? 'id' : node.body === child ? 'body' : 'params'; - return node.type + '.' + extra; - } - if (node.type === 'ClassDeclaration' || node.type === 'ClassExpression') { - const extra = node.id === child ? 'id' : node.body === child ? 'body' : 'superClass'; - return node.type + '.' + extra; - } - if (node.type === 'CallExpression') { - const extra = node.callee === child ? 'callee' : 'arguments'; - return node.type + '.' + extra; - } - if (node.type === 'Literal') { - return tagLiteral(node); - } - if (node.type === 'Block') { - return node.value[0] === '*' ? 'Comment.docBlock' : 'Comment.block'; - } - if (node.type === 'Line') { - return 'Comment.line'; + + const scopePath = new AstPathScope(path); + + const scores = possibleScopes + .map(({ scope, check }) => ({ score: scopePath.score(scope), check, scope })) + .filter((s) => s.score > 0); + const maxScore = Math.max(0, ...scores.map((s) => s.score)); + const topScopes = scores.filter((s) => s.score === maxScore); + if (!topScopes.length) return undefined; + return Object.fromEntries(topScopes.map((s) => [s.scope.scopeField(), s.check])); + } + + function defaultHandler(path: ASTPath) { + const fields = needToCheckFields(path); + if (!fields) return; + for (const [field, check] of Object.entries(fields)) { + if (!check) continue; + const node = path.node as object as Record; + const value = node[field]; + if (typeof value !== 'string') continue; + debugNode(path, value); + checkNodeText(path, value); } - return node.type; } - function inheritance(node: ASTNode) { - const a = [...parents(node), node]; - return a.map(mapNode); + function checkNode(path: ASTPath) { + // _dumpNode(path); + const handler = processors[path.node.type] ?? defaultHandler; + handler(path); } - function* parents(node: ASTNode | undefined): Iterable { - while (node && node.parent) { - yield node.parent; - node = node.parent; + function _dumpNode(path: ASTPath) { + function value(v: unknown) { + if (['string', 'number', 'boolean'].includes(typeof v)) return v; + if (v && typeof v === 'object' && 'type' in v) return `{ type: ${v.type} }`; + return `<${v}>`; + } + + function dotValue(v: { [key: string]: unknown } | unknown) { + if (typeof v === 'object' && v) { + return Object.fromEntries(Object.entries(v).map(([k, v]) => [k, value(v)])); + } + return `<${typeof v}>`; } - } - function inheritanceSummary(node: ASTNode) { - return inheritance(node).join(' '); + const { parent: _, ...n } = path.node; + const warn = log; + warn('Node: %o', { + key: path.key, + type: n.type, + path: inheritanceSummary(path), + node: dotValue(n), + }); } /** @@ -301,7 +300,8 @@ export async function spellCheck( } function isFunctionCall(node: ASTNode | undefined, name: string): boolean { - return node?.type === 'CallExpression' && node.callee.type === 'Identifier' && node.callee.name === name; + if (!node) return false; + return node.type === 'CallExpression' && node.callee.type === 'Identifier' && node.callee.name === name; } function isRequireCall(node: ASTNode | undefined) { @@ -312,23 +312,43 @@ export async function spellCheck( return isRequireCall(node.parent) || (node.parent?.type === 'ImportDeclaration' && node.parent.source === node); } - function debugNode(node: ASTNode, value: unknown) { - if (!isDebugModeExtended) return; - const val = format('%o', value); - log(`${inheritanceSummary(node)}: ${val}`); + function debugNode(path: ASTPath, value: unknown) { + log(`${inheritanceSummary(path)}: %o`, value); + debugMode && _dumpNode(path); } + // console.warn('root: %o', root); + walkTree(root, checkNode); return { issues, errors }; } +function mapNode(path: ASTPath, key: Key | undefined): ScopeItem { + const node = path.node; + if (node.type === 'Literal') { + return scopeItem(tagLiteral(node)); + } + if (node.type === 'Block') { + const value = typeof node.value === 'string' ? node.value : ''; + return scopeItem(value[0] === '*' ? 'Comment.docBlock' : 'Comment.block'); + } + if (node.type === 'Line') { + return scopeItem('Comment.line'); + } + return mapNodeToScope(path, key); +} + +function inheritanceSummary(path: ASTPath) { + return astScopeToString(path, ' ', mapNode); +} + function tagLiteral(node: ASTNode | TSESTree.Node): string { assert(node.type === 'Literal'); const kind = typeof node.value; const extra = kind === 'string' - ? node.raw?.[0] === '"' + ? asStr(node.raw)?.[0] === '"' ? 'string.double' : 'string.single' : node.value === null @@ -489,3 +509,25 @@ async function reportConfigurationErrors(config: CSpellSettings, knownConfigErro return errors; } + +interface ScopeCheck { + scope: AstScopeMatcher; + check: boolean; +} + +function groupScopes(scopes: ScopeSelectorList): Map { + const objScopes = Object.fromEntries(scopes); + const map = new Map(); + for (const [selector, check] of Object.entries(objScopes)) { + const scope = AstScopeMatcher.fromScopeSelector(selector); + const key = scope.scopeType(); + const list = map.get(key) || []; + list.push({ scope, check }); + map.set(key, list); + } + return map; +} + +function asStr(v: string | unknown): string | undefined { + return typeof v === 'string' ? v : undefined; +} diff --git a/packages/cspell-eslint-plugin/src/worker/tsconfig.json b/packages/cspell-eslint-plugin/src/worker/tsconfig.json index d41da6e7b165..28371ce16f85 100644 --- a/packages/cspell-eslint-plugin/src/worker/tsconfig.json +++ b/packages/cspell-eslint-plugin/src/worker/tsconfig.json @@ -7,5 +7,5 @@ "outDir": "../../dist/worker" }, "include": ["."], - "references": [{ "path": "../common/tsconfig.json" }] + "references": [{ "path": "../common/tsconfig.json" }, { "path": "../test-util/tsconfig.json" }] } diff --git a/packages/cspell-eslint-plugin/src/worker/walkTree.mts b/packages/cspell-eslint-plugin/src/worker/walkTree.mts index 5586a46dc154..3fe2266e6f8b 100644 --- a/packages/cspell-eslint-plugin/src/worker/walkTree.mts +++ b/packages/cspell-eslint-plugin/src/worker/walkTree.mts @@ -1,21 +1,75 @@ -import type { Node } from 'estree-walker'; -import { walk } from 'estree-walker'; - import type { ASTNode } from './ASTNode.cjs'; +import type { ASTPath, ASTPathElement, Key } from './ASTPath.mjs'; -type Key = string | number | symbol | null | undefined; +// const logger = getDefaultLogger(); +// const log = logger.log; -export function walkTree(node: ASTNode, enter: (node: ASTNode, parent: ASTNode | undefined, key: Key) => void) { +export function walkTree(node: ASTNode, enter: (path: ASTPath) => void) { const visited = new Set(); - walk(node as Node, { - enter: function (node, parent, key) { - if (visited.has(node) || key === 'tokens') { - this.skip(); - return; - } - visited.add(node); - enter(node as ASTNode, parent as ASTNode, key); - }, + let pathNode: ASTPath | undefined = undefined; + + function adjustPath(n: ASTPath): ASTPath { + if (!n.parent || !pathNode) { + pathNode = n; + n.prev = undefined; + return n; + } + if (pathNode.node === n.parent) { + n.prev = pathNode; + pathNode = n; + return n; + } + while (pathNode && pathNode.node !== n.parent) { + pathNode = pathNode.prev; + } + n.prev = pathNode; + pathNode = n; + return n; + } + + walk(node, ({ node, parent, key, index }) => { + if (key === 'tokens' || key === 'parent' || visited.has(node)) { + return false; + } + visited.add(node); + const path = adjustPath({ node, parent: parent, key, index, prev: undefined }); + enter(path); + return true; }); } + +type CallBack = (element: ASTPathElement) => boolean; + +function walk(root: ASTNode, enter: CallBack) { + function walkNodes(pfx: string, node: ASTNode, parent: ASTNode | undefined, key: Key, index: number | undefined) { + const goIn = enter({ node, parent, key, index }); + // log('walk: %o', { pfx, type: node.type, key, index, goIn }); + if (!goIn) return; + + const n = node as Readonly>; + + for (const key of Object.keys(n)) { + const v = n[key] as unknown; + const fx = pfx + `.${node.type}[${key}]`; + if (Array.isArray(v)) { + for (let i = 0; i < v.length; ++i) { + const vv = v[i]; + isNode(vv) && walkNodes(fx, vv as ASTNode, node, key, i); + } + } else if (isNode(v)) { + walkNodes(fx, v, node, key, undefined); + } + } + + return true; + } + + walkNodes('root', root, undefined, undefined, undefined); +} + +function isNode(node: ASTNode | unknown): node is ASTNode { + if (!node) return false; + const n = node as ASTNode; + return (typeof n === 'object' && typeof n['type'] === 'string') || false; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cff69b53d77b..b2144b2ed977 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -482,9 +482,6 @@ importers: cspell-lib: specifier: workspace:* version: link:../cspell-lib - estree-walker: - specifier: ^3.0.3 - version: 3.0.3 synckit: specifier: ^0.9.0 version: 0.9.0 @@ -510,6 +507,12 @@ importers: eslint: specifier: ^9.4.0 version: 9.4.0 + eslint-plugin-jsonc: + specifier: ^2.16.0 + version: 2.16.0(eslint@9.4.0) + eslint-plugin-mdx: + specifier: ^3.1.5 + version: 3.1.5(eslint@9.4.0) eslint-plugin-n: specifier: ^17.8.1 version: 17.8.1(eslint@9.4.0) @@ -519,9 +522,15 @@ importers: eslint-plugin-simple-import-sort: specifier: ^12.1.0 version: 12.1.0(eslint@9.4.0) + eslint-plugin-yml: + specifier: ^1.14.0 + version: 1.14.0(eslint@9.4.0) globals: specifier: ^15.4.0 version: 15.4.0 + jsonc-eslint-parser: + specifier: ^2.4.0 + version: 2.4.0 mocha: specifier: ^10.4.0 version: 10.4.0 @@ -534,6 +543,9 @@ importers: typescript-eslint: specifier: ^7.13.0 version: 7.13.0(eslint@9.4.0)(typescript@5.4.5) + yaml-eslint-parser: + specifier: ^1.2.3 + version: 1.2.3 packages/cspell-gitignore: dependencies: @@ -4988,6 +5000,20 @@ packages: - supports-color dev: true + /@npmcli/config@8.3.3: + resolution: {integrity: sha512-sIMKHiiYr91ALiHjhPq64F5P/SCaiSyDfpNmgYHtlIJtLY445+3+r3VoREzpdDrOwIqwQ6iEHinbTfaocL0UgA==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/map-workspaces': 3.0.6 + ci-info: 4.0.0 + ini: 4.1.3 + nopt: 7.2.1 + proc-log: 4.2.0 + read-package-json-fast: 3.0.2 + semver: 7.6.2 + walk-up-path: 3.0.1 + dev: true + /@npmcli/fs@3.1.1: resolution: {integrity: sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -5020,6 +5046,21 @@ packages: npm-normalize-package-bin: 3.0.1 dev: true + /@npmcli/map-workspaces@3.0.6: + resolution: {integrity: sha512-tkYs0OYnzQm6iIRdfy+LcLBjcKuQCeE5YLb8KnrIlutJfheNaPvPpgoFEyEFgbjzl5PLZ3IA/BWAwRU0eHuQDA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + '@npmcli/name-from-folder': 2.0.0 + glob: 10.4.1 + minimatch: 9.0.4 + read-package-json-fast: 3.0.2 + dev: true + + /@npmcli/name-from-folder@2.0.0: + resolution: {integrity: sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /@npmcli/node-gyp@3.0.0: resolution: {integrity: sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -5171,7 +5212,6 @@ packages: /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dev: false /@pnpm/config.env-replace@1.1.0: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} @@ -5819,6 +5859,12 @@ packages: resolution: {integrity: sha512-0WR3b8eaISjEW7RpZnclONaLFDf7buaowRHdqLp4vLj54AsSAYWfh3DRbfiYJY9XDxMgx1B4sE1Afw2PGpuHOA==} dev: true + /@types/concat-stream@2.0.3: + resolution: {integrity: sha512-3qe4oQAPNwVNwK4C9c8u+VJqv9kez+2MR4qJpoPFfXtgxxif1QbFusvXzK0/Wra2VX07smostI2VMmJNSpZjuQ==} + dependencies: + '@types/node': 18.19.34 + dev: true + /@types/configstore@6.0.2: resolution: {integrity: sha512-OS//b51j9uyR3zvwD04Kfs5kHpve2qalQ18JhY/ho3voGYUTPLEG90/ocfKPI48hyHH8T04f7KEEbK6Ue60oZQ==} dev: true @@ -5935,6 +5981,10 @@ packages: '@types/node': 20.14.2 dev: false + /@types/is-empty@1.2.3: + resolution: {integrity: sha512-4J1l5d79hoIvsrKh5VUKVRA1aIdsOb10Hu5j3J2VfP/msDnfTdGPmNp2E1Wg+vs97Bktzo+MZePFFXSGoykYJw==} + dev: true + /@types/istanbul-lib-coverage@2.0.6: resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -5962,6 +6012,12 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true + /@types/mdast@3.0.15: + resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + dependencies: + '@types/unist': 2.0.10 + dev: true + /@types/mdast@4.0.4: resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} dependencies: @@ -7405,12 +7461,24 @@ packages: /character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + /character-entities-legacy@1.1.4: + resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + dev: true + /character-entities-legacy@3.0.0: resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + /character-entities@1.2.4: + resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} + dev: true + /character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + /character-reference-invalid@1.1.4: + resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + dev: true + /character-reference-invalid@2.0.1: resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} @@ -7752,6 +7820,16 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + /concat-stream@2.0.0: + resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} + engines: {'0': node >= 6.0} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 3.6.2 + typedarray: 0.0.6 + dev: true + /confbox@0.1.7: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} dev: true @@ -9006,6 +9084,31 @@ packages: - supports-color dev: true + /eslint-mdx@3.1.5(eslint@9.4.0): + resolution: {integrity: sha512-ynztX0k7CQ3iDL7fDEIeg3g0O/d6QPv7IBI9fdYLhXp5fAp0fi8X22xF/D3+Pk0f90R27uwqa1clHpay6t0l8Q==} + engines: {node: '>=18.0.0'} + peerDependencies: + eslint: '>=8.0.0' + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) + eslint: 9.4.0 + espree: 9.6.1 + estree-util-visit: 2.0.0 + remark-mdx: 3.0.1 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + synckit: 0.9.0 + tslib: 2.6.3 + unified: 11.0.4 + unified-engine: 11.2.1 + unist-util-visit: 5.0.0 + uvu: 0.5.6 + vfile: 6.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.4.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} @@ -9116,6 +9219,53 @@ packages: - typescript dev: true + /eslint-plugin-jsonc@2.16.0(eslint@9.4.0): + resolution: {integrity: sha512-Af/ZL5mgfb8FFNleH6KlO4/VdmDuTqmM+SPnWcdoWywTetv7kq+vQe99UyQb9XO3b0OWLVuTH7H0d/PXYCMdSg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.4.0) + eslint: 9.4.0 + eslint-compat-utils: 0.5.1(eslint@9.4.0) + espree: 9.6.1 + graphemer: 1.4.0 + jsonc-eslint-parser: 2.4.0 + natural-compare: 1.4.0 + synckit: 0.6.2 + dev: true + + /eslint-plugin-markdown@3.0.1(eslint@9.4.0): + resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + eslint: 9.4.0 + mdast-util-from-markdown: 0.8.5 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-mdx@3.1.5(eslint@9.4.0): + resolution: {integrity: sha512-lUE7tP7IrIRHU3gTtASDe5u4YM2SvQveYVJfuo82yn3MLh/B/v05FNySURCK4aIxIYF1QYo3IRemQG/lyQzpAg==} + engines: {node: '>=18.0.0'} + peerDependencies: + eslint: '>=8.0.0' + dependencies: + eslint: 9.4.0 + eslint-mdx: 3.1.5(eslint@9.4.0) + eslint-plugin-markdown: 3.0.1(eslint@9.4.0) + remark-mdx: 3.0.1 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + tslib: 2.6.3 + unified: 11.0.4 + vfile: 6.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-n@17.8.1(eslint@8.57.0): resolution: {integrity: sha512-KdG0h0voZms8UhndNu8DeWx1eM4sY+A4iXtsNo6kOfJLYHNeTGPacGalJ9GcvrbmOL3r/7QOMwVZDSw+1SqsrA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -9220,6 +9370,22 @@ packages: - supports-color dev: true + /eslint-plugin-yml@1.14.0(eslint@9.4.0): + resolution: {integrity: sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + debug: 4.3.5 + eslint: 9.4.0 + eslint-compat-utils: 0.5.1(eslint@9.4.0) + lodash: 4.17.21 + natural-compare: 1.4.0 + yaml-eslint-parser: 1.2.3 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -10859,6 +11025,11 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: false + /ini@4.1.3: + resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /inject-markdown@3.0.0: resolution: {integrity: sha512-qKZAdUXlq8KOQAVFXIaVSnUM58Ht6+3ptloCjcqaY7EJoBsoeE3fMBoVF1bymiaX/C1GogBHTFPc8Lnr8ZCjaw==} engines: {node: '>=18'} @@ -10950,9 +11121,20 @@ packages: engines: {node: '>= 10'} dev: false + /is-alphabetical@1.0.4: + resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} + dev: true + /is-alphabetical@2.0.1: resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + /is-alphanumerical@1.0.4: + resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} + dependencies: + is-alphabetical: 1.0.4 + is-decimal: 1.0.4 + dev: true + /is-alphanumerical@2.0.1: resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} dependencies: @@ -11034,6 +11216,10 @@ packages: has-tostringtag: 1.0.2 dev: true + /is-decimal@1.0.4: + resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} + dev: true + /is-decimal@2.0.1: resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} @@ -11043,6 +11229,10 @@ packages: hasBin: true dev: false + /is-empty@1.2.0: + resolution: {integrity: sha512-F2FnH/otLNJv0J6wc73A5Xo7oHLNnqplYqZhUu01tD54DIPvxIRSTSLkrUB/M0nHO4vo1O9PDfN4KoTxCzLh/w==} + dev: true + /is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -11080,6 +11270,10 @@ packages: dependencies: is-extglob: 2.1.1 + /is-hexadecimal@1.0.4: + resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} + dev: true + /is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} @@ -11992,6 +12186,16 @@ packages: engines: {node: '>=6'} hasBin: true + /jsonc-eslint-parser@2.4.0: + resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.11.3 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + semver: 7.6.2 + dev: true + /jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} @@ -12030,6 +12234,11 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + /kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + dev: true + /latest-version@7.0.0: resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} engines: {node: '>=14.16'} @@ -12107,6 +12316,13 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /load-plugin@6.0.3: + resolution: {integrity: sha512-kc0X2FEUZr145odl68frm+lMJuQ23+rTXYmR6TImqPtbpmXC4vVXbWKDQ9IzndA0HfyQamWfKLhzsqGSTxE63w==} + dependencies: + '@npmcli/config': 8.3.3 + import-meta-resolve: 4.1.0 + dev: true + /loader-runner@4.3.0: resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} engines: {node: '>=6.11.5'} @@ -12352,6 +12568,18 @@ packages: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 + /mdast-util-from-markdown@0.8.5: + resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} + dependencies: + '@types/mdast': 3.0.15 + mdast-util-to-string: 2.0.0 + micromark: 2.11.4 + parse-entities: 2.0.0 + unist-util-stringify-position: 2.0.3 + transitivePeerDependencies: + - supports-color + dev: true + /mdast-util-from-markdown@2.0.1: resolution: {integrity: sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==} dependencies: @@ -12531,6 +12759,10 @@ packages: unist-util-visit: 5.0.0 zwitch: 2.0.4 + /mdast-util-to-string@2.0.0: + resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + dev: true + /mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} dependencies: @@ -12896,6 +13128,15 @@ packages: /micromark-util-types@2.0.0: resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + /micromark@2.11.4: + resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} + dependencies: + debug: 4.3.5 + parse-entities: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /micromark@4.0.0: resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} dependencies: @@ -13133,6 +13374,11 @@ packages: yargs-unparser: 2.0.0 dev: true + /mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + dev: true + /mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -13788,6 +14034,17 @@ packages: callsites: 3.1.0 dev: false + /parse-entities@2.0.0: + resolution: {integrity: sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==} + dependencies: + character-entities: 1.2.4 + character-entities-legacy: 1.1.4 + character-reference-invalid: 1.1.4 + is-alphanumerical: 1.0.4 + is-decimal: 1.0.4 + is-hexadecimal: 1.0.4 + dev: true + /parse-entities@4.0.1: resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} dependencies: @@ -14785,6 +15042,14 @@ packages: dependencies: loose-envify: 1.4.0 + /read-package-json-fast@3.0.2: + resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + json-parse-even-better-errors: 3.0.2 + npm-normalize-package-bin: 3.0.1 + dev: true + /read-package-json@7.0.1: resolution: {integrity: sha512-8PcDiZ8DXUjLf687Ol4BR8Bpm2umR7vhoZOzNRt+uxD9GpBh/K+CAAALVIiYFknmvlmyg7hM7BSNUXPaCCqd0Q==} engines: {node: ^16.14.0 || >=18.0.0} @@ -15296,6 +15561,13 @@ packages: tslib: 2.6.3 dev: true + /sade@1.8.1: + resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} + engines: {node: '>=6'} + dependencies: + mri: 1.2.0 + dev: true + /safe-array-concat@1.1.2: resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} @@ -16103,13 +16375,19 @@ packages: picocolors: 1.0.1 dev: false + /synckit@0.6.2: + resolution: {integrity: sha512-Vhf+bUa//YSTYKseDiiEuQmhGCoIF3CVBhunm3r/DQnYiGT4JssmnKQc44BIyOZRK2pKjXXAgbhfmbeoC9CJpA==} + engines: {node: '>=12.20'} + dependencies: + tslib: 2.6.3 + dev: true + /synckit@0.9.0: resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==} engines: {node: ^14.18.0 || >=16.0.0} dependencies: '@pkgr/core': 0.1.1 tslib: 2.6.3 - dev: false /table@6.8.2: resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} @@ -16517,6 +16795,10 @@ packages: dependencies: is-typedarray: 1.0.0 + /typedarray@0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: true + /typedoc-plugin-markdown@4.0.3(typedoc@0.25.13): resolution: {integrity: sha512-0tZbeVGGCd4+lpoIX+yHWgUfyaLZCQCgJOpuVdTtOtD3+jKaedJ4sl/tkNaYBPeWVKiyDkSHfGuHkq53jlzIFg==} peerDependencies: @@ -16636,6 +16918,34 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} + /unified-engine@11.2.1: + resolution: {integrity: sha512-xBAdZ8UY2X4R9Hm6X6kMne4Nz0PlpOc1oE6DPeqJnewr5Imkb8uT5Eyvy1h7xNekPL3PSWh3ZJyNrMW6jnNQBg==} + dependencies: + '@types/concat-stream': 2.0.3 + '@types/debug': 4.1.12 + '@types/is-empty': 1.2.3 + '@types/node': 20.14.2 + '@types/unist': 3.0.2 + concat-stream: 2.0.0 + debug: 4.3.5 + extend: 3.0.2 + glob: 10.4.1 + ignore: 5.3.1 + is-empty: 1.2.0 + is-plain-obj: 4.1.0 + load-plugin: 6.0.3 + parse-json: 7.1.1 + trough: 2.2.0 + unist-util-inspect: 8.0.0 + vfile: 6.0.1 + vfile-message: 4.0.2 + vfile-reporter: 8.1.1 + vfile-statistics: 3.0.0 + yaml: 2.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /unified@11.0.4: resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==} dependencies: @@ -16674,6 +16984,12 @@ packages: dependencies: crypto-random-string: 4.0.0 + /unist-util-inspect@8.0.0: + resolution: {integrity: sha512-/3Wn/wU6/H6UEo4FoYUeo8KUePN8ERiZpQYFWYoihOsr1DoDuv80PeB0hobVZyYSvALa2e556bG1A1/AbwU4yg==} + dependencies: + '@types/unist': 3.0.2 + dev: true + /unist-util-is@6.0.0: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} dependencies: @@ -16703,6 +17019,12 @@ packages: unist-util-visit-parents: 6.0.1 dev: true + /unist-util-stringify-position@2.0.3: + resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + dependencies: + '@types/unist': 2.0.10 + dev: true + /unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} dependencies: @@ -16810,6 +17132,17 @@ packages: hasBin: true dev: true + /uvu@0.5.6: + resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + dequal: 2.0.3 + diff: 5.0.0 + kleur: 4.1.5 + sade: 1.8.1 + dev: true + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true @@ -17022,6 +17355,10 @@ packages: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} dev: false + /walk-up-path@3.0.1: + resolution: {integrity: sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==} + dev: true + /walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} dependencies: @@ -17506,6 +17843,15 @@ packages: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + /yaml-eslint-parser@1.2.3: + resolution: {integrity: sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==} + engines: {node: ^14.17.0 || >=16.0.0} + dependencies: + eslint-visitor-keys: 3.4.3 + lodash: 4.17.21 + yaml: 2.4.5 + dev: true + /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} @@ -17515,7 +17861,6 @@ packages: resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} hasBin: true - dev: false /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} diff --git a/website/docs/Configuration/auto_properties.md b/website/docs/Configuration/auto_properties.md index 563e89460eae..9036e9c1f155 100644 --- a/website/docs/Configuration/auto_properties.md +++ b/website/docs/Configuration/auto_properties.md @@ -9,73 +9,68 @@ format: md # CSpell Configuration - - ## Settings -| Field | Type | Description | -| --- | --- | --- | -| [$schema](#settings--schema) | `string` | Url to JSON Schema | -| [allowCompoundWords](#settings-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | -| [cache](#settings-cache) | [`CacheSettings`](#cachesettings) | Define cache settings. | -| [caseSensitive](#settings-casesensitive) | `boolean` | Determines if words must match case and accent rules. | -| [description](#settings-description) | `string` | Optional description of configuration. | -| [dictionaries](#settings-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | -| [dictionaryDefinitions](#settings-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | -| [enableFiletypes](#settings-enablefiletypes) | [`LanguageIdSingle`](#languageidsingle)`[]` | Enable / Disable checking file types (languageIds). | -| [enableGlobDot](#settings-enableglobdot) | `boolean` | Enable scanning files and directories beginning with `.` (period). | -| [enabled](#settings-enabled) | `boolean` | Is the spell checker enabled. | -| [enabledFileTypes](#settings-enabledfiletypes) | `object` | Enable / Disable checking file types (languageIds). | -| [enabledLanguageIds](#settings-enabledlanguageids) | [`LanguageIdSingle`](#languageidsingle)`[]` | Specify a list of file types to spell check. It is better to use [Settings.enabledFileTypes](#settings-enabledfiletypes) to Enable / Disable checking files types. | -| [failFast](#settings-failfast) | `boolean` | Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks) | -| [features](#settings-features) | [`Features`](#features) | Configure CSpell features. | -| [files](#settings-files) | [`Glob`](#glob)`[]` | Glob patterns of files to be checked. | -| [flagWords](#settings-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [gitignoreRoot](#settings-gitignoreroot) | [`FsPath`](#fspath)
[`FsPath`](#fspath)`[]` | Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root. | -| [globRoot](#settings-globroot) | [`FSPathResolvable`](#fspathresolvable) | The root to use for glob patterns found in this configuration. | -| [id](#settings-id) | `string` | Optional identifier. | -| [ignorePaths](#settings-ignorepaths) | [`Glob`](#glob)`[]` | Glob patterns of files to be ignored. | -| [ignoreRegExpList](#settings-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | -| [ignoreWords](#settings-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [import](#settings-import) | [`FsPath`](#fspath)
[`FsPath`](#fspath)`[]` | Allows this configuration to inherit configuration for one or more other files. | -| [includeRegExpList](#settings-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | -| [language](#settings-language) | [`LocaleId`](#localeid) | Current active spelling language. This specifies the language locale to use in choosing the | -| [languageId](#settings-languageid) | [`MatchingFileType`](#matchingfiletype) | Forces the spell checker to assume a give language id. Used mainly as an Override. | -| [languageSettings](#settings-languagesettings) | [`LanguageSetting`](#languagesetting)`[]` | Additional settings for individual languages. | -| [loadDefaultConfiguration](#settings-loaddefaultconfiguration) | `boolean` | By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false` | -| [maxDuplicateProblems](#settings-maxduplicateproblems) | `number` | The maximum number of times the same word can be flagged as an error in a file. | -| [maxNumberOfProblems](#settings-maxnumberofproblems) | `number` | The maximum number of problems to report in a file. | -| [minWordLength](#settings-minwordlength) | `number` | The minimum length of a word before checking it against a dictionary. | -| [name](#settings-name) | `string` | Optional name of configuration. | -| [noConfigSearch](#settings-noconfigsearch) | `boolean` | Prevents searching for local configuration when checking individual documents. | -| [noSuggestDictionaries](#settings-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | -| [numSuggestions](#settings-numsuggestions) | `number` | Number of suggestions to make. | -| [overrides](#settings-overrides) | [`OverrideSettings`](#overridesettings)`[]` | Overrides are used to apply settings for specific files in your project. | -| [patterns](#settings-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | -| [pnpFiles](#settings-pnpfiles) | `string``[]` | The PnP files to search for. Note: `.mjs` files are not currently supported. | -| [readonly](#settings-readonly) | `boolean` | Indicate that the configuration file should not be modified. | -| [reporters](#settings-reporters) | [`ReporterSettings`](#reportersettings)`[]` | Define which reports to use. | -| [showStatus](#settings-showstatus) | `boolean` | Show status. | -| [spellCheckDelayMs](#settings-spellcheckdelayms) | `number` | Delay in ms after a document has changed before checking it for spelling errors. | -| [suggestWords](#settings-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [suggestionNumChanges](#settings-suggestionnumchanges) | `number` | The maximum number of changes allowed on a word to be considered a suggestions. | -| [suggestionsTimeout](#settings-suggestionstimeout) | `number` | The maximum amount of time in milliseconds to generate suggestions for a word. | -| [useGitignore](#settings-usegitignore) | `boolean` | Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found. | -| [usePnP](#settings-usepnp) | `boolean` | Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading | -| [userWords](#settings-userwords) | `string``[]` | Words to add to global dictionary -- should only be in the user config file. | -| [validateDirectives](#settings-validatedirectives) | `boolean` | Verify that the in-document directives are correct. | -| [version](#settings-version) | [`Version`](#version) | Configuration format version of the settings file. | -| [words](#settings-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| -------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [$schema](#settings--schema) | `string` | Url to JSON Schema | +| [allowCompoundWords](#settings-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | +| [cache](#settings-cache) | [`CacheSettings`](#cachesettings) | Define cache settings. | +| [caseSensitive](#settings-casesensitive) | `boolean` | Determines if words must match case and accent rules. | +| [description](#settings-description) | `string` | Optional description of configuration. | +| [dictionaries](#settings-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | +| [dictionaryDefinitions](#settings-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | +| [enableFiletypes](#settings-enablefiletypes) | [`LanguageIdSingle`](#languageidsingle)`[]` | Enable / Disable checking file types (languageIds). | +| [enableGlobDot](#settings-enableglobdot) | `boolean` | Enable scanning files and directories beginning with `.` (period). | +| [enabled](#settings-enabled) | `boolean` | Is the spell checker enabled. | +| [enabledFileTypes](#settings-enabledfiletypes) | `object` | Enable / Disable checking file types (languageIds). | +| [enabledLanguageIds](#settings-enabledlanguageids) | [`LanguageIdSingle`](#languageidsingle)`[]` | Specify a list of file types to spell check. It is better to use [Settings.enabledFileTypes](#settings-enabledfiletypes) to Enable / Disable checking files types. | +| [failFast](#settings-failfast) | `boolean` | Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks) | +| [features](#settings-features) | [`Features`](#features) | Configure CSpell features. | +| [files](#settings-files) | [`Glob`](#glob)`[]` | Glob patterns of files to be checked. | +| [flagWords](#settings-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [gitignoreRoot](#settings-gitignoreroot) | [`FsPath`](#fspath)
[`FsPath`](#fspath)`[]` | Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root. | +| [globRoot](#settings-globroot) | [`FSPathResolvable`](#fspathresolvable) | The root to use for glob patterns found in this configuration. | +| [id](#settings-id) | `string` | Optional identifier. | +| [ignorePaths](#settings-ignorepaths) | [`Glob`](#glob)`[]` | Glob patterns of files to be ignored. | +| [ignoreRegExpList](#settings-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | +| [ignoreWords](#settings-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [import](#settings-import) | [`FsPath`](#fspath)
[`FsPath`](#fspath)`[]` | Allows this configuration to inherit configuration for one or more other files. | +| [includeRegExpList](#settings-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | +| [language](#settings-language) | [`LocaleId`](#localeid) | Current active spelling language. This specifies the language locale to use in choosing the | +| [languageId](#settings-languageid) | [`MatchingFileType`](#matchingfiletype) | Forces the spell checker to assume a give language id. Used mainly as an Override. | +| [languageSettings](#settings-languagesettings) | [`LanguageSetting`](#languagesetting)`[]` | Additional settings for individual languages. | +| [loadDefaultConfiguration](#settings-loaddefaultconfiguration) | `boolean` | By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false` | +| [maxDuplicateProblems](#settings-maxduplicateproblems) | `number` | The maximum number of times the same word can be flagged as an error in a file. | +| [maxNumberOfProblems](#settings-maxnumberofproblems) | `number` | The maximum number of problems to report in a file. | +| [minWordLength](#settings-minwordlength) | `number` | The minimum length of a word before checking it against a dictionary. | +| [name](#settings-name) | `string` | Optional name of configuration. | +| [noConfigSearch](#settings-noconfigsearch) | `boolean` | Prevents searching for local configuration when checking individual documents. | +| [noSuggestDictionaries](#settings-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | +| [numSuggestions](#settings-numsuggestions) | `number` | Number of suggestions to make. | +| [overrides](#settings-overrides) | [`OverrideSettings`](#overridesettings)`[]` | Overrides are used to apply settings for specific files in your project. | +| [patterns](#settings-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | +| [pnpFiles](#settings-pnpfiles) | `string``[]` | The PnP files to search for. Note: `.mjs` files are not currently supported. | +| [readonly](#settings-readonly) | `boolean` | Indicate that the configuration file should not be modified. | +| [reporters](#settings-reporters) | [`ReporterSettings`](#reportersettings)`[]` | Define which reports to use. | +| [showStatus](#settings-showstatus) | `boolean` | Show status. | +| [spellCheckDelayMs](#settings-spellcheckdelayms) | `number` | Delay in ms after a document has changed before checking it for spelling errors. | +| [suggestWords](#settings-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [suggestionNumChanges](#settings-suggestionnumchanges) | `number` | The maximum number of changes allowed on a word to be considered a suggestions. | +| [suggestionsTimeout](#settings-suggestionstimeout) | `number` | The maximum amount of time in milliseconds to generate suggestions for a word. | +| [useGitignore](#settings-usegitignore) | `boolean` | Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found. | +| [usePnP](#settings-usepnp) | `boolean` | Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading | +| [userWords](#settings-userwords) | `string``[]` | Words to add to global dictionary -- should only be in the user config file. | +| [validateDirectives](#settings-validatedirectives) | `boolean` | Verify that the in-document directives are correct. | +| [version](#settings-version) | [`Version`](#version) | Configuration format version of the settings file. | +| [words](#settings-words) | `string``[]` | List of words to be considered correct. | ### Settings Fields - --- #### `$schema` {#settings--schema} -
Description
@@ -89,14 +84,10 @@ format: md
- - - --- #### `allowCompoundWords` {#settings-allowcompoundwords} -
Description
@@ -110,14 +101,10 @@ format: md
- - - --- #### `cache` {#settings-cache} -
Description
@@ -131,14 +118,10 @@ format: md
- - - --- #### `caseSensitive` {#settings-casesensitive} -
Description
@@ -156,14 +139,10 @@ format: md
- - - --- #### `description` {#settings-description} -
Description
@@ -177,14 +156,10 @@ format: md
- - - --- #### `dictionaries` {#settings-dictionaries} -
Description
@@ -205,14 +180,10 @@ format: md
- - - --- #### `dictionaryDefinitions` {#settings-dictionarydefinitions} -
Description
@@ -235,14 +206,10 @@ format: md
- - - --- #### `enableFiletypes` {#settings-enablefiletypes} -
Description
@@ -275,14 +242,10 @@ format: md
- - - --- #### `enableGlobDot` {#settings-enableglobdot} -
Description
@@ -298,14 +261,10 @@ format: md
- - - --- #### `enabled` {#settings-enabled} -
Description
@@ -319,14 +278,10 @@ format: md
- - - --- #### `enabledFileTypes` {#settings-enabledfiletypes} -
Description
@@ -355,14 +310,10 @@ format: md
- - - --- #### `enabledLanguageIds` {#settings-enabledlanguageids} -
Description
@@ -376,14 +327,10 @@ format: md
- - - --- #### `failFast` {#settings-failfast} -
Description
@@ -397,14 +344,10 @@ format: md
- - - --- #### `features` {#settings-features} -
Description
@@ -418,14 +361,10 @@ format: md
- - - --- #### `files` {#settings-files} -
Description
@@ -441,14 +380,10 @@ format: md
- - - --- #### `flagWords` {#settings-flagwords} -
Description
@@ -476,14 +411,10 @@ format: md
- - - --- #### `gitignoreRoot` {#settings-gitignoreroot} -
Description
@@ -497,14 +428,10 @@ format: md
- - - --- #### `globRoot` {#settings-globroot} -
Description
@@ -529,14 +456,10 @@ format: md
- - - --- #### `id` {#settings-id} -
Description
@@ -550,14 +473,10 @@ format: md
- - - --- #### `ignorePaths` {#settings-ignorepaths} -
Description
@@ -573,14 +492,10 @@ format: md
- - - --- #### `ignoreRegExpList` {#settings-ignoreregexplist} -
Description
@@ -618,14 +533,10 @@ format: md
- - - --- #### `ignoreWords` {#settings-ignorewords} -
Description
@@ -640,14 +551,10 @@ format: md
- - - --- #### `import` {#settings-import} -
Description
@@ -663,14 +570,10 @@ format: md
- - - --- #### `includeRegExpList` {#settings-includeregexplist} -
Description
@@ -689,14 +592,10 @@ format: md
- - - --- #### `language` {#settings-language} -
Description
@@ -716,14 +615,10 @@ format: md
- - - --- #### `languageId` {#settings-languageid} -
Description
@@ -737,14 +632,10 @@ format: md
- - - --- #### `languageSettings` {#settings-languagesettings} -
Description
@@ -760,14 +651,10 @@ format: md
- - - --- #### `loadDefaultConfiguration` {#settings-loaddefaultconfiguration} -
Description
@@ -782,14 +669,10 @@ format: md
- - - --- #### `maxDuplicateProblems` {#settings-maxduplicateproblems} -
Description
@@ -803,14 +686,10 @@ format: md
- - - --- #### `maxNumberOfProblems` {#settings-maxnumberofproblems} -
Description
@@ -824,14 +703,10 @@ format: md
- - - --- #### `minWordLength` {#settings-minwordlength} -
Description
@@ -845,14 +720,10 @@ format: md
- - - --- #### `name` {#settings-name} -
Description
@@ -866,14 +737,10 @@ format: md
- - - --- #### `noConfigSearch` {#settings-noconfigsearch} -
Description
@@ -887,14 +754,10 @@ format: md
- - - --- #### `noSuggestDictionaries` {#settings-nosuggestdictionaries} -
Description
@@ -914,14 +777,10 @@ format: md
- - - --- #### `numSuggestions` {#settings-numsuggestions} -
Description
@@ -935,14 +794,10 @@ format: md
- - - --- #### `overrides` {#settings-overrides} -
Description
@@ -973,14 +828,10 @@ format: md
- - - --- #### `patterns` {#settings-patterns} -
Description
@@ -1018,14 +869,10 @@ format: md
- - - --- #### `pnpFiles` {#settings-pnpfiles} -
Description
@@ -1039,14 +886,10 @@ format: md
- - - --- #### `readonly` {#settings-readonly} -
Description
@@ -1062,14 +905,10 @@ format: md
- - - --- #### `reporters` {#settings-reporters} -
Description
@@ -1090,14 +929,10 @@ format: md
- - - --- #### `showStatus` {#settings-showstatus} -
Description
@@ -1111,14 +946,10 @@ format: md
- - - --- #### `spellCheckDelayMs` {#settings-spellcheckdelayms} -
Description
@@ -1132,14 +963,10 @@ format: md
- - - --- #### `suggestWords` {#settings-suggestwords} -
Description
@@ -1163,14 +990,10 @@ format: md
- - - --- #### `suggestionNumChanges` {#settings-suggestionnumchanges} -
Description
@@ -1188,14 +1011,10 @@ format: md
- - - --- #### `suggestionsTimeout` {#settings-suggestionstimeout} -
Description
@@ -1209,14 +1028,10 @@ format: md
- - - --- #### `useGitignore` {#settings-usegitignore} -
Description
@@ -1230,14 +1045,10 @@ format: md
- - - --- #### `usePnP` {#settings-usepnp} -
Description
@@ -1255,14 +1066,10 @@ format: md
- - - --- #### `userWords` {#settings-userwords} -
Description
@@ -1276,14 +1083,10 @@ format: md
- - - --- #### `validateDirectives` {#settings-validatedirectives} -
Description
@@ -1297,14 +1100,10 @@ format: md
- - - --- #### `version` {#settings-version} -
Description
@@ -1320,14 +1119,10 @@ format: md
- - - --- #### `words` {#settings-words} -
Description
@@ -1341,15 +1136,10 @@ format: md
- - - - --- ## CacheFormat {#cacheformat} -
Type
@@ -1358,26 +1148,21 @@ format: md
- - ## CacheSettings -| Field | Type | Description | -| --- | --- | --- | -| [cacheFormat](#cachesettings-cacheformat) | [`CacheFormat`](#cacheformat) | Format of the cache file. | -| [cacheLocation](#cachesettings-cachelocation) | [`FSPathResolvable`](#fspathresolvable) | Path to the cache location. Can be a file or a directory. | -| [cacheStrategy](#cachesettings-cachestrategy) | [`CacheStrategy`](#cachestrategy) | Strategy to use for detecting changed files, default: metadata | -| [useCache](#cachesettings-usecache) | `boolean` | Store the results of processed files in order to only operate on the changed ones. | - +| Field | Type | Description | +| --------------------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------------- | +| [cacheFormat](#cachesettings-cacheformat) | [`CacheFormat`](#cacheformat) | Format of the cache file. | +| [cacheLocation](#cachesettings-cachelocation) | [`FSPathResolvable`](#fspathresolvable) | Path to the cache location. Can be a file or a directory. | +| [cacheStrategy](#cachesettings-cachestrategy) | [`CacheStrategy`](#cachestrategy) | Strategy to use for detecting changed files, default: metadata | +| [useCache](#cachesettings-usecache) | `boolean` | Store the results of processed files in order to only operate on the changed ones. | ### CacheSettings Fields - --- #### `cacheFormat` {#cachesettings-cacheformat} -
Description
@@ -1393,14 +1178,10 @@ format: md
- - - --- #### `cacheLocation` {#cachesettings-cachelocation} -
Description
@@ -1419,14 +1200,10 @@ format: md
- - - --- #### `cacheStrategy` {#cachesettings-cachestrategy} -
Description
@@ -1440,14 +1217,10 @@ format: md
- - - --- #### `useCache` {#cachesettings-usecache} -
Description
@@ -1461,15 +1234,10 @@ format: md
- - - - --- ## CacheStrategy {#cachestrategy} -
Description
@@ -1485,15 +1253,10 @@ format: md
- - - - --- ## CharacterSet {#characterset} -
Description
@@ -1510,25 +1273,20 @@ format: md
- - ## CharacterSetCosts -| Field | Type | Description | -| --- | --- | --- | -| [characters](#charactersetcosts-characters) | [`CharacterSet`](#characterset) | This is a set of characters that can include `-` or `|` | -| [cost](#charactersetcosts-cost) | `number` | the cost to insert / delete / replace / swap the characters in a group | -| [penalty](#charactersetcosts-penalty) | `number` | The penalty cost to apply if the accent is used. | - +| Field | Type | Description | +| ------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------- | --- | +| [characters](#charactersetcosts-characters) | [`CharacterSet`](#characterset) | This is a set of characters that can include `-` or ` | ` | +| [cost](#charactersetcosts-cost) | `number` | the cost to insert / delete / replace / swap the characters in a group | +| [penalty](#charactersetcosts-penalty) | `number` | The penalty cost to apply if the accent is used. | ### CharacterSetCosts Fields - --- #### `characters` {#charactersetcosts-characters} -
Description
@@ -1545,14 +1303,10 @@ format: md
- - - --- #### `cost` {#charactersetcosts-cost} -
Description
@@ -1566,14 +1320,10 @@ format: md
- - - --- #### `penalty` {#charactersetcosts-penalty} -
Description
@@ -1588,28 +1338,23 @@ format: md
- - ## CostMapDefInsDel -| Field | Type | Description | -| --- | --- | --- | -| [description](#costmapdefinsdel-description) | `string` | A description to describe the purpose of the map. | -| [insDel](#costmapdefinsdel-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | -| [map](#costmapdefinsdel-map) | `string` | The set of substrings to map, these are generally single character strings. | -| [penalty](#costmapdefinsdel-penalty) | `number` | Add a penalty to the final cost. | -| [replace](#costmapdefinsdel-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | -| [swap](#costmapdefinsdel-swap) | `number` | The cost to swap two adjacent substrings found in the map. | - +| Field | Type | Description | +| -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | +| [description](#costmapdefinsdel-description) | `string` | A description to describe the purpose of the map. | +| [insDel](#costmapdefinsdel-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | +| [map](#costmapdefinsdel-map) | `string` | The set of substrings to map, these are generally single character strings. | +| [penalty](#costmapdefinsdel-penalty) | `number` | Add a penalty to the final cost. | +| [replace](#costmapdefinsdel-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | +| [swap](#costmapdefinsdel-swap) | `number` | The cost to swap two adjacent substrings found in the map. | ### CostMapDefInsDel Fields - --- #### `description` {#costmapdefinsdel-description} -
Description
@@ -1623,14 +1368,10 @@ format: md
- - - ---- +--- #### `insDel` {#costmapdefinsdel-insdel} -
Description
@@ -1644,14 +1385,10 @@ format: md
- - - --- #### `map` {#costmapdefinsdel-map} -
Description
@@ -1676,14 +1413,10 @@ format: md
- - - --- #### `penalty` {#costmapdefinsdel-penalty} -
Description
@@ -1710,14 +1443,10 @@ format: md
- - - --- #### `replace` {#costmapdefinsdel-replace} -
Description
@@ -1733,14 +1462,10 @@ format: md
- - - --- #### `swap` {#costmapdefinsdel-swap} -
Description
@@ -1756,28 +1481,23 @@ format: md
- - ## CostMapDefReplace -| Field | Type | Description | -| --- | --- | --- | -| [description](#costmapdefreplace-description) | `string` | A description to describe the purpose of the map. | -| [insDel](#costmapdefreplace-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | -| [map](#costmapdefreplace-map) | `string` | The set of substrings to map, these are generally single character strings. | -| [penalty](#costmapdefreplace-penalty) | `number` | Add a penalty to the final cost. | -| [replace](#costmapdefreplace-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | -| [swap](#costmapdefreplace-swap) | `number` | The cost to swap two adjacent substrings found in the map. | - +| Field | Type | Description | +| --------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | +| [description](#costmapdefreplace-description) | `string` | A description to describe the purpose of the map. | +| [insDel](#costmapdefreplace-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | +| [map](#costmapdefreplace-map) | `string` | The set of substrings to map, these are generally single character strings. | +| [penalty](#costmapdefreplace-penalty) | `number` | Add a penalty to the final cost. | +| [replace](#costmapdefreplace-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | +| [swap](#costmapdefreplace-swap) | `number` | The cost to swap two adjacent substrings found in the map. | ### CostMapDefReplace Fields - --- #### `description` {#costmapdefreplace-description} -
Description
@@ -1791,14 +1511,10 @@ format: md
- - - --- #### `insDel` {#costmapdefreplace-insdel} -
Description
@@ -1812,14 +1528,10 @@ format: md
- - - --- #### `map` {#costmapdefreplace-map} -
Description
@@ -1844,14 +1556,10 @@ format: md
- - - --- #### `penalty` {#costmapdefreplace-penalty} -
Description
@@ -1878,14 +1586,10 @@ format: md
- - - --- #### `replace` {#costmapdefreplace-replace} -
Description
@@ -1901,14 +1605,10 @@ format: md
- - - --- #### `swap` {#costmapdefreplace-swap} -
Description
@@ -1924,28 +1624,23 @@ format: md
- - ## CostMapDefSwap -| Field | Type | Description | -| --- | --- | --- | -| [description](#costmapdefswap-description) | `string` | A description to describe the purpose of the map. | -| [insDel](#costmapdefswap-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | -| [map](#costmapdefswap-map) | `string` | The set of substrings to map, these are generally single character strings. | -| [penalty](#costmapdefswap-penalty) | `number` | Add a penalty to the final cost. | -| [replace](#costmapdefswap-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | -| [swap](#costmapdefswap-swap) | `number` | The cost to swap two adjacent substrings found in the map. | - +| Field | Type | Description | +| ------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------ | +| [description](#costmapdefswap-description) | `string` | A description to describe the purpose of the map. | +| [insDel](#costmapdefswap-insdel) | `number` | The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. | +| [map](#costmapdefswap-map) | `string` | The set of substrings to map, these are generally single character strings. | +| [penalty](#costmapdefswap-penalty) | `number` | Add a penalty to the final cost. | +| [replace](#costmapdefswap-replace) | `number` | The cost to replace of of the substrings in the map with another substring in the map. | +| [swap](#costmapdefswap-swap) | `number` | The cost to swap two adjacent substrings found in the map. | ### CostMapDefSwap Fields - --- #### `description` {#costmapdefswap-description} -
Description
@@ -1959,14 +1654,10 @@ format: md
- - - --- #### `insDel` {#costmapdefswap-insdel} -
Description
@@ -1980,14 +1671,10 @@ format: md
- - - --- #### `map` {#costmapdefswap-map} -
Description
@@ -2012,14 +1699,10 @@ format: md
- - - --- #### `penalty` {#costmapdefswap-penalty} -
Description
@@ -2046,14 +1729,10 @@ format: md
- - - --- #### `replace` {#costmapdefswap-replace} -
Description
@@ -2069,14 +1748,10 @@ format: md
- - - --- #### `swap` {#costmapdefswap-swap} -
Description
@@ -2092,15 +1767,10 @@ format: md
- - - - --- ## CustomDictionaryPath {#customdictionarypath} -
Description
@@ -2114,15 +1784,10 @@ format: md
- - - - --- ## CustomDictionaryScope {#customdictionaryscope} -
Description
@@ -2136,15 +1801,10 @@ format: md
- - - - --- ## DictionaryDefinition {#dictionarydefinition} -
Type
@@ -2153,29 +1813,24 @@ format: md
- - ## DictionaryDefinitionAlternate -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitionalternate-description) | `string` | Optional description. | -| [file](#dictionarydefinitionalternate-file) | [`DictionaryPath`](#dictionarypath) | Path to the file, only for legacy dictionary definitions. | -| [name](#dictionarydefinitionalternate-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitionalternate-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [repMap](#dictionarydefinitionalternate-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [type](#dictionarydefinitionalternate-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitionalternate-usecompounds) | `boolean` | Use Compounds. | - +| Field | Type | Description | +| ----------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------- | +| [description](#dictionarydefinitionalternate-description) | `string` | Optional description. | +| [file](#dictionarydefinitionalternate-file) | [`DictionaryPath`](#dictionarypath) | Path to the file, only for legacy dictionary definitions. | +| [name](#dictionarydefinitionalternate-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitionalternate-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [repMap](#dictionarydefinitionalternate-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [type](#dictionarydefinitionalternate-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitionalternate-usecompounds) | `boolean` | Use Compounds. | ### DictionaryDefinitionAlternate Fields - --- #### `description` {#dictionarydefinitionalternate-description} -
Description
@@ -2189,14 +1844,10 @@ format: md
- - - --- #### `file` {#dictionarydefinitionalternate-file} -
Description
@@ -2210,14 +1861,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitionalternate-name} -
Description
@@ -2238,14 +1885,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitionalternate-nosuggest} -
Description
@@ -2265,14 +1908,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitionalternate-repmap} -
Description
@@ -2286,14 +1925,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitionalternate-type} -
Description
@@ -2314,14 +1949,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitionalternate-usecompounds} -
Description
@@ -2335,30 +1966,25 @@ format: md
- - ## DictionaryDefinitionAugmented -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitionaugmented-description) | `string` | Optional description. | -| [dictionaryInformation](#dictionarydefinitionaugmented-dictionaryinformation) | [`DictionaryInformation`](#dictionaryinformation) | | -| [name](#dictionarydefinitionaugmented-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitionaugmented-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [path](#dictionarydefinitionaugmented-path) | [`DictionaryPath`](#dictionarypath) | Path to the file. | -| [repMap](#dictionarydefinitionaugmented-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [type](#dictionarydefinitionaugmented-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitionaugmented-usecompounds) | `boolean` | Use Compounds. | - +| Field | Type | Description | +| ----------------------------------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------- | +| [description](#dictionarydefinitionaugmented-description) | `string` | Optional description. | +| [dictionaryInformation](#dictionarydefinitionaugmented-dictionaryinformation) | [`DictionaryInformation`](#dictionaryinformation) | | +| [name](#dictionarydefinitionaugmented-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitionaugmented-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [path](#dictionarydefinitionaugmented-path) | [`DictionaryPath`](#dictionarypath) | Path to the file. | +| [repMap](#dictionarydefinitionaugmented-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [type](#dictionarydefinitionaugmented-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitionaugmented-usecompounds) | `boolean` | Use Compounds. | ### DictionaryDefinitionAugmented Fields - --- #### `description` {#dictionarydefinitionaugmented-description} -
Description
@@ -2372,14 +1998,10 @@ format: md
- - - --- #### `dictionaryInformation` {#dictionarydefinitionaugmented-dictionaryinformation} -
Type
@@ -2388,14 +2010,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitionaugmented-name} -
Description
@@ -2416,14 +2034,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitionaugmented-nosuggest} -
Description
@@ -2443,14 +2057,10 @@ format: md
- - - --- #### `path` {#dictionarydefinitionaugmented-path} -
Description
@@ -2464,14 +2074,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitionaugmented-repmap} -
Description
@@ -2485,14 +2091,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitionaugmented-type} -
Description
@@ -2513,14 +2115,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitionaugmented-usecompounds} -
Description
@@ -2534,31 +2132,26 @@ format: md
- - ## DictionaryDefinitionCustom -| Field | Type | Description | -| --- | --- | --- | -| [addWords](#dictionarydefinitioncustom-addwords) | `boolean` | When `true`, let's the spell checker know that words can be added to this dictionary. | -| [description](#dictionarydefinitioncustom-description) | `string` | Optional description. | -| [name](#dictionarydefinitioncustom-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitioncustom-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [path](#dictionarydefinitioncustom-path) | [`CustomDictionaryPath`](#customdictionarypath) | Path to custom dictionary text file. | -| [repMap](#dictionarydefinitioncustom-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [scope](#dictionarydefinitioncustom-scope) | [`CustomDictionaryScope`](#customdictionaryscope)
[`CustomDictionaryScope`](#customdictionaryscope)`[]` | Defines the scope for when words will be added to the dictionary. | -| [type](#dictionarydefinitioncustom-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitioncustom-usecompounds) | `boolean` | Use Compounds. | - +| Field | Type | Description | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | +| [addWords](#dictionarydefinitioncustom-addwords) | `boolean` | When `true`, let's the spell checker know that words can be added to this dictionary. | +| [description](#dictionarydefinitioncustom-description) | `string` | Optional description. | +| [name](#dictionarydefinitioncustom-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitioncustom-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [path](#dictionarydefinitioncustom-path) | [`CustomDictionaryPath`](#customdictionarypath) | Path to custom dictionary text file. | +| [repMap](#dictionarydefinitioncustom-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [scope](#dictionarydefinitioncustom-scope) | [`CustomDictionaryScope`](#customdictionaryscope)
[`CustomDictionaryScope`](#customdictionaryscope)`[]` | Defines the scope for when words will be added to the dictionary. | +| [type](#dictionarydefinitioncustom-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitioncustom-usecompounds) | `boolean` | Use Compounds. | ### DictionaryDefinitionCustom Fields - --- #### `addWords` {#dictionarydefinitioncustom-addwords} -
Description
@@ -2572,14 +2165,10 @@ format: md
- - - --- #### `description` {#dictionarydefinitioncustom-description} -
Description
@@ -2593,14 +2182,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitioncustom-name} -
Description
@@ -2621,14 +2206,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitioncustom-nosuggest} -
Description
@@ -2648,14 +2229,10 @@ format: md
- - - --- #### `path` {#dictionarydefinitioncustom-path} -
Description
@@ -2669,14 +2246,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitioncustom-repmap} -
Description
@@ -2690,14 +2263,10 @@ format: md
- - - --- #### `scope` {#dictionarydefinitioncustom-scope} -
Description
@@ -2713,14 +2282,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitioncustom-type} -
Description
@@ -2741,14 +2306,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitioncustom-usecompounds} -
Description
@@ -2762,15 +2323,10 @@ format: md
- - - - --- ## DictionaryDefinitionInline {#dictionarydefinitioninline} -
Description
@@ -2784,32 +2340,27 @@ format: md
- - ## DictionaryDefinitionInlineFlagWords -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitioninlineflagwords-description) | `string` | Optional description. | -| [flagWords](#dictionarydefinitioninlineflagwords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [ignoreWords](#dictionarydefinitioninlineflagwords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [name](#dictionarydefinitioninlineflagwords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitioninlineflagwords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [repMap](#dictionarydefinitioninlineflagwords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [suggestWords](#dictionarydefinitioninlineflagwords-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [type](#dictionarydefinitioninlineflagwords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitioninlineflagwords-usecompounds) | `boolean` | Use Compounds. | -| [words](#dictionarydefinitioninlineflagwords-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| ----------------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------- | +| [description](#dictionarydefinitioninlineflagwords-description) | `string` | Optional description. | +| [flagWords](#dictionarydefinitioninlineflagwords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [ignoreWords](#dictionarydefinitioninlineflagwords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [name](#dictionarydefinitioninlineflagwords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitioninlineflagwords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [repMap](#dictionarydefinitioninlineflagwords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [suggestWords](#dictionarydefinitioninlineflagwords-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [type](#dictionarydefinitioninlineflagwords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitioninlineflagwords-usecompounds) | `boolean` | Use Compounds. | +| [words](#dictionarydefinitioninlineflagwords-words) | `string``[]` | List of words to be considered correct. | ### DictionaryDefinitionInlineFlagWords Fields - --- #### `description` {#dictionarydefinitioninlineflagwords-description} -
Description
@@ -2823,14 +2374,10 @@ format: md
- - - --- #### `flagWords` {#dictionarydefinitioninlineflagwords-flagwords} -
Description
@@ -2858,14 +2405,10 @@ format: md
- - - --- #### `ignoreWords` {#dictionarydefinitioninlineflagwords-ignorewords} -
Description
@@ -2880,14 +2423,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitioninlineflagwords-name} -
Description
@@ -2908,14 +2447,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitioninlineflagwords-nosuggest} -
Description
@@ -2935,14 +2470,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitioninlineflagwords-repmap} -
Description
@@ -2956,14 +2487,10 @@ format: md
- - - --- #### `suggestWords` {#dictionarydefinitioninlineflagwords-suggestwords} -
Description
@@ -2987,14 +2514,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitioninlineflagwords-type} -
Description
@@ -3015,14 +2538,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitioninlineflagwords-usecompounds} -
Description
@@ -3036,14 +2555,10 @@ format: md
- - - --- #### `words` {#dictionarydefinitioninlineflagwords-words} -
Description
@@ -3057,32 +2572,27 @@ format: md
- - ## DictionaryDefinitionInlineIgnoreWords -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitioninlineignorewords-description) | `string` | Optional description. | -| [flagWords](#dictionarydefinitioninlineignorewords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [ignoreWords](#dictionarydefinitioninlineignorewords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [name](#dictionarydefinitioninlineignorewords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitioninlineignorewords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [repMap](#dictionarydefinitioninlineignorewords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [suggestWords](#dictionarydefinitioninlineignorewords-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [type](#dictionarydefinitioninlineignorewords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitioninlineignorewords-usecompounds) | `boolean` | Use Compounds. | -| [words](#dictionarydefinitioninlineignorewords-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| ------------------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------- | +| [description](#dictionarydefinitioninlineignorewords-description) | `string` | Optional description. | +| [flagWords](#dictionarydefinitioninlineignorewords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [ignoreWords](#dictionarydefinitioninlineignorewords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [name](#dictionarydefinitioninlineignorewords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitioninlineignorewords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [repMap](#dictionarydefinitioninlineignorewords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [suggestWords](#dictionarydefinitioninlineignorewords-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [type](#dictionarydefinitioninlineignorewords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitioninlineignorewords-usecompounds) | `boolean` | Use Compounds. | +| [words](#dictionarydefinitioninlineignorewords-words) | `string``[]` | List of words to be considered correct. | ### DictionaryDefinitionInlineIgnoreWords Fields - --- #### `description` {#dictionarydefinitioninlineignorewords-description} -
Description
@@ -3096,14 +2606,10 @@ format: md
- - - --- #### `flagWords` {#dictionarydefinitioninlineignorewords-flagwords} -
Description
@@ -3131,14 +2637,10 @@ format: md
- - - --- #### `ignoreWords` {#dictionarydefinitioninlineignorewords-ignorewords} -
Description
@@ -3153,14 +2655,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitioninlineignorewords-name} -
Description
@@ -3181,14 +2679,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitioninlineignorewords-nosuggest} -
Description
@@ -3208,14 +2702,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitioninlineignorewords-repmap} -
Description
@@ -3229,14 +2719,10 @@ format: md
- - - --- #### `suggestWords` {#dictionarydefinitioninlineignorewords-suggestwords} -
Description
@@ -3260,14 +2746,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitioninlineignorewords-type} -
Description
@@ -3288,14 +2770,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitioninlineignorewords-usecompounds} -
Description
@@ -3309,14 +2787,10 @@ format: md
- - - --- #### `words` {#dictionarydefinitioninlineignorewords-words} -
Description
@@ -3330,32 +2804,27 @@ format: md
- - ## DictionaryDefinitionInlineWords -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitioninlinewords-description) | `string` | Optional description. | -| [flagWords](#dictionarydefinitioninlinewords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [ignoreWords](#dictionarydefinitioninlinewords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [name](#dictionarydefinitioninlinewords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitioninlinewords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [repMap](#dictionarydefinitioninlinewords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [suggestWords](#dictionarydefinitioninlinewords-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [type](#dictionarydefinitioninlinewords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitioninlinewords-usecompounds) | `boolean` | Use Compounds. | -| [words](#dictionarydefinitioninlinewords-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| ------------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------- | +| [description](#dictionarydefinitioninlinewords-description) | `string` | Optional description. | +| [flagWords](#dictionarydefinitioninlinewords-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [ignoreWords](#dictionarydefinitioninlinewords-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [name](#dictionarydefinitioninlinewords-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitioninlinewords-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [repMap](#dictionarydefinitioninlinewords-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [suggestWords](#dictionarydefinitioninlinewords-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [type](#dictionarydefinitioninlinewords-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitioninlinewords-usecompounds) | `boolean` | Use Compounds. | +| [words](#dictionarydefinitioninlinewords-words) | `string``[]` | List of words to be considered correct. | ### DictionaryDefinitionInlineWords Fields - --- #### `description` {#dictionarydefinitioninlinewords-description} -
Description
@@ -3369,14 +2838,10 @@ format: md
- - - --- #### `flagWords` {#dictionarydefinitioninlinewords-flagwords} -
Description
@@ -3404,14 +2869,10 @@ format: md
- - - --- #### `ignoreWords` {#dictionarydefinitioninlinewords-ignorewords} -
Description
@@ -3426,14 +2887,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitioninlinewords-name} -
Description
@@ -3454,14 +2911,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitioninlinewords-nosuggest} -
Description
@@ -3481,14 +2934,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitioninlinewords-repmap} -
Description
@@ -3502,14 +2951,10 @@ format: md
- - - --- #### `suggestWords` {#dictionarydefinitioninlinewords-suggestwords} -
Description
@@ -3533,14 +2978,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitioninlinewords-type} -
Description
@@ -3561,14 +3002,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitioninlinewords-usecompounds} -
Description
@@ -3582,14 +3019,10 @@ format: md
- - - --- #### `words` {#dictionarydefinitioninlinewords-words} -
Description
@@ -3603,29 +3036,24 @@ format: md
- - ## DictionaryDefinitionPreferred -| Field | Type | Description | -| --- | --- | --- | -| [description](#dictionarydefinitionpreferred-description) | `string` | Optional description. | -| [name](#dictionarydefinitionpreferred-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | -| [noSuggest](#dictionarydefinitionpreferred-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | -| [path](#dictionarydefinitionpreferred-path) | [`DictionaryPath`](#dictionarypath) | Path to the file. | -| [repMap](#dictionarydefinitionpreferred-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | -| [type](#dictionarydefinitionpreferred-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | -| [useCompounds](#dictionarydefinitionpreferred-usecompounds) | `boolean` | Use Compounds. | - +| Field | Type | Description | +| ----------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------- | +| [description](#dictionarydefinitionpreferred-description) | `string` | Optional description. | +| [name](#dictionarydefinitionpreferred-name) | [`DictionaryId`](#dictionaryid) | This is the name of a dictionary. | +| [noSuggest](#dictionarydefinitionpreferred-nosuggest) | `boolean` | Indicate that suggestions should not come from this dictionary. | +| [path](#dictionarydefinitionpreferred-path) | [`DictionaryPath`](#dictionarypath) | Path to the file. | +| [repMap](#dictionarydefinitionpreferred-repmap) | [`ReplaceMap`](#replacemap) | Replacement pairs. | +| [type](#dictionarydefinitionpreferred-type) | [`DictionaryFileTypes`](#dictionaryfiletypes) | Type of file: | +| [useCompounds](#dictionarydefinitionpreferred-usecompounds) | `boolean` | Use Compounds. | ### DictionaryDefinitionPreferred Fields - --- #### `description` {#dictionarydefinitionpreferred-description} -
Description
@@ -3639,14 +3067,10 @@ format: md
- - - --- #### `name` {#dictionarydefinitionpreferred-name} -
Description
@@ -3667,14 +3091,10 @@ format: md
- - - --- #### `noSuggest` {#dictionarydefinitionpreferred-nosuggest} -
Description
@@ -3694,14 +3114,10 @@ format: md
- - - --- #### `path` {#dictionarydefinitionpreferred-path} -
Description
@@ -3715,14 +3131,10 @@ format: md
- - - --- #### `repMap` {#dictionarydefinitionpreferred-repmap} -
Description
@@ -3736,14 +3148,10 @@ format: md
- - - --- #### `type` {#dictionarydefinitionpreferred-type} -
Description
@@ -3764,14 +3172,10 @@ format: md
- - - --- #### `useCompounds` {#dictionarydefinitionpreferred-usecompounds} -
Description
@@ -3785,15 +3189,10 @@ format: md
- - - - --- ## DictionaryFileTypes {#dictionaryfiletypes} -
Type
@@ -3802,15 +3201,10 @@ format: md
- - - - --- ## DictionaryId {#dictionaryid} -
Description
@@ -3831,30 +3225,25 @@ format: md
- - ## DictionaryInformation -| Field | Type | Description | -| --- | --- | --- | -| [accents](#dictionaryinformation-accents) | [`CharacterSet`](#characterset)
[`CharacterSetCosts`](#charactersetcosts)`[]` | The accent characters. | -| [adjustments](#dictionaryinformation-adjustments) | [`PatternAdjustment`](#patternadjustment)`[]` | A collection of patterns to test against the suggested words. | -| [alphabet](#dictionaryinformation-alphabet) | [`CharacterSet`](#characterset)
[`CharacterSetCosts`](#charactersetcosts)`[]` | The alphabet to use. | -| [costs](#dictionaryinformation-costs) | [`EditCosts`](#editcosts) | Define edit costs. | -| [hunspellInformation](#dictionaryinformation-hunspellinformation) | [`HunspellInformation`](#hunspellinformation) | Used by dictionary authors | -| [ignore](#dictionaryinformation-ignore) | [`CharacterSet`](#characterset) | An optional set of characters that can possibly be removed from a word before | -| [locale](#dictionaryinformation-locale) | `string` | The locale of the dictionary. | -| [suggestionEditCosts](#dictionaryinformation-suggestioneditcosts) | [`SuggestionCostsDefs`](#suggestioncostsdefs) | Used in making suggestions. The lower the value, the more likely the suggestion | - +| Field | Type | Description | +| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| [accents](#dictionaryinformation-accents) | [`CharacterSet`](#characterset)
[`CharacterSetCosts`](#charactersetcosts)`[]` | The accent characters. | +| [adjustments](#dictionaryinformation-adjustments) | [`PatternAdjustment`](#patternadjustment)`[]` | A collection of patterns to test against the suggested words. | +| [alphabet](#dictionaryinformation-alphabet) | [`CharacterSet`](#characterset)
[`CharacterSetCosts`](#charactersetcosts)`[]` | The alphabet to use. | +| [costs](#dictionaryinformation-costs) | [`EditCosts`](#editcosts) | Define edit costs. | +| [hunspellInformation](#dictionaryinformation-hunspellinformation) | [`HunspellInformation`](#hunspellinformation) | Used by dictionary authors | +| [ignore](#dictionaryinformation-ignore) | [`CharacterSet`](#characterset) | An optional set of characters that can possibly be removed from a word before | +| [locale](#dictionaryinformation-locale) | `string` | The locale of the dictionary. | +| [suggestionEditCosts](#dictionaryinformation-suggestioneditcosts) | [`SuggestionCostsDefs`](#suggestioncostsdefs) | Used in making suggestions. The lower the value, the more likely the suggestion | ### DictionaryInformation Fields - --- #### `accents` {#dictionaryinformation-accents} -
Description
@@ -3870,14 +3259,10 @@ format: md
- - - --- #### `adjustments` {#dictionaryinformation-adjustments} -
Description
@@ -3892,14 +3277,10 @@ format: md
- - - --- #### `alphabet` {#dictionaryinformation-alphabet} -
Description
@@ -3913,14 +3294,10 @@ format: md
- - - --- #### `costs` {#dictionaryinformation-costs} -
Description
@@ -3934,14 +3311,10 @@ format: md
- - - --- #### `hunspellInformation` {#dictionaryinformation-hunspellinformation} -
Description
@@ -3955,14 +3328,10 @@ format: md
- - - --- #### `ignore` {#dictionaryinformation-ignore} -
Description
@@ -3981,14 +3350,10 @@ format: md
- - - --- #### `locale` {#dictionaryinformation-locale} -
Description
@@ -4003,14 +3368,10 @@ format: md
- - - --- #### `suggestionEditCosts` {#dictionaryinformation-suggestioneditcosts} -
Description
@@ -4025,15 +3386,10 @@ format: md
- - - - --- ## DictionaryNegRef {#dictionarynegref} -
Description
@@ -4056,15 +3412,10 @@ format: md
- - - - --- ## DictionaryPath {#dictionarypath} -
Description
@@ -4079,15 +3430,10 @@ format: md
- - - - --- ## DictionaryRef {#dictionaryref} -
Description
@@ -4102,15 +3448,10 @@ format: md
- - - - --- ## DictionaryReference {#dictionaryreference} -
Description
@@ -4127,27 +3468,22 @@ format: md
- - ## EditCosts -| Field | Type | Description | -| --- | --- | --- | -| [accentCosts](#editcosts-accentcosts) | `number` | The cost to add / remove an accent | -| [baseCost](#editcosts-basecost) | `number` | This is the base cost for making an edit. | -| [capsCosts](#editcosts-capscosts) | `number` | The cost to change capitalization. | -| [firstLetterPenalty](#editcosts-firstletterpenalty) | `number` | The extra cost incurred for changing the first letter of a word. | -| [nonAlphabetCosts](#editcosts-nonalphabetcosts) | `number` | This is the cost for characters not in the alphabet. | - +| Field | Type | Description | +| --------------------------------------------------- | -------- | ---------------------------------------------------------------- | +| [accentCosts](#editcosts-accentcosts) | `number` | The cost to add / remove an accent | +| [baseCost](#editcosts-basecost) | `number` | This is the base cost for making an edit. | +| [capsCosts](#editcosts-capscosts) | `number` | The cost to change capitalization. | +| [firstLetterPenalty](#editcosts-firstletterpenalty) | `number` | The extra cost incurred for changing the first letter of a word. | +| [nonAlphabetCosts](#editcosts-nonalphabetcosts) | `number` | This is the cost for characters not in the alphabet. | ### EditCosts Fields - --- #### `accentCosts` {#editcosts-accentcosts} -
Description
@@ -4162,14 +3498,10 @@ format: md
- - - --- #### `baseCost` {#editcosts-basecost} -
Description
@@ -4183,14 +3515,10 @@ format: md
- - - --- #### `capsCosts` {#editcosts-capscosts} -
Description
@@ -4205,14 +3533,10 @@ format: md
- - - --- #### `firstLetterPenalty` {#editcosts-firstletterpenalty} -
Description
@@ -4227,14 +3551,10 @@ format: md
- - - --- #### `nonAlphabetCosts` {#editcosts-nonalphabetcosts} -
Description
@@ -4248,15 +3568,10 @@ format: md
- - - - --- ## FSPathResolvable {#fspathresolvable} -
Description
@@ -4274,15 +3589,10 @@ format: md
- - - - --- ## FeatureEnableOnly {#featureenableonly} -
Type
@@ -4291,23 +3601,18 @@ format: md
- - ## Features -| Field | Type | Description | -| --- | --- | --- | -| [weighted-suggestions](#features-weighted-suggestions) | [`FeatureEnableOnly`](#featureenableonly) | Enable/disable using weighted suggestions. | - +| Field | Type | Description | +| ------------------------------------------------------ | ----------------------------------------- | ------------------------------------------ | +| [weighted-suggestions](#features-weighted-suggestions) | [`FeatureEnableOnly`](#featureenableonly) | Enable/disable using weighted suggestions. | ### Features Fields - --- #### `weighted-suggestions` {#features-weighted-suggestions} -
Description
@@ -4321,15 +3626,10 @@ format: md
- - - - --- ## FsDictionaryPath {#fsdictionarypath} -
Description
@@ -4343,15 +3643,10 @@ format: md
- - - - --- ## FsPath {#fspath} -
Description
@@ -4365,15 +3660,10 @@ format: md
- - - - --- ## Glob {#glob} -
Description
@@ -4387,24 +3677,19 @@ format: md
- - ## HunspellInformation -| Field | Type | Description | -| --- | --- | --- | -| [aff](#hunspellinformation-aff) | `string` | Selected Hunspell AFF content. | -| [costs](#hunspellinformation-costs) | `object` | The costs to apply when using the hunspell settings | - +| Field | Type | Description | +| ----------------------------------- | -------- | --------------------------------------------------- | +| [aff](#hunspellinformation-aff) | `string` | Selected Hunspell AFF content. | +| [costs](#hunspellinformation-costs) | `object` | The costs to apply when using the hunspell settings | ### HunspellInformation Fields - --- #### `aff` {#hunspellinformation-aff} -
Description
@@ -4438,14 +3723,10 @@ format: md
- - - --- #### `costs` {#hunspellinformation-costs} -
Description
@@ -4459,15 +3740,10 @@ format: md
- - - - --- ## LanguageId {#languageid} -
Type
@@ -4476,15 +3752,10 @@ format: md
- - - - --- ## LanguageIdMultiple {#languageidmultiple} -
Description
@@ -4498,15 +3769,10 @@ format: md
- - - - --- ## LanguageIdMultipleNeg {#languageidmultipleneg} -
Description
@@ -4520,15 +3786,10 @@ format: md
- - - - --- ## LanguageIdSingle {#languageidsingle} -
Description
@@ -4542,41 +3803,36 @@ format: md
- - ## LanguageSetting -| Field | Type | Description | -| --- | --- | --- | -| [allowCompoundWords](#languagesetting-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | -| [caseSensitive](#languagesetting-casesensitive) | `boolean` | Determines if words must match case and accent rules. | -| [description](#languagesetting-description) | `string` | Optional description of configuration. | -| [dictionaries](#languagesetting-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | -| [dictionaryDefinitions](#languagesetting-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | -| [enabled](#languagesetting-enabled) | `boolean` | Is the spell checker enabled. | -| [flagWords](#languagesetting-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [id](#languagesetting-id) | `string` | Optional identifier. | -| [ignoreRegExpList](#languagesetting-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | -| [ignoreWords](#languagesetting-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [includeRegExpList](#languagesetting-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | -| [languageId](#languagesetting-languageid) | [`MatchingFileType`](#matchingfiletype) | The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. | -| [local](#languagesetting-local) | [`LocaleId`](#localeid)
[`LocaleId`](#localeid)`[]` | Deprecated - The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. | -| [locale](#languagesetting-locale) | [`LocaleId`](#localeid)
[`LocaleId`](#localeid)`[]` | The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. | -| [name](#languagesetting-name) | `string` | Optional name of configuration. | -| [noSuggestDictionaries](#languagesetting-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | -| [patterns](#languagesetting-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | -| [suggestWords](#languagesetting-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [words](#languagesetting-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| --------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| [allowCompoundWords](#languagesetting-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | +| [caseSensitive](#languagesetting-casesensitive) | `boolean` | Determines if words must match case and accent rules. | +| [description](#languagesetting-description) | `string` | Optional description of configuration. | +| [dictionaries](#languagesetting-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | +| [dictionaryDefinitions](#languagesetting-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | +| [enabled](#languagesetting-enabled) | `boolean` | Is the spell checker enabled. | +| [flagWords](#languagesetting-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [id](#languagesetting-id) | `string` | Optional identifier. | +| [ignoreRegExpList](#languagesetting-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | +| [ignoreWords](#languagesetting-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [includeRegExpList](#languagesetting-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | +| [languageId](#languagesetting-languageid) | [`MatchingFileType`](#matchingfiletype) | The language id. Ex: "typescript", "html", or "php". "\*" -- will match all languages. | +| [local](#languagesetting-local) | [`LocaleId`](#localeid)
[`LocaleId`](#localeid)`[]` | Deprecated - The locale filter, matches against the language. This can be a comma separated list. "\*" will match all locales. | +| [locale](#languagesetting-locale) | [`LocaleId`](#localeid)
[`LocaleId`](#localeid)`[]` | The locale filter, matches against the language. This can be a comma separated list. "\*" will match all locales. | +| [name](#languagesetting-name) | `string` | Optional name of configuration. | +| [noSuggestDictionaries](#languagesetting-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | +| [patterns](#languagesetting-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | +| [suggestWords](#languagesetting-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [words](#languagesetting-words) | `string``[]` | List of words to be considered correct. | ### LanguageSetting Fields - --- #### `allowCompoundWords` {#languagesetting-allowcompoundwords} -
Description
@@ -4590,14 +3846,10 @@ format: md
- - - --- #### `caseSensitive` {#languagesetting-casesensitive} -
Description
@@ -4615,14 +3867,10 @@ format: md
- - - --- #### `description` {#languagesetting-description} -
Description
@@ -4636,14 +3884,10 @@ format: md
- - - --- #### `dictionaries` {#languagesetting-dictionaries} -
Description
@@ -4664,14 +3908,10 @@ format: md
- - - --- #### `dictionaryDefinitions` {#languagesetting-dictionarydefinitions} -
Description
@@ -4694,14 +3934,10 @@ format: md
- - - --- #### `enabled` {#languagesetting-enabled} -
Description
@@ -4715,13 +3951,9 @@ format: md
+--- - - ---- - -#### `flagWords` {#languagesetting-flagwords} - +#### `flagWords` {#languagesetting-flagwords}
@@ -4750,14 +3982,10 @@ format: md
- - - --- #### `id` {#languagesetting-id} -
Description
@@ -4771,14 +3999,10 @@ format: md
- - - --- #### `ignoreRegExpList` {#languagesetting-ignoreregexplist} -
Description
@@ -4816,14 +4040,10 @@ format: md
- - - --- #### `ignoreWords` {#languagesetting-ignorewords} -
Description
@@ -4838,14 +4058,10 @@ format: md
- - - --- #### `includeRegExpList` {#languagesetting-includeregexplist} -
Description
@@ -4864,14 +4080,10 @@ format: md
- - - --- #### `languageId` {#languagesetting-languageid} -
Description
@@ -4885,14 +4097,10 @@ format: md
- - - --- #### `local` {#languagesetting-local} -
Description
@@ -4906,14 +4114,10 @@ format: md
- - - --- #### `locale` {#languagesetting-locale} -
Description
@@ -4927,14 +4131,10 @@ format: md
- - - --- #### `name` {#languagesetting-name} -
Description
@@ -4948,14 +4148,10 @@ format: md
- - - --- #### `noSuggestDictionaries` {#languagesetting-nosuggestdictionaries} -
Description
@@ -4975,14 +4171,10 @@ format: md
- - - --- #### `patterns` {#languagesetting-patterns} -
Description
@@ -5020,14 +4212,10 @@ format: md
- - - --- #### `suggestWords` {#languagesetting-suggestwords} -
Description
@@ -5051,14 +4239,10 @@ format: md
- - - --- #### `words` {#languagesetting-words} -
Description
@@ -5072,15 +4256,10 @@ format: md
- - - - --- ## LocaleId {#localeid} -
Description
@@ -5094,15 +4273,10 @@ format: md
- - - - --- ## MatchingFileType {#matchingfiletype} -
Type
@@ -5111,54 +4285,49 @@ format: md
- - ## OverrideSettings -| Field | Type | Description | -| --- | --- | --- | -| [allowCompoundWords](#overridesettings-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | -| [caseSensitive](#overridesettings-casesensitive) | `boolean` | Determines if words must match case and accent rules. | -| [description](#overridesettings-description) | `string` | Optional description of configuration. | -| [dictionaries](#overridesettings-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | -| [dictionaryDefinitions](#overridesettings-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | -| [enableFiletypes](#overridesettings-enablefiletypes) | [`LanguageIdSingle`](#languageidsingle)`[]` | Enable / Disable checking file types (languageIds). | -| [enabled](#overridesettings-enabled) | `boolean` | Is the spell checker enabled. | -| [enabledFileTypes](#overridesettings-enabledfiletypes) | `object` | Enable / Disable checking file types (languageIds). | -| [enabledLanguageIds](#overridesettings-enabledlanguageids) | [`LanguageIdSingle`](#languageidsingle)`[]` | Specify a list of file types to spell check. It is better to use [Settings.enabledFileTypes](#settings-enabledfiletypes) to Enable / Disable checking files types. | -| [filename](#overridesettings-filename) | [`Glob`](#glob)
[`Glob`](#glob)`[]` | Glob pattern or patterns to match against. | -| [flagWords](#overridesettings-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | -| [id](#overridesettings-id) | `string` | Optional identifier. | -| [ignoreRegExpList](#overridesettings-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | -| [ignoreWords](#overridesettings-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | -| [includeRegExpList](#overridesettings-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | -| [language](#overridesettings-language) | [`LocaleId`](#localeid) | Sets the locale. | -| [languageId](#overridesettings-languageid) | [`MatchingFileType`](#matchingfiletype) | Sets the programming language id to match file type. | -| [languageSettings](#overridesettings-languagesettings) | [`LanguageSetting`](#languagesetting)`[]` | Additional settings for individual languages. | -| [loadDefaultConfiguration](#overridesettings-loaddefaultconfiguration) | `boolean` | By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false` | -| [maxDuplicateProblems](#overridesettings-maxduplicateproblems) | `number` | The maximum number of times the same word can be flagged as an error in a file. | -| [maxNumberOfProblems](#overridesettings-maxnumberofproblems) | `number` | The maximum number of problems to report in a file. | -| [minWordLength](#overridesettings-minwordlength) | `number` | The minimum length of a word before checking it against a dictionary. | -| [name](#overridesettings-name) | `string` | Optional name of configuration. | -| [noSuggestDictionaries](#overridesettings-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | -| [numSuggestions](#overridesettings-numsuggestions) | `number` | Number of suggestions to make. | -| [patterns](#overridesettings-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | -| [pnpFiles](#overridesettings-pnpfiles) | `string``[]` | The PnP files to search for. Note: `.mjs` files are not currently supported. | -| [suggestWords](#overridesettings-suggestwords) | `string``[]` | A list of suggested replacements for words. | -| [suggestionNumChanges](#overridesettings-suggestionnumchanges) | `number` | The maximum number of changes allowed on a word to be considered a suggestions. | -| [suggestionsTimeout](#overridesettings-suggestionstimeout) | `number` | The maximum amount of time in milliseconds to generate suggestions for a word. | -| [usePnP](#overridesettings-usepnp) | `boolean` | Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading | -| [words](#overridesettings-words) | `string``[]` | List of words to be considered correct. | - +| Field | Type | Description | +| ---------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [allowCompoundWords](#overridesettings-allowcompoundwords) | `boolean` | True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details. | +| [caseSensitive](#overridesettings-casesensitive) | `boolean` | Determines if words must match case and accent rules. | +| [description](#overridesettings-description) | `string` | Optional description of configuration. | +| [dictionaries](#overridesettings-dictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries to use. Each entry should match the name of the dictionary. | +| [dictionaryDefinitions](#overridesettings-dictionarydefinitions) | [`DictionaryDefinition`](#dictionarydefinition)`[]` | Define additional available dictionaries. | +| [enableFiletypes](#overridesettings-enablefiletypes) | [`LanguageIdSingle`](#languageidsingle)`[]` | Enable / Disable checking file types (languageIds). | +| [enabled](#overridesettings-enabled) | `boolean` | Is the spell checker enabled. | +| [enabledFileTypes](#overridesettings-enabledfiletypes) | `object` | Enable / Disable checking file types (languageIds). | +| [enabledLanguageIds](#overridesettings-enabledlanguageids) | [`LanguageIdSingle`](#languageidsingle)`[]` | Specify a list of file types to spell check. It is better to use [Settings.enabledFileTypes](#settings-enabledfiletypes) to Enable / Disable checking files types. | +| [filename](#overridesettings-filename) | [`Glob`](#glob)
[`Glob`](#glob)`[]` | Glob pattern or patterns to match against. | +| [flagWords](#overridesettings-flagwords) | `string``[]` | List of words to always be considered incorrect. Words found in `flagWords` override `words`. | +| [id](#overridesettings-id) | `string` | Optional identifier. | +| [ignoreRegExpList](#overridesettings-ignoreregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or pattern names to exclude from spell checking. | +| [ignoreWords](#overridesettings-ignorewords) | `string``[]` | List of words to be ignored. An ignored word will not show up as an error, even if it is | +| [includeRegExpList](#overridesettings-includeregexplist) | [`RegExpPatternList`](#regexppatternlist) | List of regular expression patterns or defined pattern names to match for spell checking. | +| [language](#overridesettings-language) | [`LocaleId`](#localeid) | Sets the locale. | +| [languageId](#overridesettings-languageid) | [`MatchingFileType`](#matchingfiletype) | Sets the programming language id to match file type. | +| [languageSettings](#overridesettings-languagesettings) | [`LanguageSetting`](#languagesetting)`[]` | Additional settings for individual languages. | +| [loadDefaultConfiguration](#overridesettings-loaddefaultconfiguration) | `boolean` | By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false` | +| [maxDuplicateProblems](#overridesettings-maxduplicateproblems) | `number` | The maximum number of times the same word can be flagged as an error in a file. | +| [maxNumberOfProblems](#overridesettings-maxnumberofproblems) | `number` | The maximum number of problems to report in a file. | +| [minWordLength](#overridesettings-minwordlength) | `number` | The minimum length of a word before checking it against a dictionary. | +| [name](#overridesettings-name) | `string` | Optional name of configuration. | +| [noSuggestDictionaries](#overridesettings-nosuggestdictionaries) | [`DictionaryReference`](#dictionaryreference)`[]` | Optional list of dictionaries that will not be used for suggestions. | +| [numSuggestions](#overridesettings-numsuggestions) | `number` | Number of suggestions to make. | +| [patterns](#overridesettings-patterns) | [`RegExpPatternDefinition`](#regexppatterndefinition)`[]` | Defines a list of patterns that can be used with the `ignoreRegExpList` and | +| [pnpFiles](#overridesettings-pnpfiles) | `string``[]` | The PnP files to search for. Note: `.mjs` files are not currently supported. | +| [suggestWords](#overridesettings-suggestwords) | `string``[]` | A list of suggested replacements for words. | +| [suggestionNumChanges](#overridesettings-suggestionnumchanges) | `number` | The maximum number of changes allowed on a word to be considered a suggestions. | +| [suggestionsTimeout](#overridesettings-suggestionstimeout) | `number` | The maximum amount of time in milliseconds to generate suggestions for a word. | +| [usePnP](#overridesettings-usepnp) | `boolean` | Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading | +| [words](#overridesettings-words) | `string``[]` | List of words to be considered correct. | ### OverrideSettings Fields - --- #### `allowCompoundWords` {#overridesettings-allowcompoundwords} -
Description
@@ -5172,14 +4341,10 @@ format: md
- - - --- #### `caseSensitive` {#overridesettings-casesensitive} -
Description
@@ -5197,14 +4362,10 @@ format: md
- - - --- #### `description` {#overridesettings-description} -
Description
@@ -5218,14 +4379,10 @@ format: md
- - - --- #### `dictionaries` {#overridesettings-dictionaries} -
Description
@@ -5246,14 +4403,10 @@ format: md
- - - --- #### `dictionaryDefinitions` {#overridesettings-dictionarydefinitions} -
Description
@@ -5276,14 +4429,10 @@ format: md
- - - --- #### `enableFiletypes` {#overridesettings-enablefiletypes} -
Description
@@ -5316,14 +4465,10 @@ format: md
- - - --- #### `enabled` {#overridesettings-enabled} -
Description
@@ -5337,14 +4482,10 @@ format: md
- - - --- #### `enabledFileTypes` {#overridesettings-enabledfiletypes} -
Description
@@ -5373,14 +4514,10 @@ format: md
- - - --- #### `enabledLanguageIds` {#overridesettings-enabledlanguageids} -
Description
@@ -5394,14 +4531,10 @@ format: md
- - - --- #### `filename` {#overridesettings-filename} -
Description
@@ -5415,14 +4548,10 @@ format: md
- - - --- #### `flagWords` {#overridesettings-flagwords} -
Description
@@ -5450,14 +4579,10 @@ format: md
- - - --- #### `id` {#overridesettings-id} -
Description
@@ -5471,14 +4596,10 @@ format: md
- - - --- #### `ignoreRegExpList` {#overridesettings-ignoreregexplist} -
Description
@@ -5516,14 +4637,10 @@ format: md
- - - --- #### `ignoreWords` {#overridesettings-ignorewords} -
Description
@@ -5538,14 +4655,10 @@ format: md
- - - --- #### `includeRegExpList` {#overridesettings-includeregexplist} -
Description
@@ -5564,14 +4677,10 @@ format: md
- - - --- #### `language` {#overridesettings-language} -
Description
@@ -5585,14 +4694,10 @@ format: md
- - - --- #### `languageId` {#overridesettings-languageid} -
Description
@@ -5606,14 +4711,10 @@ format: md
- - - --- #### `languageSettings` {#overridesettings-languagesettings} -
Description
@@ -5629,14 +4730,10 @@ format: md
- - - --- #### `loadDefaultConfiguration` {#overridesettings-loaddefaultconfiguration} -
Description
@@ -5651,14 +4748,10 @@ format: md
- - - --- #### `maxDuplicateProblems` {#overridesettings-maxduplicateproblems} -
Description
@@ -5672,14 +4765,10 @@ format: md
- - - --- #### `maxNumberOfProblems` {#overridesettings-maxnumberofproblems} -
Description
@@ -5693,14 +4782,10 @@ format: md
- - - --- #### `minWordLength` {#overridesettings-minwordlength} -
Description
@@ -5714,14 +4799,10 @@ format: md
- - - --- #### `name` {#overridesettings-name} -
Description
@@ -5735,14 +4816,10 @@ format: md
- - - --- #### `noSuggestDictionaries` {#overridesettings-nosuggestdictionaries} -
Description
@@ -5762,14 +4839,10 @@ format: md
- - - --- #### `numSuggestions` {#overridesettings-numsuggestions} -
Description
@@ -5783,14 +4856,10 @@ format: md
- - - --- #### `patterns` {#overridesettings-patterns} -
Description
@@ -5828,14 +4897,10 @@ format: md
- - - --- #### `pnpFiles` {#overridesettings-pnpfiles} -
Description
@@ -5849,14 +4914,10 @@ format: md
- - - --- #### `suggestWords` {#overridesettings-suggestwords} -
Description
@@ -5880,14 +4941,10 @@ format: md
- - - --- #### `suggestionNumChanges` {#overridesettings-suggestionnumchanges} -
Description
@@ -5905,14 +4962,10 @@ format: md
- - - --- #### `suggestionsTimeout` {#overridesettings-suggestionstimeout} -
Description
@@ -5926,14 +4979,10 @@ format: md
- - - --- #### `usePnP` {#overridesettings-usepnp} -
Description
@@ -5951,14 +5000,10 @@ format: md
- - - --- #### `words` {#overridesettings-words} -
Description
@@ -5972,15 +5017,10 @@ format: md
- - - - --- ## Pattern {#pattern} -
Type
@@ -5989,25 +5029,20 @@ format: md
- - ## PatternAdjustment -| Field | Type | Description | -| --- | --- | --- | -| [id](#patternadjustment-id) | `string` | Id of the Adjustment, i.e. `short-compound` | -| [penalty](#patternadjustment-penalty) | `number` | The amount of penalty to apply. | -| [regexp](#patternadjustment-regexp) | `string` | RegExp pattern to match | - +| Field | Type | Description | +| ------------------------------------- | -------- | ------------------------------------------- | +| [id](#patternadjustment-id) | `string` | Id of the Adjustment, i.e. `short-compound` | +| [penalty](#patternadjustment-penalty) | `number` | The amount of penalty to apply. | +| [regexp](#patternadjustment-regexp) | `string` | RegExp pattern to match | ### PatternAdjustment Fields - --- #### `id` {#patternadjustment-id} -
Description
@@ -6021,14 +5056,10 @@ format: md
- - - --- #### `penalty` {#patternadjustment-penalty} -
Description
@@ -6042,14 +5073,10 @@ format: md
- - - --- #### `regexp` {#patternadjustment-regexp} -
Description
@@ -6063,15 +5090,10 @@ format: md
- - - - --- ## PatternId {#patternid} -
Description
@@ -6085,15 +5107,10 @@ format: md
- - - - --- ## PatternRef {#patternref} -
Description
@@ -6107,15 +5124,10 @@ format: md
- - - - --- ## PredefinedPatterns {#predefinedpatterns} -
Type
@@ -6124,25 +5136,20 @@ format: md
- - ## RegExpPatternDefinition -| Field | Type | Description | -| --- | --- | --- | -| [description](#regexppatterndefinition-description) | `string` | Description of the pattern. | -| [name](#regexppatterndefinition-name) | [`PatternId`](#patternid) | Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList. | -| [pattern](#regexppatterndefinition-pattern) | [`Pattern`](#pattern)
[`Pattern`](#pattern)`[]` | RegExp pattern or array of RegExp patterns. | - +| Field | Type | Description | +| --------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------ | +| [description](#regexppatterndefinition-description) | `string` | Description of the pattern. | +| [name](#regexppatterndefinition-name) | [`PatternId`](#patternid) | Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList. | +| [pattern](#regexppatterndefinition-pattern) | [`Pattern`](#pattern)
[`Pattern`](#pattern)`[]` | RegExp pattern or array of RegExp patterns. | ### RegExpPatternDefinition Fields - --- #### `description` {#regexppatterndefinition-description} -
Description
@@ -6156,14 +5163,10 @@ format: md
- - - --- #### `name` {#regexppatterndefinition-name} -
Description
@@ -6178,14 +5181,10 @@ format: md
- - - --- #### `pattern` {#regexppatterndefinition-pattern} -
Description
@@ -6199,15 +5198,10 @@ format: md
- - - - --- ## RegExpPatternList {#regexppatternlist} -
Description
@@ -6221,15 +5215,10 @@ format: md
- - - - --- ## ReplaceEntry {#replaceentry} -
Type
@@ -6238,15 +5227,10 @@ format: md
- - - - --- ## ReplaceMap {#replacemap} -
Type
@@ -6255,15 +5239,10 @@ format: md
- - - - --- ## ReporterModuleName {#reportermodulename} -
Description
@@ -6277,15 +5256,10 @@ format: md
- - - - --- ## ReporterOptions {#reporteroptions} -
Description
@@ -6299,15 +5273,10 @@ format: md
- - - - --- ## ReporterSettings {#reportersettings} -
Description
@@ -6328,15 +5297,10 @@ format: md
- - - - --- ## Serializable {#serializable} -
Type
@@ -6345,15 +5309,10 @@ format: md
- - - - --- ## SimpleGlob {#simpleglob} -
Description
@@ -6367,15 +5326,10 @@ format: md
- - - - --- ## SuggestionCostMapDef {#suggestioncostmapdef} -
Description
@@ -6408,15 +5362,10 @@ format: md
- - - - --- ## SuggestionCostsDefs {#suggestioncostsdefs} -
Type
@@ -6425,15 +5374,10 @@ format: md
- - - - --- ## Version {#version} -
Type
@@ -6442,15 +5386,10 @@ format: md
- - - - --- ## VersionLatest {#versionlatest} -
Description
@@ -6464,15 +5403,10 @@ format: md
- - - - --- ## VersionLegacy {#versionlegacy} -
Description
@@ -6485,4 +5419,3 @@ format: md `string`
-