import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.
MIT License
5.57k stars 1.57k forks source link

1.10.1 breaks ESLint 2.13.1 and Node < 4 #415

Closed rhettlivingston closed 8 years ago

rhettlivingston commented 8 years ago

I work with Meteor which is just starting to adopt Node 4 (in Beta). We have many sample apps running Node 0.10.x.

I just downloaded the main Meteor todos app, ran "npm install" and got eslint-plugin-import 1.10.1 installed with ESLint 2.13.1. This produced the following error...

rhett@dreamshot:~/oob/meteors/todos1.3$ meteor npm run lint

> @ lint /home/rhett/oob/meteors/todos1.3
> eslint .

/home/rhett/oob/meteors/todos1.3/node_modules/eslint-plugin-import/lib/index.js:6
const rules = exports.rules = {
^^^^^

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-import". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-import is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-import@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "node" "/home/rhett/.meteor/packages/meteor-tool/.1.3.0_3.139i3kk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm" "run" "lint"
npm ERR! node v0.10.43
npm ERR! npm  v2.14.22
npm ERR! code ELIFECYCLE
npm ERR! @ lint: `eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ lint script 'eslint .'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/rhett/oob/meteors/todos1.3/npm-debug.log

I'm no NPM expert, but do you perhaps need a node 4 requirement in your package.json now?

"engines": {
    "node": ">=4"
  }

Reverting to 1.10.0 fixed my problem. Also, running with Node 4 fixed it, but that isn't something our user base at large is ready for yet.

rhettlivingston commented 8 years ago

I'm also running into a problem with 1.10.0 where if the packages were installed with NPM 2.14.22, they work under either NPM 2.14.22 or under NPM 3.9.6. But if they are installed with NPM 3.9.6, I get the following.

0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli   '/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm',
1 verbose cli   'run',
1 verbose cli   'lint' ]
2 info using npm@3.9.6
3 info using node@v0.10.45
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info lifecycle @~prelint: @
6 silly lifecycle @~prelint: no script for prelint, continuing
7 info lifecycle @~lint: @
8 verbose lifecycle @~lint: unsafe-perm in lifecycle true
9 verbose lifecycle @~lint: PATH: /home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/bin/node-gyp-bin:/home/rhett/oob/meteors/todos1.3.4.1/node_modules/.bin:/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin:/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin:/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~lint: CWD: /home/rhett/oob/meteors/todos1.3.4.1
11 silly lifecycle @~lint: Args: [ '-c', 'eslint .' ]
12 silly lifecycle @~lint: Returned: code: 1  signal: null
13 info lifecycle @~lint: Failed to exec lint script
14 verbose stack Error: @ lint: `eslint .`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/utils/lifecycle.js:245:16)
14 verbose stack     at EventEmitter.emit (events.js:98:17)
14 verbose stack     at ChildProcess.<anonymous> (/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at ChildProcess.emit (events.js:98:17)
14 verbose stack     at maybeClose (child_process.js:766:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
15 verbose pkgid @
16 verbose cwd /home/rhett/oob/meteors/todos1.3.4.1
17 error Linux 4.4.0-28-generic
18 error argv "node" "/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm" "run" "lint"
19 error node v0.10.45
20 error npm  v3.9.6
21 error code ELIFECYCLE
22 error @ lint: `eslint .`
22 error Exit status 1
23 error Failed at the @ lint script 'eslint .'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     eslint .
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

This plus the above problem leaves me in a position of not knowing how to get this to work with Meteor v1.3.4.1's combination of NPM 3.9.6 and Node 0.10.45. I can't really tell all of the users to run one NPM for the npm install and another for everything else.

benmosher commented 8 years ago

Bizarre. Nothing in master should fail against Node 0.10. Travis would have complained.

I suspect I botched the publish somehow when I was switching between master and v2 branches.

I will take a look in the morning. 1.10.x should support Node 0.10.

benmosher commented 8 years ago

Actually I was too terrified to let it go until morning. Something horrible definitely happened with my publish of 1.10.1.

Republished as 1.10.2.

rhettlivingston commented 8 years ago

Thank you! That will stop problems with those of our users who have not yet moved up to our latest version. I verified that the Meteor 1.3 products that use Node v0.10.43 and npm v2.14.22 are happy with eslint 2.13.1 and eslint-plugin-import 1.10.2.

The narrower issue in my second comment does, however, persist. This seems to be a factor of installing with NPM v3.9.6 and running with NPM v3.9.6 and Node v0.10.43. If I run with Node v4.4.7 instead, even without reinstalling, the problem goes away. This effects anyone using the latest released version of Meteor, v1.3.4.1.

Looking back, I see that I probably should have given you the output, not the npm-debug.log. Here is the output running with eslint-plugin-import 1.10.2 that indicates an issue at eslint-plugin-import/lib/rules/export.js:93:149

rhett@dreamshot:~/oob/meteors/todos1.3.4.1$ ../mymeteor npm run lint
Meteor bundle is correct for 1.3.4.1: packages/meteor-tool/1.3.4_1/mt-os.linux.x86_64/meteor

> @ lint /home/rhett/oob/meteors/todos1.3.4.1
> eslint .

Property 'Symbol(Symbol.iterator)_9.nz0k7st2kbe53ik9' of object [object Map] is not a function
TypeError: Property 'Symbol(Symbol.iterator)_9.nz0k7st2kbe53ik9' of object [object Map] is not a function
    at EventEmitter.ProgramExit (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint-plugin-import/lib/rules/export.js:93:149)
    at EventEmitter.emit (events.js:117:20)
    at NodeEventGenerator.leaveNode (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/util/node-event-generator.js:49:22)
    at CodePathAnalyzer.leaveNode (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:627:23)
    at CommentEventGenerator.leaveNode (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/util/comment-event-generator.js:110:23)
    at Controller.traverser.traverse.leave (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/eslint.js:908:36)
    at Controller.__execute (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/estraverse/estraverse.js:491:28)
    at Controller.Traverser.controller.traverse (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/util/traverser.js:36:33)
    at EventEmitter.module.exports.api.verify (/home/rhett/oob/meteors/todos1.3.4.1/node_modules/eslint/lib/eslint.js:902:23)

npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "node" "/home/rhett/.meteor/packages/meteor-tool/.1.3.4_1.tskw1g++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm" "run" "lint"
npm ERR! node v0.10.45
npm ERR! npm  v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! @ lint: `eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ lint script 'eslint .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/rhett/oob/meteors/todos1.3.4.1/npm-debug.log
danharper commented 8 years ago

👍 thanks for the quick update. All good now.

benmosher commented 8 years ago

@rhettlivingston ah, sorry. got tunnel vision after seeing const in the first bit. will look into that too!

benmosher commented 8 years ago

Strange. I'm not sure how that would happen. Sounds like a weird bug with the es6-symbol and es6-map polyfills.

Travis installs with npm@3 before testing on 0.10, and seems to be satisfied. So I'm not sure how to debug.

benmosher commented 8 years ago

Is there an implication here that you don't see this issue with <= v1.9.x? Just trying to figure out when this issue might have crept in.

rhettlivingston commented 8 years ago

I marched this all the way back to eslint-plugin-import 1.7.0 - always the same problem.

Here is the translated code in case it helps.

    'Program:exit': function ProgramExit() {
      for (var _iterator2 = named, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
        var _ref2;

Also, in case it matters, I appear to have es-map 0.1.4 and es-symbol 3.1.0.

├─┬ eslint@2.13.1 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├── has-ansi@2.0.0 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├─┬ concat-stream@1.5.1 
│ │ ├── inherits@2.0.1 
│ │ ├─┬ readable-stream@2.0.6 
│ │ │ ├── core-util-is@1.0.2 
│ │ │ ├── process-nextick-args@1.0.7 
│ │ │ ├── string_decoder@0.10.31 
│ │ │ └── util-deprecate@1.0.2 
│ │ └── typedarray@0.0.6 
│ ├─┬ debug@2.2.0 
│ │ └── ms@0.7.1 
│ ├─┬ doctrine@1.2.2 
│ │ ├── esutils@1.1.6 
│ │ └── isarray@1.0.0 
│ ├─┬ es6-map@0.1.4 
│ │ ├── d@0.1.1 
│ │ ├── es5-ext@0.10.12 
│ │ ├── es6-iterator@2.0.0 
│ │ └── event-emitter@0.3.4 
│ ├─┬ escope@3.6.0 
│ │ ├── es6-weak-map@2.0.1 
│ │ └─┬ esrecurse@4.1.0 
│ │   └── estraverse@4.1.1 
│ ├─┬ espree@3.1.6 
│ │ ├── acorn@3.2.0 
│ │ └── acorn-jsx@3.0.1 
│ ├── estraverse@4.2.0 
│ ├── esutils@2.0.2 
│ ├─┬ file-entry-cache@1.2.4 
│ │ └─┬ flat-cache@1.0.10 
│ │   ├─┬ del@2.2.1 
│ │   │ ├─┬ globby@5.0.0 
│ │   │ │ ├─┬ array-union@1.0.2 
│ │   │ │ │ └── array-uniq@1.0.3 
│ │   │ │ └── arrify@1.0.1 
│ │   │ ├── is-path-cwd@1.0.0 
│ │   │ ├─┬ is-path-in-cwd@1.0.0 
│ │   │ │ └── is-path-inside@1.0.0 
│ │   │ ├── pify@2.3.0 
│ │   │ └── rimraf@2.5.3 
│ │   ├── graceful-fs@4.1.4 
│ │   ├── read-json-sync@1.1.1 
│ │   └── write@0.2.1 
│ ├─┬ glob@7.0.5 
│ │ ├── fs.realpath@1.0.0 
│ │ ├─┬ inflight@1.0.5 
│ │ │ └── wrappy@1.0.2 
│ │ ├─┬ minimatch@3.0.2 
│ │ │ └─┬ brace-expansion@1.1.5 
│ │ │   ├── balanced-match@0.4.1 
│ │ │   └── concat-map@0.0.1 
│ │ └── once@1.3.3 
│ ├── globals@9.9.0 
│ ├── ignore@3.1.3 
│ ├── imurmurhash@0.1.4 
│ ├─┬ inquirer@0.12.0 
│ │ ├── ansi-escapes@1.4.0 
│ │ ├── ansi-regex@2.0.0 
│ │ ├─┬ cli-cursor@1.0.2 
│ │ │ └─┬ restore-cursor@1.0.1 
│ │ │   ├── exit-hook@1.1.1 
│ │ │   └── onetime@1.1.0 
│ │ ├── cli-width@2.1.0 
│ │ ├── figures@1.7.0 
│ │ ├─┬ readline2@1.0.1 
│ │ │ ├─┬ code-point-at@1.0.0 
│ │ │ │ └── number-is-nan@1.0.0 
│ │ │ ├── is-fullwidth-code-point@1.0.0 
│ │ │ └── mute-stream@0.0.5 
│ │ ├── run-async@0.1.0 
│ │ ├── rx-lite@3.1.2 
│ │ ├── string-width@1.0.1 
│ │ └── through@2.3.8 
│ ├─┬ is-my-json-valid@2.13.1 
│ │ ├── generate-function@2.0.0 
│ │ ├─┬ generate-object-property@1.2.0 
│ │ │ └── is-property@1.0.2 
│ │ ├── jsonpointer@2.0.0 
│ │ └── xtend@4.0.1 
│ ├─┬ is-resolvable@1.0.0 
│ │ └── tryit@1.0.2 
│ ├─┬ js-yaml@3.6.1 
│ │ ├─┬ argparse@1.0.7 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@2.7.2 
│ ├─┬ json-stable-stringify@1.0.1 
│ │ └── jsonify@0.0.0 
│ ├─┬ levn@0.3.0 
│ │ ├── prelude-ls@1.1.2 
│ │ └── type-check@0.3.2 
│ ├── lodash@4.13.1 
│ ├─┬ mkdirp@0.5.1 
│ │ └── minimist@0.0.8 
│ ├─┬ optionator@0.8.1 
│ │ ├── deep-is@0.1.3 
│ │ ├── fast-levenshtein@1.1.3 
│ │ └── wordwrap@1.0.0 
│ ├── path-is-absolute@1.0.0 
│ ├── path-is-inside@1.0.1 
│ ├── pluralize@1.2.1 
│ ├── progress@1.1.8 
│ ├─┬ require-uncached@1.0.2 
│ │ ├─┬ caller-path@0.1.0 
│ │ │ └── callsites@0.2.0 
│ │ └── resolve-from@1.0.1 
│ ├── shelljs@0.6.0 
│ ├── strip-json-comments@1.0.4 
│ ├─┬ table@3.7.8 
│ │ ├── bluebird@3.4.1 
│ │ ├── slice-ansi@0.0.4 
│ │ ├── tv4@1.2.7 
│ │ └── xregexp@3.1.1 
│ ├── text-table@0.2.0 
│ └─┬ user-home@2.0.0 
│   └── os-homedir@1.0.1 
├─┬ eslint-config-airbnb@9.0.1 
│ └── eslint-config-airbnb-base@3.0.1 
├─┬ eslint-import-resolver-meteor@0.2.4 
│ ├── object-assign@4.1.0 
│ └── resolve@1.1.7 
├─┬ eslint-plugin-import@1.10.2 
│ ├── builtin-modules@1.1.1 
│ ├── contains-path@0.1.0 
│ ├── es6-set@0.1.4 
│ ├── es6-symbol@3.1.0 
│ ├── eslint-import-resolver-node@0.2.1 
│ ├─┬ lodash.cond@4.4.0 
│ │ ├─┬ lodash._baseiteratee@4.7.0 
│ │ │ └── lodash._stringtopath@4.8.0 
│ │ └── lodash.rest@4.0.3 
│ ├─┬ lodash.endswith@4.1.0 
│ │ ├── lodash._basetostring@4.12.0 
│ │ └── lodash.tostring@4.1.3 
│ ├─┬ lodash.find@4.4.0 
│ │ ├── lodash._baseeach@4.1.3 
│ │ ├── lodash._basefind@3.0.0 
│ │ └── lodash._basefindindex@3.6.0 
│ ├── lodash.findindex@4.4.0 
│ ├─┬ pkg-dir@1.0.0 
│ │ └─┬ find-up@1.1.2 
│ │   ├── path-exists@2.1.0 
│ │   └─┬ pinkie-promise@2.0.1 
│ │     └── pinkie@2.0.4 
│ └── pkg-up@1.0.0 
├─┬ eslint-plugin-jsx-a11y@1.5.3 
│ ├── damerau-levenshtein@1.0.0 
│ └── jsx-ast-utils@1.2.1 
├─┬ eslint-plugin-meteor@3.6.0 
│ ├─┬ babel-polyfill@6.9.0 
│ │ ├── babel-regenerator-runtime@6.5.0 
│ │ ├─┬ babel-runtime@6.9.2 
│ │ │ └── regenerator-runtime@0.9.5 
│ │ └── core-js@2.4.0 
│ ├─┬ babel-register@6.8.0 
│ │ ├─┬ babel-core@6.10.4 
│ │ │ ├─┬ babel-code-frame@6.11.0 
│ │ │ │ └── js-tokens@2.0.0 
│ │ │ ├─┬ babel-generator@6.11.0 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └─┬ detect-indent@3.0.1 
│ │ │ │   ├── get-stdin@4.0.1 
│ │ │ │   ├── minimist@1.2.0 
│ │ │ │   └─┬ repeating@1.1.3 
│ │ │ │     └── is-finite@1.0.1 
│ │ │ ├── babel-helpers@6.8.0 
│ │ │ ├── babel-messages@6.8.0 
│ │ │ ├── babel-register@6.9.0 
│ │ │ ├── babel-runtime@6.9.2 
│ │ │ ├─┬ babel-template@6.9.0 
│ │ │ │ └── babel-runtime@6.9.2 
│ │ │ ├─┬ babel-traverse@6.10.4 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └── globals@8.18.0 
│ │ │ ├─┬ babel-types@6.11.1 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └── to-fast-properties@1.0.2 
│ │ │ ├── babylon@6.8.3 
│ │ │ ├── convert-source-map@1.2.0 
│ │ │ ├── json5@0.4.0 
│ │ │ ├── path-exists@1.0.0 
│ │ │ ├── private@0.1.6 
│ │ │ ├── shebang-regex@1.0.0 
│ │ │ ├── slash@1.0.0 
│ │ │ └── source-map@0.5.6 
│ │ ├─┬ home-or-tmp@1.0.0 
│ │ │ ├── os-tmpdir@1.0.1 
│ │ │ └── user-home@1.1.1 
│ │ ├── lodash@3.10.1 
│ │ ├── path-exists@1.0.0 
│ │ └─┬ source-map-support@0.2.10 
│ │   └─┬ source-map@0.1.32 
│ │     └── amdefine@1.0.0 
│ ├── babel-runtime@6.6.1 
│ ├─┬ invariant@2.2.1 
│ │ └─┬ loose-envify@1.2.0 
│ │   └── js-tokens@1.0.3 
│ ├─┬ lodash.memoize@4.1.0 
│ │ └── lodash._root@3.0.1 
│ └── path-exists@3.0.0 
├── eslint-plugin-react@5.2.2 

What is the code doing at that point? It looks to me as if it is trying to traverse an es6-map of named exports that it has collected in linting a module. We certainly do have a lot of named exports in our code.

But, the routine is titled "ProgramExit", so is this actually a check after linting all modules?

rhettlivingston commented 8 years ago

Just to be sure... I just duplicated this completely outside of the meteor environment with a very stripped down package.json and basically empty .js file as follows:

rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ ls -l
total 8
-rw-rw-r-- 1 rhett rhett 558 Jul  5 14:01 package.json
-rw-rw-r-- 1 rhett rhett  14 Jul  5 13:56 sample.js
rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ cat package.json 
{
  "scripts": {
    "lint": "eslint ."
  },
  "dependencies": {
  },
  "devDependencies": {
    "eslint": "^2.13.1",
    "eslint-config-airbnb": "^9.0.1",
    "eslint-import-resolver-meteor": "^0.2.4",
    "eslint-plugin-import": ">1.10.1",
    "eslint-plugin-jsx-a11y": "^1.5.3",
    "eslint-plugin-meteor": "^3.6.0",
    "eslint-plugin-react": "^5.2.2"
  },
  "eslintConfig": {
    "plugins": [
      "meteor"
    ],
    "extends": [
      "airbnb",
      "plugin:meteor/recommended"
    ],
    "settings": {
      "import/resolver": "meteor"
    }
  }
}
rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ cat sample.js 
// empty file
rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ npm version
{ npm: '3.9.6',
  ares: '1.9.0-DEV',
  http_parser: '1.2',
  modules: '11',
  node: '0.10.45',
  openssl: '1.0.1t',
  uv: '0.10.36',
  v8: '3.14.5.9',
  zlib: '1.2.8' }
rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ npm install
/home/rhett/oob/meteors/debug-eslint-plugin-import
├─┬ eslint@2.13.1 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├── has-ansi@2.0.0 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├─┬ concat-stream@1.5.1 
│ │ ├── inherits@2.0.1 
│ │ ├─┬ readable-stream@2.0.6 
│ │ │ ├── core-util-is@1.0.2 
│ │ │ ├── process-nextick-args@1.0.7 
│ │ │ ├── string_decoder@0.10.31 
│ │ │ └── util-deprecate@1.0.2 
│ │ └── typedarray@0.0.6 
│ ├─┬ debug@2.2.0 
│ │ └── ms@0.7.1 
│ ├─┬ doctrine@1.2.2 
│ │ ├── esutils@1.1.6 
│ │ └── isarray@1.0.0 
│ ├─┬ es6-map@0.1.4 
│ │ ├── d@0.1.1 
│ │ ├── es5-ext@0.10.12 
│ │ ├── es6-iterator@2.0.0 
│ │ └── event-emitter@0.3.4 
│ ├─┬ escope@3.6.0 
│ │ ├── es6-weak-map@2.0.1 
│ │ └─┬ esrecurse@4.1.0 
│ │   └── estraverse@4.1.1 
│ ├─┬ espree@3.1.6 
│ │ ├── acorn@3.2.0 
│ │ └── acorn-jsx@3.0.1 
│ ├── estraverse@4.2.0 
│ ├── esutils@2.0.2 
│ ├─┬ file-entry-cache@1.2.4 
│ │ └─┬ flat-cache@1.0.10 
│ │   ├─┬ del@2.2.1 
│ │   │ ├─┬ globby@5.0.0 
│ │   │ │ ├─┬ array-union@1.0.2 
│ │   │ │ │ └── array-uniq@1.0.3 
│ │   │ │ └── arrify@1.0.1 
│ │   │ ├── is-path-cwd@1.0.0 
│ │   │ ├─┬ is-path-in-cwd@1.0.0 
│ │   │ │ └── is-path-inside@1.0.0 
│ │   │ ├── pify@2.3.0 
│ │   │ └── rimraf@2.5.3 
│ │   ├── graceful-fs@4.1.4 
│ │   ├── read-json-sync@1.1.1 
│ │   └── write@0.2.1 
│ ├─┬ glob@7.0.5 
│ │ ├── fs.realpath@1.0.0 
│ │ ├─┬ inflight@1.0.5 
│ │ │ └── wrappy@1.0.2 
│ │ ├─┬ minimatch@3.0.2 
│ │ │ └─┬ brace-expansion@1.1.5 
│ │ │   ├── balanced-match@0.4.1 
│ │ │   └── concat-map@0.0.1 
│ │ └── once@1.3.3 
│ ├── globals@9.9.0 
│ ├── ignore@3.1.3 
│ ├── imurmurhash@0.1.4 
│ ├─┬ inquirer@0.12.0 
│ │ ├── ansi-escapes@1.4.0 
│ │ ├── ansi-regex@2.0.0 
│ │ ├─┬ cli-cursor@1.0.2 
│ │ │ └─┬ restore-cursor@1.0.1 
│ │ │   ├── exit-hook@1.1.1 
│ │ │   └── onetime@1.1.0 
│ │ ├── cli-width@2.1.0 
│ │ ├── figures@1.7.0 
│ │ ├─┬ readline2@1.0.1 
│ │ │ ├─┬ code-point-at@1.0.0 
│ │ │ │ └── number-is-nan@1.0.0 
│ │ │ ├── is-fullwidth-code-point@1.0.0 
│ │ │ └── mute-stream@0.0.5 
│ │ ├── run-async@0.1.0 
│ │ ├── rx-lite@3.1.2 
│ │ ├── string-width@1.0.1 
│ │ └── through@2.3.8 
│ ├─┬ is-my-json-valid@2.13.1 
│ │ ├── generate-function@2.0.0 
│ │ ├─┬ generate-object-property@1.2.0 
│ │ │ └── is-property@1.0.2 
│ │ ├── jsonpointer@2.0.0 
│ │ └── xtend@4.0.1 
│ ├─┬ is-resolvable@1.0.0 
│ │ └── tryit@1.0.2 
│ ├─┬ js-yaml@3.6.1 
│ │ ├─┬ argparse@1.0.7 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@2.7.2 
│ ├─┬ json-stable-stringify@1.0.1 
│ │ └── jsonify@0.0.0 
│ ├─┬ levn@0.3.0 
│ │ ├── prelude-ls@1.1.2 
│ │ └── type-check@0.3.2 
│ ├── lodash@4.13.1 
│ ├─┬ mkdirp@0.5.1 
│ │ └── minimist@0.0.8 
│ ├─┬ optionator@0.8.1 
│ │ ├── deep-is@0.1.3 
│ │ ├── fast-levenshtein@1.1.3 
│ │ └── wordwrap@1.0.0 
│ ├── path-is-absolute@1.0.0 
│ ├── path-is-inside@1.0.1 
│ ├── pluralize@1.2.1 
│ ├── progress@1.1.8 
│ ├─┬ require-uncached@1.0.2 
│ │ ├─┬ caller-path@0.1.0 
│ │ │ └── callsites@0.2.0 
│ │ └── resolve-from@1.0.1 
│ ├── shelljs@0.6.0 
│ ├── strip-json-comments@1.0.4 
│ ├─┬ table@3.7.8 
│ │ ├── bluebird@3.4.1 
│ │ ├── slice-ansi@0.0.4 
│ │ ├── tv4@1.2.7 
│ │ └── xregexp@3.1.1 
│ ├── text-table@0.2.0 
│ └─┬ user-home@2.0.0 
│   └── os-homedir@1.0.1 
├─┬ eslint-config-airbnb@9.0.1 
│ └── eslint-config-airbnb-base@3.0.1 
├─┬ eslint-import-resolver-meteor@0.2.4 
│ ├── object-assign@4.1.0 
│ └── resolve@1.1.7 
├─┬ eslint-plugin-import@1.10.2 
│ ├── builtin-modules@1.1.1 
│ ├── contains-path@0.1.0 
│ ├── es6-set@0.1.4 
│ ├── es6-symbol@3.1.0 
│ ├── eslint-import-resolver-node@0.2.1 
│ ├─┬ lodash.cond@4.4.0 
│ │ ├─┬ lodash._baseiteratee@4.7.0 
│ │ │ └── lodash._stringtopath@4.8.0 
│ │ └── lodash.rest@4.0.3 
│ ├─┬ lodash.endswith@4.1.0 
│ │ ├── lodash._basetostring@4.12.0 
│ │ └── lodash.tostring@4.1.3 
│ ├─┬ lodash.find@4.4.0 
│ │ ├── lodash._baseeach@4.1.3 
│ │ ├── lodash._basefind@3.0.0 
│ │ └── lodash._basefindindex@3.6.0 
│ ├── lodash.findindex@4.4.0 
│ ├─┬ pkg-dir@1.0.0 
│ │ └─┬ find-up@1.1.2 
│ │   ├── path-exists@2.1.0 
│ │   └─┬ pinkie-promise@2.0.1 
│ │     └── pinkie@2.0.4 
│ └── pkg-up@1.0.0 
├─┬ eslint-plugin-jsx-a11y@1.5.3 
│ ├── damerau-levenshtein@1.0.0 
│ └── jsx-ast-utils@1.2.1 
├─┬ eslint-plugin-meteor@3.6.0 
│ ├─┬ babel-polyfill@6.9.0 
│ │ ├── babel-regenerator-runtime@6.5.0 
│ │ ├─┬ babel-runtime@6.9.2 
│ │ │ └── regenerator-runtime@0.9.5 
│ │ └── core-js@2.4.0 
│ ├─┬ babel-register@6.8.0 
│ │ ├─┬ babel-core@6.10.4 
│ │ │ ├─┬ babel-code-frame@6.11.0 
│ │ │ │ └── js-tokens@2.0.0 
│ │ │ ├─┬ babel-generator@6.11.0 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └─┬ detect-indent@3.0.1 
│ │ │ │   ├── get-stdin@4.0.1 
│ │ │ │   ├── minimist@1.2.0 
│ │ │ │   └─┬ repeating@1.1.3 
│ │ │ │     └── is-finite@1.0.1 
│ │ │ ├── babel-helpers@6.8.0 
│ │ │ ├── babel-messages@6.8.0 
│ │ │ ├── babel-register@6.9.0 
│ │ │ ├── babel-runtime@6.9.2 
│ │ │ ├─┬ babel-template@6.9.0 
│ │ │ │ └── babel-runtime@6.9.2 
│ │ │ ├─┬ babel-traverse@6.10.4 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └── globals@8.18.0 
│ │ │ ├─┬ babel-types@6.11.1 
│ │ │ │ ├── babel-runtime@6.9.2 
│ │ │ │ └── to-fast-properties@1.0.2 
│ │ │ ├── babylon@6.8.3 
│ │ │ ├── convert-source-map@1.2.0 
│ │ │ ├── json5@0.4.0 
│ │ │ ├── path-exists@1.0.0 
│ │ │ ├── private@0.1.6 
│ │ │ ├── shebang-regex@1.0.0 
│ │ │ ├── slash@1.0.0 
│ │ │ └── source-map@0.5.6 
│ │ ├─┬ home-or-tmp@1.0.0 
│ │ │ ├── os-tmpdir@1.0.1 
│ │ │ └── user-home@1.1.1 
│ │ ├── lodash@3.10.1 
│ │ ├── path-exists@1.0.0 
│ │ └─┬ source-map-support@0.2.10 
│ │   └─┬ source-map@0.1.32 
│ │     └── amdefine@1.0.0 
│ ├── babel-runtime@6.6.1 
│ ├─┬ invariant@2.2.1 
│ │ └─┬ loose-envify@1.2.0 
│ │   └── js-tokens@1.0.3 
│ ├─┬ lodash.memoize@4.1.0 
│ │ └── lodash._root@3.0.1 
│ └── path-exists@3.0.0 
└── eslint-plugin-react@5.2.2 

npm WARN debug-eslint-plugin-import No description
npm WARN debug-eslint-plugin-import No repository field.
npm WARN debug-eslint-plugin-import No license field.
rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ npm run lint

> @ lint /home/rhett/oob/meteors/debug-eslint-plugin-import
> eslint .

Property 'Symbol(Symbol.iterator)_9.2jbx8n5fx2do0f6r' of object [object Map] is not a function
TypeError: Property 'Symbol(Symbol.iterator)_9.2jbx8n5fx2do0f6r' of object [object Map] is not a function
    at EventEmitter.ProgramExit (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint-plugin-import/lib/rules/export.js:93:149)
    at EventEmitter.emit (events.js:117:20)
    at NodeEventGenerator.leaveNode (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/util/node-event-generator.js:49:22)
    at CodePathAnalyzer.leaveNode (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:627:23)
    at CommentEventGenerator.leaveNode (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/util/comment-event-generator.js:110:23)
    at Controller.traverser.traverse.leave (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/eslint.js:908:36)
    at Controller.__execute (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/estraverse/estraverse.js:491:28)
    at Controller.Traverser.controller.traverse (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/util/traverser.js:36:33)
    at EventEmitter.module.exports.api.verify (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint/lib/eslint.js:902:23)

npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "node" "/home/rhett/.nvm/v0.10.45/bin/npm" "run" "lint"
npm ERR! node v0.10.45
npm ERR! npm  v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! @ lint: `eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ lint script 'eslint .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/rhett/oob/meteors/debug-eslint-plugin-import/npm-debug.log
rhettlivingston commented 8 years ago

OK. Progress. You may get off the hook. If I don't tell ESLint about the meteor plugin, eslint-plugin-meteor, the problem goes away. The following package.json works even though I still included eslint-plugin-meteor in the devDependencies. I just pulled out the lines telling ESLint to use it.

I will open a parallel issue on eslint-plugin-meteor to try to bring @dferber90 into the conversation. They may be doing something that breaks your module.

{
  "scripts": {
    "lint": "eslint ."
  },
  "dependencies": {
  },
  "devDependencies": {
    "eslint": "^2.13.1",
    "eslint-config-airbnb": "^9.0.1",
    "eslint-import-resolver-meteor": "^0.2.4",
    "eslint-plugin-import": ">1.10.1",
    "eslint-plugin-jsx-a11y": "^1.5.3",
    "eslint-plugin-meteor": "^3.6.0",
    "eslint-plugin-react": "^5.2.2"
  },
  "eslintConfig": {
    "extends": [
      "airbnb"
    ],
    "settings": {
      "import/resolver": "meteor"
    }
  }
}
benmosher commented 8 years ago

I wonder if we're both globally implementing Symbol: https://github.com/benmosher/eslint-plugin-import/blob/master/src/rules/export.js#L1

I felt dirty using require('es6-symbol/implement'). May be rearing it's ugly head.

benmosher commented 8 years ago

Looks like babel-polyfill is in effect in eslint-plugin-meteor. I wonder if they're beating each other up, somehow.

I can imagine them politely coexisting, though. Could be a red herring...

benmosher commented 8 years ago

(this is part of why I'd like to get away from all but syntax transpilation for this plugin...)

dferber90 commented 8 years ago

I wonder if we're both globally implementing Symbol

I haven't read through the whole issue. ESLint-plugin-meteor uses ESLint-plugin-import internally. If your npm version is below 3 it doesn't use flat dependencies and will contain two copies of ESLint-plugin-import if your main project also uses ESLint-plugin-import.

Based on the logs you're using npm v2 so you have two copies of the plugin.

rhettlivingston commented 8 years ago

Very possible. They are using babel.

On Tue, Jul 5, 2016 at 2:42 PM, Ben Mosher notifications@github.com wrote:

I wonder if we're both globally implementing Symbol: https://github.com/benmosher/eslint-plugin-import/blob/master/src/rules/export.js#L1

I felt dirty using require('es6-symbol/implement'). May be rearing it's ugly head.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benmosher/eslint-plugin-import/issues/415#issuecomment-230565915, or mute the thread https://github.com/notifications/unsubscribe/AH5TYovTxeNS9CPNpv859UsbJeV6CXcBks5qSqWfgaJpZM4JEocl .

rhettlivingston commented 8 years ago

Based on the logs you're using npm v2 so you have two copies of the plugin.

Oddly enough. It works with npm 2, not npm 3. Also, if I npm install with 2 and run with 3, it will work. Only npm install with 3 and run with 3 breaks. Look closer at the most recent log comments above...

rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ ls -l
total 8
-rw-rw-r-- 1 rhett rhett 558 Jul  5 14:01 package.json
-rw-rw-r-- 1 rhett rhett  14 Jul  5 13:56 sample.js

Note no node-modules installed,,, then

...

rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ npm version { npm: '3.9.6', ares: '1.9.0-DEV', http_parser: '1.2', modules: '11', node: '0.10.45', openssl: '1.0.1t', uv: '0.10.36', v8: '3.14.5.9', zlib: '1.2.8' } rhett@dreamshot:~/oob/meteors/debug-eslint-plugin-import$ npm install

...

npm ERR! Linux 4.4.0-28-generic npm ERR! argv "node" "/home/rhett/.nvm/v0.10.45/bin/npm" "run" "lint" npm ERR! node v0.10.45 npm ERR! npm v3.9.6

dferber90 commented 8 years ago

Disregard my last comment. eslint-plugin-import is a devDependency of eslint-plugin-meteor and will not get installed if you install eslint-plugin-meteor. Got confused there for a second.

I'm puzzled about the issue 🙄

rhettlivingston commented 8 years ago

Just a reminder that Node is a component of the issue too. Might be a clue to someone.

benmosher commented 8 years ago

Oof, I don't know why I thought this was a good idea: https://github.com/benmosher/eslint-plugin-import/blob/master/package.json#L73

It's probably the issue. npm@3's flat package structure is giving this plugin a version of es6-symbol it can't tolerate.

I bet if you cd node_modules/eslint-plugin-import && npm i es6-symbol it would might fix the issue.

rhettlivingston commented 8 years ago

No luck. I pushed my super-simple demo to https://github.com/rhettlivingston/debug-eslint-plugin-import so that others may easily work with this issue.

benmosher commented 8 years ago

Bummer. had high hopes.

I've got a branch where I've started removing Symbol dependence. Most of the times I'm using it, a forEach or some would work just as well.

rhettlivingston commented 8 years ago

I'm curious,,, if you removed just that one,,, did the problem shift to another?

I saw the branch. May give it a shot shortly.

On Wed, Jul 6, 2016 at 12:15 PM, Ben Mosher notifications@github.com wrote:

Bummer. had high hopes.

I've got a branch where I've started removing Symbol dependence. Most of the times I'm using it, a forEach or some would work just as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benmosher/eslint-plugin-import/issues/415#issuecomment-230823364, or mute the thread https://github.com/notifications/unsubscribe/AH5TYj_iSK3XDXEhIfsBLesAvtTrfs-Mks5qS9SKgaJpZM4JEocl .

benmosher commented 8 years ago

I expect that it would, but it's tough to say. The export one is removed, though, so it'd be interesting to find out.

rhettlivingston commented 8 years ago

The bad news is that it doesn't just fix it. The good news is that the problem moved to

Property 'Symbol(Symbol.iterator)_9.p0if4cvttla3jtt9' of object [object Map Iterator] is not a function
TypeError: Property 'Symbol(Symbol.iterator)_9.p0if4cvttla3jtt9' of object [object Map Iterator] is not a function
    at checkImports (/home/rhett/oob/meteors/debug-eslint-plugin-import/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js:20:150)

So, this approach shows promise for fixing the issue if carried through.

benmosher commented 8 years ago

I'll accept PR(s) for that branch if you or others are willing to refactor the handful of places it's used. AFAICT there are good tests wrapped around all the relevant places.

Let me know if you're up for it. I can do it, but not sure when.

rhettlivingston commented 8 years ago

Giving it a shot.

On Wed, Jul 6, 2016 at 2:00 PM, Ben Mosher notifications@github.com wrote:

I'll accept PR(s) for that branch if you or others are willing to refactor the handful of places it's used. AFAICT there are good tests wrapped around all the relevant places.

Let me know if you're up for it. I can do it, but not sure when.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benmosher/eslint-plugin-import/issues/415#issuecomment-230854265, or mute the thread https://github.com/notifications/unsubscribe/AH5TYnUrrcVqsX9KoPfdxinmXDNXcAgjks5qS-0mgaJpZM4JEocl .

rhettlivingston commented 8 years ago

Thank you again for accepting the PR!

Any forecast on the patch date? I'm waiting to release updates to the Meteor sample app that require this change.

I thought about releasing them with a github reference in the package.json, but that kind of reference doesn't seem to trigger the build on your module during npm install.

benmosher commented 8 years ago

Yeah, I'm trying to get away from transpiling for a number of reasons. The botched publish and that inability to install from Github are two big ones.

I nearly published on Friday, but in my quick QA I found an issue with a foreach instead of a forEach, which yielded the terrifying realization that code coverage by tests must not be what I think it is. That line certainly wasn't covered! And then I ran out of time, unfortunately.

I'll try to get it out this week, just want to make sure I don't botch another publish! 😅

rhettlivingston commented 8 years ago

Wow, my apologies if that was my 'foreach'! I actually had the thought to double-check that because I caught myself doing it once (and then forgot to do so). But the coverage was seeming pretty good. It caught me in other errors many times over.

Anyway, thank you again!

markshust commented 8 years ago

Confirmed all good on 1.10.3! Thanks!!