-
-
Notifications
You must be signed in to change notification settings - Fork 75
Abstract method definition failure #80
Comments
Thanks @friedbizkvit! Referenced from the TS spec (because not documented there): microsoft/TypeScript#3578 @nzakas We currently do not have a natural way to record this info and are skipping the modifier node, and there is no precedent in flow or other tools. TypeScript records this, as with many other things such as the How do you feel about a simple |
My only concern is for rules that look for |
Good thinking! As I say we are on our own in terms of defining this in an ESTree AST so I think |
PR coming up with that, and |
Hmm, I'm not sure agree. Abstract class classes have no tangible difference from regular classes wheras abstract methods do. I think the summation of your point, though, is that it makes sense to represent abstract things in the same way, which makes sense. So I think the larger question is this: are there core rules that should run on abstract classes/methods or not? |
To be honest, I only use classes when I have to (e.g. when using Angular 2) and I was not actually aware of this For those reasons I was leaning towards a new node type for now, and then potentially addressing it in future if people report that there are core rules relating to classes that they would like to run on their abstract classes. Even though it might lead to future work/issues being reported, |
Fair enough. |
@nzakas 0.3.1 wasn't published on npm. Is it jenkins fall? |
I'm still seeing this problem with 0.3.1. export abstract class Foo {
abstract bar();
} Gives:
|
@friedbizkvit hmm yeah, we did have problems during the release, and I wasn't feeling good so I didn't spend a lot of time trying to figure things out. I just manually pushed now, so hopefully this fix has now been released. |
@nzakas I can confirm this is still an issue. It looks like escope is still reaching the |
Is there any way around these errors to get it functional (albeit not supported)? E.g. a development build or something.
|
If you change that line to I will look into writing a pull request this weekend, unless a better solution comes up. |
Looks like this pull request was attempted estools/escope#111 and denied. We might need to change the node type to AbstractFunctionExpression instead of FunctionExpression so it will skip going down into escope. |
@soda0289 thank you for this. On the assumption that what you have done is a work around rather than a valid fix (because I know nothing about any of this AST stuff) I think the work around you have proposed should be accepted to get it functional, even if this issue remains open to remove the workaround once escope is 'fixed' officially. |
Just FYI, we have begun work on the escope fork. It will take a little while to get everything in order, but you can expect to see a resolution to this issue soon. |
In newer versions of TypeScript the FunctionExpression node contains a null body. This will cause some rules to fail as they expect FunctionExpression to have a body and is defined that way in the ESTree spec.
This issue is no longer blocked by escope since ESLint v4. Please see issue #253 for rules that are incompatible. |
What version of TypeScript are you using?
1.8.10
What version of
typescript-eslint-parser
are you using?0.2.0
What code were you trying to parse?
What did you expect to happen?
Correct behavior
What happened?
The text was updated successfully, but these errors were encountered: