-
-
Notifications
You must be signed in to change notification settings - Fork 75
Fix: Create body for multiple call signatures (fixes #92) #142
Conversation
Thanks for the pull request, @soda0289! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
8144d7a
to
0eaf9f1
Compare
LGTM |
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.
I don't think we want to add a node type that represents nothing, as that's a bit confusing. Can you explain what you're trying to accomplish here?
There are two long standing issue #92 and #80 that cause exceptions to be thrown in escope when node.body is null. @JamesHenry attempted to submit a pull request, to escope, that would check for a node.body being set before attempting to visit its children (estools/escope#111) but it was denied because all FunctionExpression nodes must have a body. (estools/escope#111 (comment)). This pull request, as well as #142, simply add a body to over come this limitation. I think another suggested solution was to mark these emptied body functions as TypeAnnotations. (#92 (comment)). I feel like that would further complicate the issue as we would be unable to check rules like (space-before-func-parn and explicit-member-accessibility). We could always modify those rules to check type annotations as well. What are you thoughts? I was really just trying to find the simplest solution that would still allow most existing rules to work. |
@corbinu Maybe we should merge this, with extra comments, until eslint 4 is released. Unless there is a better solution. Being unable to use abstract methods and eslint sucks. I could look into monkey patching escope, as babel-eslint has done, but that sounds like a lot of work for a temporary solution. @nzakas Would it be possible to create a fork of escope we could use with eslint 4 or should I create one in my own account? I'd like to create a branch of this repo that uses eslint 4 to prepare for the changes. I think we have a bug for parsing comments that is blocked until the new version of eslint is released. |
Thanks again, @soda0289! We'll get back to you ASAP on how we want to proceed in the short-term. I would also love to address this. |
We are still going to fork escope to solve the higher-level problem. I'd like to do that soon as the other breaking changes in ESLint get finished up. I'm not a big fan of bandaid approaches that need to be removed later, so I'd rather wait than go with this approach. |
@nzakas No worries .. I think we are all just excited! This is the blocker preventing from switching my Typescript projects over :) So we are just jumping the gun a little! Doesn't help that in a recent release TSLint broke a bunch of stuff on me :( Thank you guys so much for the work that you do! |
Thanks for taking the time to explain the situation. Will wait for fork of escope and continue using a private fork until we are ready. |
@soda0289 I am going to switch my smoke tests to your fork for now as they should work much better! :) Edit: nvm just implodes later will wait for the escope work :) |
An attempt to fix the multiple call signatures exception by creating a body with the type of 'EmptyFunctionStatement'. Still need to add tests.
@JamesHenry What are your thoughts?