-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add support to Typescript's node types #72
Add support to Typescript's node types #72
Conversation
@ljharb Babel 7 dropped support for Node < 6. Maybe this should involve a major version bump? |
@vhfmag it'd be better if we could instead change CI to always run babel in latest node LTS, and then switch to the desired node version for running tests. |
@ljharb How would I do this? Generate an AST with |
oh no, not at all. I mean, |
Oh, understood. I tried transpiling both src and __tests__ folders with |
Babel 7 doesn't support node < 6; I don't think bundling. is going to be particularly great. It'd be nice if the workaround only lived in travis.yml. |
I just don't see how to make it possible to run tests with Node 4, they fail because of the incompatibility of Node 4 😞 |
ah - if jest 21 is the one that dropped support for node 4, then we'd have to stick to jest 20. The reality is that tape is the only test runner that reliably maintains support for older nodes, so eventually anything published will need to switch to it, but that's out of scope for this PR. |
I just checked and Jest 21 supports Node 4 just fine. I meant that |
ahhhhh gotcha. hmm. if there's a way to run the babel 6 parser in node 4, that'd be great - just as you say |
@ljharb done! Everything is working again for Node >= 4. 😄 |
I just submitted an issue to typescript-eslint and found out this pull request would resolve it. Are there any reasons against merging and releasing this TS-related improvement? |
It needs to be rebased. |
@ljharb done! I'll pinpoint the changes I've needed to do to make this easier to review. |
// the throw expectation wrapper at that time. | ||
// eslint-disable-next-line no-undef | ||
expect(() => { | ||
const runTest = () => { |
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.
Here I have extracted the expected-to-fail function into a variable to conditionally expect it to fail or not according to Babel version
I would like to know whether it is possible to issue a new package release soon. This is a dealbreaker for TypeScript developers. |
Working on it now @kripod |
published v2.1.0 |
Unfortunately, I'm still encountering the issue, even after upgrading to v2.1.0: typescript-eslint/typescript-eslint#437
|
Weird, this seems to be precisely the bug this patch was meant to fix. @kripod, mind to share the code that causes it? |
@vhfmag I linked my issue with code included in my previous comment. |
The issue seems to be that Adding @evcohen would you explain what is the expected behavior in this case? Thanks in advance! |
This PR:
^7
for Typescript supportbabylon
with@babel/parser
for Typescript supportTSNonNullExpression
andTSAsExpression
node type and tests themFixes #71