-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESLint Plugin: Configuration option to add words to the dictionary #3233
Comments
Let me see if I understand you: You would like the plugin to offer the option to add a word to your dictionary in addition to the suggestions. I think that is a viable new feature. Possible WorkaroundIn the meantime, if you are using the VSCode Code Spell Checker extension, it is possible to bind keys to have the extension add it to your CSpell configuration. |
Related to #2782 It is going to be a while before the library used to update CSpell Configuration files is ported to CSpell. It might be possible to make a simpler option for use with the ESLint Plugin:
|
You understood that correctly.
That sounds great and should probably be enough configuration for most users. |
## Experimental Feature Add the ability to add words to a custom dictionary. Mostly fixes: #3233, but is flaky because it is using an unsupported technique to detect when a fix has been applied. - Option: `customWordListFile` **Experimental**: Specify a path to a custom word list file (A utf-8 text file with one word per line). This file is used to present the option to add words.
Needs a solution to Change Request: Notify plugins when a fix has been applied · Issue #16143 · eslint/eslint to work. |
As far as I can tell, ESLint plug-ins do not know which file loaded them. If you use a relative path name, the plug-in will use the current working directory as the base. Please try: "@cspell/spellchecker": ["warn", { customWordListFile: __dirname + "/words.txt" }], |
@Jason3S thank you for the suggestion unfortunately using the absolute path is also not working. Using eslint v8.6.0 and cspell plgin v6.4.2 What else can I try? id: @cspell/spellchecker id: @cspell/spellchecker Comment.line: ' spell spellchek' /users/marco/project/text.js ✖ 1 problem (0 errors, 1 warning) |
@marcoSven To add words, use: Reading words should work fine. But, adding words if flaky. The hack used to support that option does play well with the ESLint plug-in. Sometimes words are added as you type. |
Yes, I would like to add words to the dictionary from the quick fix. Getting this error below, I must be missing something obvious. "Configuration for rule "@cspell/spellchecker" is invalid: Here is my config Don't see the
Good to know thanks. |
I'm on my phone, so please forgive the formatting: Please try something like: { customWordListFile: { path:"...", addWords: true }} |
🙏 that works! |
Please double check the dictionary file. It might be full of junk that was added as you type. See: #3233 (comment) |
Thank you, I have not tested it yet. |
Per the RFC discussion on ESLint (eslint/rfcs#93), using ESLint to add words to a file is not possible. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When using words that aren't recognized by cspell (in my case "textbox") there is no way to add these words to the dictionary (Unless I have missed something).
The only way to disable the warning/error is by disabling the ESLint rule for that line.
It should be possible to modify the dictionary used by cspell in the ESLint options.
This could be as simple as providing an array of strings. I think the vscode plugin already supports that.
I tried to use the "eslint-plugin-spellcheck" but unfortunately, it doesn't support "ignoreImports" or "ignoreImportProperties" and also doesn't provide suggestions.
The text was updated successfully, but these errors were encountered: