-
-
Notifications
You must be signed in to change notification settings - Fork 208
FlowType "declare" bug: 'isSequenceExpression' of undefined #132
Comments
No, I don't think you are. I need to look into this; I don't think I did the |
Thanks @hzoo |
Oh this is that If I remove if (this.isDeclareModule() ||
this.isDeclareClass() ||
this.isDeclareFunction() ||
this.isDeclareVariable()) {
return this.dangerouslyRemove();
} then the error |
Awesome. Thank you. I'm looking forward to this in the next version released. |
support flow declarations correctly, lint - fixes #132
Ok should be fixed in |
Thanks @hzoo. But there are still some issues. Paste the following in index.js: declare class Native {
open():Response;
close():Response;
}
var test:Native;
test = test; You gonna get this error:
Which is not true, since it was already declared. |
Ok I did the wrong thing - will fix soon. |
@mcz Can you test again on master? I'm only adding a check for the top level identifier (Native in your case) and not doing anything for |
If you only put this into the index.js file: declare class Native {
open():Response;
close():Response;
} Than it will be complaining:
Which is not good, since declarations can be used standalone in Flowtype: On Wed, Jun 17, 2015 at 3:20 PM, Henry Zhu notifications@github.com wrote:
|
Well it's kind of an issue @mcz - I think that's why I ignored the flow declarations in the first place. If I create a variable for it - then it will complain it's not used. Unless somehow we check if there's only declarations |
Okay @hzoo. The point is it doesn't throw compiler error anymore. We ignore these declaration files in .eslintignore file. |
Ok should I do a new release for the change in master? I think we want to have the |
Summary: As @zpao suggested (reference #58) here is the new PR with the rules from [facebook/fbjs#49](facebook/fbjs#49). I'll still need some guidance on what should be Relay specific. At the moment with the current fbjs rules there is a lot of errors on [no-undef](http://eslint.org/docs/rules/no-undef.html) (example: $FlowIssue, $FixMe, $Enum and also when defining Flow types, this is related to [babel-eslint/known-issues](https://github.com/babel/babel-eslint#known-issues) - [babel-eslint#130](babel/babel-eslint#130) and [babel-eslint#132](babel/babel-eslint#132)) @josephsavona @zpao what are your thoughts? Closes #202 Reviewed By: @josephsavona Differential Revision: D2417828
Summary: As @zpao suggested (reference #58) here is the new PR with the rules from [facebook/fbjs#49](facebook/fbjs#49). I'll still need some guidance on what should be Relay specific. At the moment with the current fbjs rules there is a lot of errors on [no-undef](http://eslint.org/docs/rules/no-undef.html) (example: $FlowIssue, $FixMe, $Enum and also when defining Flow types, this is related to [babel-eslint/known-issues](https://github.com/babel/babel-eslint#known-issues) - [babel-eslint#130](babel/babel-eslint#130) and [babel-eslint#132](babel/babel-eslint#132)) @josephsavona @zpao what are your thoughts? Closes #202 Reviewed By: @josephsavona Differential Revision: D2417828
I made
|
@zertosh cool! added it to the readme |
support flow declarations correctly, lint - fixes babel/babel-eslint#132
How to reproduce it.
Create an empty node package with the following package.json
Run in the console:
Create an .eslintrc file with the following:
Create a index.js file with the following:
Finally run eslint:
And you will get the following:
Which is kind of odd. Am I missing something?
The text was updated successfully, but these errors were encountered: