-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Upgrade to 4.0.0 breaks custom template for typescript #226
Comments
OK, there is actually a bug in Babel preventing us to create types using |
Is there any way around this in 4.0? |
@nathanforce not yet sorry.. |
The PR has been merged, we are now waiting for a Babel release, and then we will be able to support TypeScript and Flow templates 💃 |
Babel has been released, I added a test to valid that it is supported. I also documented it on the new website 👉 https://www.smooth-code.com/open-source/svgr/docs/typescript/ Be sure to have the latest version of |
Thanks for that. It addresses the issue partially. What about adding a
comment line which disables tslint? See my example I originally posted.
…On Sat, 24 Nov 2018, 21:48 Greg Bergé ***@***.*** wrote:
Closed #226 <#226>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#226 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADyZVUMat0Wxx7OjFfMNvmck8bnm1iwEks5uyQfQgaJpZM4YTrKt>
.
|
@avkonst I think comments are ignored by default by Babel template but there is an option to enable them. You should give a look to |
@neoziro it looks like the types are being stripped out when following that recipe in the docs. I have Here's my template:
and example output
I'm calling it like so: ../node_modules/.bin/svgr --ext tsx --template ./svgrTypescript.js -d ../src/alchemy/Icon/components/ ../src/alchemy/Icon/icons/ |
@neoziro nevermind, it seems using |
💬 Questions and Help
I used the following template to generate react typescript component using svgr 3.1.0. It generates the component with type safe properties and passes tsc and tslint of my project:
After upgrade to svgr 4.0.0 I have attempted to come up with babel template.ast code which would generate the same content, but it seems it is impossible, What ast template should I use to achieve exactly the same what I had before?
PS:
If svg looks like this:
My component looks like this with svgr 3.1.0 and the above template:
The text was updated successfully, but these errors were encountered: