You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enabled, `autoFix` corrects any spelling issues that have a single "preferred" suggestion. It attempts to match
@@ -324,6 +324,48 @@ When spell checking, if `colour` is not in one of the dictionaries, then `color`
324
324
325
325
CSpell will match case, but not word stems. `blacklist` and `Blacklist` will get replaced, but not `blacklists`.
326
326
327
+
## `configFile` - Using a CSpell Configuration File
328
+
329
+
**`eslint.config.mjs`**
330
+
331
+
```js
332
+
rules: {
333
+
'@cspell/spellchecker': [
334
+
'error',
335
+
{
336
+
configFile: new URL('./cspell.config.yaml', import.meta.url).toString(),
337
+
},
338
+
],
339
+
},
340
+
```
341
+
342
+
## `cspell` and `cspellOptionsRoot` - CSpell Configuration
343
+
344
+
It is possible to send `cspell` configuration to the spell checker. Where possible, use a cspell configuration file and set `configFile`. But there are cases where this is not possible or desired (like fewer configuration files).
345
+
346
+
- Option `cspell` is used to pass along configuration to the spell checker.
347
+
- Option `cspellOptionsRoot` is used to tell the spell checker how to find `cspell.import`s.
Assuming `import.meta.url` is `file:///Users/ci/project/app/eslint.config.mjs`, this tells the spell checker to import `cspell.config.yaml` from `file:///Users/ci/project/app/cspell.config.yaml` and to search for package `@cspell/dict-de-de` starting at `file:///Users/ci/project/app/`.
366
+
367
+
If `cspellOptionsRoot` is not specified, the current working directory is used.
368
+
327
369
## Checking Custom AST Nodes
328
370
329
371
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.
Copy file name to clipboardExpand all lines: packages/cspell-eslint-plugin/assets/options.schema.json
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -326,6 +326,19 @@
326
326
},
327
327
"type": "object"
328
328
},
329
+
"cspellOptionsRoot": {
330
+
"anyOf": [
331
+
{
332
+
"type": "string"
333
+
},
334
+
{
335
+
"format": "uri",
336
+
"type": "string"
337
+
}
338
+
],
339
+
"description": "Specify the root path of the cspell configuration. It is used to resolve `imports` found in {@link cspell } .\n\nexample: ```js cspellOptionsRoot: import.meta.url // or cspellOptionsRoot: __filename ```",
340
+
"markdownDescription": "Specify the root path of the cspell configuration.\nIt is used to resolve `imports` found in {@link cspell } .\n\nexample:\n```js\ncspellOptionsRoot: import.meta.url\n// or\ncspellOptionsRoot: __filename\n```"
0 commit comments