Closed TikiTDO closed 3 years ago
Hmm, Can you create a separate PR for this.
I think what you are suggesting for fix this issue https://github.com/codeBelt/generate-template-files/issues/52
Yeah, it's a slightly different approach than the one proposed, but that one seems like it would take a decent bit of refactoring.
The thing that really caught my eye with this lib is how it lets you write perfectly valid, type-safe files in typescript if you only restrict the use of case conversion to strings and comments. Unfortunately if you want to use case converters there are things you simply can't do.
For example, there is no way to make this snippet valid TS code.
This could be alleviated by allowing the case conversion tags to be underscored. In that case the above would look as follows:
This ends up being totally valid TS, and at worst maybe need a few lint rules disabled. There's also no reason why the two couldn't coexist, so there shouldn't be any risk to existing users.
I've already tested that it works here. If you'd like I can merge this code into my other PR.