typescript-plugin-css-modules
typescript-plugin-css-modules copied to clipboard
Readonly classes
I saw that sometime ago you added https://github.com/mrmckeb/typescript-plugin-css-modules/pull/103 readonly classes, but it got never merged.
Any chance that you'd accept a PR for this? With added 'readonly' option, so users can configure it?
hi @hakubo, I'll be honest, I can't remember why we didn't go ahead with that PR now. It's unfortunate that I didn't make a note at the time - sorry about that. I know we hit some issues with const/let at the time (See: https://github.com/mrmckeb/typescript-plugin-css-modules/issues/97), so it's possible that it was related to that, or it could be that I just ran short of time.
I'm more than happy for you to add it. It might be easier to use the Readonly<Type> utility.
I'm not sure that it needs to be an option. I was playing around then and I can't think of any risks - but very open to feedback/thoughts on that.
Hi! First off, love the project. Awesome work! Second, having all the properties be readonly makes a lot of sense and would love to try my hand at adding it
@OlaoluwaM, that would be a welcome addition - thanks. Obviously it wouldn't apply to named imports and only style objects, but I definitely think those should be readonly.