-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add customWords options #4683
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I think it is a good idea to be able to add these things to the eslint config to keep things in one place.
In a later PR / enhancement, it might make sense to add a "cspell"
section, to add the ability to pass cspell
config to the spell checker without needing to add a cspell.json
file to a project.
options.ts
/**
* CSpell config
*/
cspell?: Pick<CSpellSettings, 'words' | 'ignoreWords' | 'flagWords'>;
if (customWords && customWords.length > 0) { | ||
const settings: CSpellSettings = { | ||
...defaultSettings, | ||
userWords: customWords, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use words
instead of userWords
. userWords
is used for defining words at the "user" level to be applied across multiple projects.
dictionaries: ['eslint-plugin-custom-words'], | ||
}; | ||
|
||
return settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to have both customWordListFile
and customWords
. Returning here would not allow customWords
.
Thank you so much for your review. As you said in the link, it seems like a really good idea to get cspell's settings as they are. I wrote a new af29643 reflecting the part and other reviews. I may have missed something because I am not familiar with the overall source code structure. If it is a minor modification, you can additionally modify the corresponding pr directly, or if you review it as it is now, I will reflect it as much as possible. So have a nice day |
This fix takes care of a caching issue that caused tests to fail if the same document was loaded again, but with different settings.
@Jason3S hello May I ask if this feature has been released? |
Not yet. It will come out with v7. |
hello. In addition to the file path option, an option has been added to make the eslint spell checker work normally even when word lists are entered.
If this option is added, it seems that the spell checker option can be applied immediately without having to create and read the file.