-
Notifications
You must be signed in to change notification settings - Fork 61
Use babylon typescript parser #143
Use babylon typescript parser #143
Conversation
Hey @asvetliakov, great for noticing this! Don't you think a stable version will soon be released though and that we could wait for that instead of putting a beta product into our production branch? |
For your personal use if this is currently bothering you, you can of course just use this branch and use that as your stylelint processor :) |
From my expirience babylon/babel@7 is pretty stable and works very good - i'm using it with typescript over the pretty big project. There are few issues but nothing major. Your call here merge it now or later, for my personal use i have private npm server, so it's not bothering me too much. |
I'd like to hear opinions from @mxstbr and @ismay on this, but I think my gut feeling tells me let's wait until a stable release, if Babel aren't comfortable putting this in a production environment yet I don't feel like we should be recommending it. If we end up not merging this then let's leave the code here though so if someone is in a similar situation to you and wants to use this "at their own risk" they can use this branch. |
This will thankfully get rid of the annoying What's the latest on babylon stability? 😃 |
@exogen I'm afraid it still seems quite far away https://github.com/babel/babel/milestone/14. Feel free to help them out finish it faster though ;) |
Just chiming in, the milestone you linked to is our "release after 7.0" list, we're just one issue away from 7.0-rc. Also, re: [email protected], we've been using it in Prettier for 11 months without issue :) |
@existentialism thanks for the input, maybe we should get this branch up to date and merged in then in that case as the above sounds pretty promising? |
@emilgoldsmith Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the package-lock.json
file again, it'd also be great if you could add it to the .gitignore
so folks don't re-add it later on 😊
Other than that this sounds great to me!
@mxstbr no we need the package-lock right? And it's already there, it's what specifies the exact versions we're using, no? Or should we stop using it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oopsie, I thought we were using yarn.lock
. Nevermind my comment then, this looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 definitely let us know if you run into any TS-related (or other) issues!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah think it looks good, I'm pretty swamped right now might find time to merge and deploy this in the near future but if anyone else wants to feel free.
The only thing I'm curious about is whether we are importing babel-traverse
somewhere and need to change that to @babel/traverse
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this should get changed to @babel/traverse
:
@existentialism good catch, updated |
I wonder how the CI was passing with a wrong import that... must have been a dependency of another package? |
devDependencies specifies babel-cli v6 which has dependency for babel-traverse. That's why CI/test run didn't catch it |
I just checked it out locally and when I run |
Thank you so much for helping us improve styled-components! Based on our Community Guidelines every person that has a PR of any kind merged is offered an invitation to the styled-components organization—that is you right now! Should you accept, you'll get write access to the main repository. (and a fancy |
New babylon@7 understands and parses typescript by the same way as flow. This have following advantages over the
typescript-eslint-parser
:vscode-stylelint
extension with unsupported TS versions, sincetypescript-eslint-parser
emits warning in this case, breaking the extension.