vscode-styled-components
vscode-styled-components copied to clipboard
Plugin should non-invasively allow disabling error reporting
Hi there, thanks for this extension! In my project setup, Stylelint is already handling validation of styled component strings, so I don't need any additional error reporting. I understand that I can disable it by editing my tsconfig.json, but... I don't really want to pollute repository-level configuration on a shared project to fix a quirk in my personal tooling. Doing so would make the config less readable and comprehensible for every collaborator, and they emphatically should not have to care about which text editor I'm using and which extensions I have installed for it.
It doesn't seem like there's a way to do via the extension configuration options currently documented -- am I missing something?
For others arriving at this issue, I looked around a bit and discovered there are multiple forks of this extension available on the VS Code Marketplace that disable language service integration entirely. ( This one has more downloads, but this one is the one that appears to be most up-to-date.)
To be honest, this works just as well for me, since the language service integration seems to be the source of a lot of strange behaviour and performance issues with this extension. Personally, I think it'd be great if the ability to disable the language service could be added directly to this extension, so that folks don't have to track down and use any of these less-maintained forks.
See https://github.com/Microsoft/typescript-styled-plugin#linting to disable validation
@mjbvz thanks for the quick reply! As I mentioned, I'm specifically seeking to not have to pollute per-project configuration (which is shared with other collaborators who don't know or care about the tooling I'm using as an individual) to achieve this. Unless I'm missing something, the link you shared explains how to disable linting by editing a project's tsconfig.json or jsconfig.json; I'm aware of this and I'm asking whether it would instead be possible to disable linting as the extension level, so that it only impacts myself as a user of VS Code rather than disrupting things for everyone collaborating on a project.
Hi @lostfictions
I see what you're suggesting, but sadly there's no way for this extension to inject configuration down into typescript-styled-plugin dynamically. I took a look at the forks but they seem to just cut-off the language service altogether which isn't really an option here.
So I don't really know what to suggest. I think @mjbvz might have an idea on having the extension communicate with the language service to switch linting off, but if not then there aren't any changes we're able to make here.
The Deno typescript plugin is able to get access to the editor config so it must be possible: https://github.com/denoland/vscode_deno/blob/main/typescript-deno-plugin/src/index.ts#L24-L26
Hopefully someone has time to work a similar solution into the typescript styled plugin