-
Notifications
You must be signed in to change notification settings - Fork 69
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
Feature Request: --declarationMap
option
#177
Comments
I would like to perform further static analysis based on the sorucemap created by this feature. For example, with this sourcemap, I can create stylelint rules to detect unused css rulesets from JavaScript. However, this would require a major rewrite of the typed-css-modules code. So I decided to fork typed-css-modules. From now on, I will work with the following fork: It would be great if |
|
I would like to share the development status of happy-css-modules so that you will not be surprised to learn about it at a later date. happy-css-modules is forked from typed-css-modules as it was developed from the PoC of this issue. Therefore, it inherits all commits from typed-css-modules. That is why you can find the names of the contributors of typed-css-modules in the license or in the list of contributors. happy-css-modules is based on the efforts of all contributors to typed-css-modules. I hope you all like this library. |
I would recommend happy-css-modules as a solution to this issue and close this issue. happy-css-modules has been in development for 2 years and is stable. If you need a definition jump, give it a try. |
Problem
Currently, when I click on a property imported from CSS Modules from VSCode, it jumps to
.d.ts
. Normally, users expect to jump to.css
, not to.d.ts
. Therefore, this behavior is confusing to users.It would be useful to be able to switch the jump destination to
.css
.Solution
Add the option
--declarationMap
to generate a source map for.d.ts
which map back to the original.css
. This allows VSCode to jump to the css file when clicking on a property.This option is inspired by the
--declarationMap
option oftsc
.PoC
You can try the PoC from the following:
There is no test yet, but I implemented the necessary features. There are no breaking changes. If the maintainers are interested this feature, please tell me. I will add tests and open a Pull Request.
2022-03-28.0.40.19.mov
The text was updated successfully, but these errors were encountered: