feat: add env var to disable plugin#244
Conversation
src/index.ts
Outdated
| if (process.env.TS_PLUGIN_CSS_MODULES_DISALBED !== undefined) { | ||
| return info.languageService; | ||
| } |
There was a problem hiding this comment.
I have basically 0 experience with the TS language server, so I don't have a ton of knowledge re: whether this is the right thing to return early with. this was just copied from the eslint plugin I referenced in the PR description.
env.TS_PLUGIN_CSS_MODULES_DISALBED
|
tested this locally* works nicely on MacOS via
|
env.TS_PLUGIN_CSS_MODULES_DISALBED|
Thanks for this @ekilah, and sorry it took a long time. |
|
thanks :) It'll really help my workflow at least. |
|
This has now shipped in v5.1.0. Thanks again! |
#586) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [typescript-plugin-css-modules](https://togithub.com/mrmckeb/typescript-plugin-css-modules) | [`^5.0.2` -> `^5.1.0`](https://renovatebot.com/diffs/npm/typescript-plugin-css-modules/5.0.2/5.1.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mrmckeb/typescript-plugin-css-modules (typescript-plugin-css-modules)</summary> ### [`v5.1.0`](https://togithub.com/mrmckeb/typescript-plugin-css-modules/releases/tag/v5.1.0) [Compare Source](https://togithub.com/mrmckeb/typescript-plugin-css-modules/compare/v5.0.2...v5.1.0) #### What's Changed - chore: update dependencies by [@​mrmckeb](https://togithub.com/mrmckeb) in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/255](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/255) - feat: add env var to disable plugin by [@​ekilah](https://togithub.com/ekilah) in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/244](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/244) - docs: update README regexp by [@​mrmckeb](https://togithub.com/mrmckeb) in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/256](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/256) - feat(getCssExports): adds support for SCSS/SASS partials via aliases by [@​rmachado-studocu](https://togithub.com/rmachado-studocu) in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/251](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/251) - feat: customRender return sourceMap support by [@​qyzzzz](https://togithub.com/qyzzzz) in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/249](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/249) #### New Contributors - [@​rmachado-studocu](https://togithub.com/rmachado-studocu) made their first contribution in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/251](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/251) - [@​qyzzzz](https://togithub.com/qyzzzz) made their first contribution in [https://github.com/mrmckeb/typescript-plugin-css-modules/pull/249](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/249) **Full Changelog**: mrmckeb/typescript-plugin-css-modules@v5.0.2...v5.1.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/likec4/likec4). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This follows a pattern I've seen in other plugins, like this from
typescript-eslint-language-service:https://github.com/Quramy/typescript-eslint-language-service/blob/da3c201c94dd3c3a6a10f83cbbd54fae9d3db9e1/src/plugin-module-factory.ts#L9
Reasoning:
When this plugin seems to be causing WebStorm some headaches (or certain versions of TS, etc) and I need to work on something else for a while, I find it tedious to comment it out from the
pluginslist of ourtsconfig. The biggest headache there is that I often commit this commented-out code to my branches, only to have to revert it later when reviewing my PRs.