-
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
0.4.2 Generates exports that are not picked up by vscode autocomplete #63
Comments
@nanot1m Do you have any idea? |
@bali182, can you provide some code example? and what typescript version are you using? |
That's because in the old format each class name was exported individually and TypeScript picked them up for auto import. As for auto complete, it's working fine for both formats as you can clearly see on your demo. This could be somewhat solved by merging #66 (I've manually changed the However, the current state of #66 will give us another problem: I've simulated that change with multiple What needs to be done? Merge #66 but not before fixing the exported named which is basically the feature request on #27. |
@rfgamaral I might have chosen the wrong words when saying autocomplete is not working. From a developers point of view these are the 2 options: 1.) (Old) Start typing a class name, press Ctrl+Space, and see the classname immediately popping up In my opinion the second one is a step back for development speed. I'm not saying people might not like the second one, the purpose of this issue was to check if there is an option to generate the styles the old way (named exports) and if there isn't then ask for an option. |
What I'm trying to say is that your option 1 is more problematic than you think. Imagine this: file1.css .myClass {} file2.css .myClass {} file3.css .myClass {} Now you start typing IMO, the second option is not a step back, it's the way it should be and it's not even complete because we still have a similar problem since all those files are named |
Right, the issue you mention is absolutely valid, we ran into it a few times as well. However in my opinion it's something that can be easily avoided with a bit of care when naming classes, and I heavily prefer named exports. My point is, that these are all viable solutions. But would you be open for giving the user of the library the option to choose the right one for the project? I'm not familiar with the structure of this project, but I'd be happy to implement it & submit a PR. If you don't want this in the library, it's not a big deal either, we'll just stick to |
Yes, it can, but should you? From my point of view, that kinda defeats the purpose of CSS Modules. Why would you rather put extra effort into naming classes (one of two hardest things in programming 😆) instead of simply typing the name of the component you're working on followed by
Sure, but not everything is a best practice.
Sorry if I passed the wrong impression but I don't own this project and that's not my decision to make. I'm just giving my opinion on the matter.
Please don't take this the wrong way but I honestly think you're trying to solve the wrong problem. There's a lot of open issues on this project and I'm sure some improvements will come in future versions, and if the option you're requesting will ever be implemented on this project, I can't tell, it's no up to me. But I wouldn't want to be stuck to such old version. |
I have been using 0.3.7 up until now, which generated typings like this:
Now I tried to update to 0.4.2 which generates typings like this:
Is there an option to generate the typings like the older version? The newer one's exports are not picked up by VSCode's autocomplete, which was the biggest benefit for me besides not messing up class names accidentally.
The text was updated successfully, but these errors were encountered: