-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Ignoring user settings when a local config file is present #2666
Comments
Thank you for the thoughtful request. You make a good point. I have also seen other teams adding This is going to require a bit of thought. |
Fixed by #2868 I hope to release this in a week or two. |
Great news @Jason3S 🎉 Looking at #2868, I see that Just trying to understand if I need to update anything in the repos I help manage. |
Some vscode settings still have an impact, these mostly have to do with user experience, like how often to spell check and how many errors to show. The key thing is, that if a file is spell checked, the results should be the same as the command line tool.
I updated #2868 PR to better document this. |
Yes. A |
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. |
I have started using CSpell as a local (in-project) linter, which I can run in CI via
pnpm cspell .
. I have also configured CSpell via[project]/cspell.config.yaml
— this file is successfully picked by the command line and the VS Code extension.While using the extension, I have noticed some discrepancies in linting results between the CLI and the editor. It turned out that the extension was mixing a project-level
cspell.config.yaml
with"cSpell.*"
properties from my VS Code user’ssettings.json
. I did not expect this behavior and could not figure out how to permanently turn the mixing off.Having a bit of experience with other VS Code extensions (Prettier, ESLint, MarkdownLint), I expect that a local config file is replacing instead of supplementing any config that has been defined in any VS Code settings. When project config is mixed with the user config, parity between VS Code output and CLI output cannot be guaranteed so the DX gets worse.
As a workaround, I have been able to mitigate the disparity by setting
"cSpell.userWords": []
in[project]/.vscode/settings.json
and by addingminWordLength: 3
to[project]/cspell.config.yaml
. The first line prevented my VS Code user’s custom words from leaking into the project and the second line has matched the CLI with"cSpell.minWordLength": 3
for the VS Code user.The number of CSpell options is quite large so my workaround is not reliable. Other project contributors will likely face other disparities over time. To mitigate that, we will have to iterate on both files and thus waste time understanding the discrepancies.
It would be great if CSpell extension worked similarly to Prettier, ESLint, MarkdownLint or TypeScript linters. When a local CSpell file is found, it should become the only source of truth for the config, so none of the user settings can change the feedback of the IDE. Thus, at any time, the list of errors seen in VS Code matches the list of errors seen in CI for everyone.
If a permanent switch is impossible, it’d be great to be able to set something like
"cSpell.configMixing": false
in[project]/.vscode/settings.json
to at least limit the number of settings needed to achieve the parity. If a local project file is found, all VS Code’s settings should be ignored.What do you think folks?
The text was updated successfully, but these errors were encountered: