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

Add allow option to no-nodejs-modules rule (fixes #452) #509

Merged
merged 3 commits into from
Aug 23, 2016
Merged

Conversation

jfmengels
Copy link
Collaborator

@jfmengels jfmengels commented Aug 22, 2016

Add allow option to no-nodejs-modules rule (fixes #452)

cc @ljharb

@coveralls
Copy link

coveralls commented Aug 22, 2016

Coverage Status

Coverage increased (+0.003%) to 97.726% when pulling 972e62d on issue-452 into 7995581 on master.

@ljharb
Copy link
Member

ljharb commented Aug 22, 2016

Thanks, LGTM!

@coveralls
Copy link

coveralls commented Aug 22, 2016

Coverage Status

Coverage increased (+0.003%) to 97.726% when pulling 972e62d on issue-452 into 7995581 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.726% when pulling c2979bb on issue-452 into 7995581 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Aug 22, 2016

Coverage Status

Coverage increased (+0.003%) to 97.726% when pulling c2979bb on issue-452 into 7995581 on master.

@coveralls
Copy link

coveralls commented Aug 22, 2016

Coverage Status

Coverage increased (+0.003%) to 97.726% when pulling 435e312 on issue-452 into 7995581 on master.

@@ -2,7 +2,7 @@ import importType from '../core/importType'
import isStaticRequire from '../core/staticRequire'

function reportIfMissing(context, node, allowed, name) {
if (!allowed.includes(name) && importType(name, context) === 'builtin') {
if (allowed.indexOf(name) === -1 && importType(name, context) === 'builtin') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, bummer, I also thought Node v4 had includes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that surprising actually, since it's not even ES2015, but an ES2016 feature. I thought Babel would actually take care of this, but I guess was too hopeful (or it's just something to add). Anyway indexOf is fine.

@benmosher
Copy link
Member

I was thinking presets (like @graingert suggested) would be a good idea, but that can be a responsibility of shared configs. LGTM. 😎

@benmosher benmosher modified the milestones: 1.14.0, 1.15.0 Aug 23, 2016
@benmosher benmosher merged commit 387d333 into master Aug 23, 2016
@jfmengels jfmengels deleted the issue-452 branch August 23, 2016 09:32
@jfmengels
Copy link
Collaborator Author

2pm-wooyoung-relevant-11LMswao05npcs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add allow option to no-nodejs-modules
4 participants