-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: make no-cycle ignore Flow imports (fixes #1098) #1126
Conversation
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.
LGTM
src/rules/no-cycle.js
Outdated
@@ -30,6 +30,10 @@ module.exports = { | |||
function checkSourceValue(sourceNode, importer) { | |||
const imported = Exports.get(sourceNode.value, context) | |||
|
|||
if (sourceNode.parent.importKind === 'type') { |
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.
sourceNode.parent seems undefined
at times - many tests are failing
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.
Oops. Was running tests with --grep
option. Fixed.
@ljharb What is the fix here? eslint <= 4 does not provide the necessary AST information to describe type import. |
@gajus can eslint 4 parse the types at all? |
It is the However, I am not familiar enough with the internals of ESLint to say what is the reason ESLint <= 4 AST visitor does not inherit properties required to describe the import kind. All
|
Whats the status of this? Without this fix eslint-plugin-import is unusable if I have Flow in my project :( |
The tests need to pass before it can be merged. |
Of course, but does anybody work on it? Or this PR is abandoned? |
If you want to help finish it, please post a link here to your branch (not a new PR) and I’ll pull in your commits :-) |
Sorry, I probably didn't get how to do it properly, but here is my branch: https://github.com/PinkaminaDianePie/eslint-plugin-import/tree/fix/no-cycle-false-positive-for-flow-imports |
1 similar comment
Looks like the CI is failing because of unrelated tests. |
@gajus the travis failures are flukes; i've rerun them. the appveyor failures are unrelated, and likely in master. |
nice, i hope it will be merged finally :D |
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.
not obvious to me why this is necessary but I trust @gajus so 👌🏻😄
The issue appeared again in v2.17.1 |
@IhorSyerkov please file a new issue for that. |
It happens in v2.17.0, but not v2.16.0. @IhorSyerkov did you make that issue? Please link it to this one. |
No description provided.