Skip to content
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

Make no-native work with ??? #16

Merged

Conversation

lparry
Copy link
Contributor

@lparry lparry commented May 27, 2016

Sorry to be a pain, but I've found that the no-native part of this plugin does not pick up native promises in our project and I'm not 100% why.

At first I thought it might be because we're using the current version of eslint, when I saw this: https://github.com/eslint/eslint/pull/4648/files, but I've run the tests in this plugin against eslint 2 and while a bunch of them fail, the no-native ones pass. We use a huge mess of packages so trying to work out where the bad interaction/transpilation happens is a difficult task.

I've played around with the various lists of references on a scope and found that scope.implicit.left appears to include the native uses of Promise in my project, and in this plugin's tests, so I think we're going to run off this fork for now.

I thought maybe you have a better understanding of eslint internals and might be able to suggest what could cause some references to Promise to not appear in the the .through reference list, or if changing it to .implict.left is a bad idea

@xjamundx
Copy link
Contributor

Thanks for the feedback, I'll take a look tomorrow!
On Thu, May 26, 2016 at 8:27 PM Lucas Parry notifications@github.com
wrote:

Sorry to be a pain, but I've found that the no-native part of this plugin
does not pick up native promises in our project and I'm not 100% why.

At first I thought it might be because we're using the current version of
eslint, when I saw this: https://github.com/eslint/eslint/pull/4648/files,
but I've run the tests in this plugin against eslint 2 and while a bunch of
them fail, the no-native ones pass. We use a huge mess of packages so
trying to work out where the bad interaction/transpilation happens is a
difficult task.

I've played around with the various lists of references on a scope and
found that scope.implicit.left appears to include the native uses of
Promise in my project, and in this plugin's tests, so I think we're going
to run off this fork for now.

I thought maybe you have a better understanding of eslint internals and
might be able to suggest what could cause some references to Promise to
not appear in the the .through reference list, or if changing it to

.implict.left is a bad idea

You can view, comment on, or merge this pull request online at:

#16
Commit Summary

  • Make no-native work with eslint 2 too

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16, or mute the
thread
https://github.com/notifications/unsubscribe/AAPBf1Lq3Tz3ta-Cb4ck3rSRlI8Mwkpvks5qFmSlgaJpZM4IoJCP
.

@lparry lparry force-pushed the lparry/fix-no-native-scope branch from 403954e to 9c77fe1 Compare May 27, 2016 04:16
@xjamundx
Copy link
Contributor

xjamundx commented Jun 3, 2016

Okay looking at this now...

@xjamundx
Copy link
Contributor

xjamundx commented Jun 3, 2016

I think the problem is if you're in es6 mode, eslint will inject all of the globals into the scope from here:
https://github.com/sindresorhus/globals/blob/master/globals.json#L36

There is an alternative way to do this though without relying on scope.

@xjamundx
Copy link
Contributor

xjamundx commented Jun 3, 2016

I don't know how scopes work, but this code seems to work!

@xjamundx xjamundx merged commit 782b7f2 into eslint-community:master Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants