Skip to content

Problems using shared config #4

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

Closed
doctyper opened this issue Jun 23, 2015 · 7 comments
Closed

Problems using shared config #4

doctyper opened this issue Jun 23, 2015 · 7 comments

Comments

@doctyper
Copy link

I get an error running analyze using a shared ESLint config:

bash-3.2$ codeclimate analyze
Starting analysis
Running eslint: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine eslint failed with status 1 and stderr "/usr/src/app/node_modules/eslint/lib/config.js:116\n                throw e;\n                      ^\nError: Cannot find module 'eslint-config-nfl'\nReferenced from: /code/.eslintrc\n    at Function.Module._resolveFilename (module.js:336:15)\n    at Function.Module._load (module.js:278:25)\n    at Module.require (module.js:365:17)\n    at require (module.js:384:17)\n    at loadConfig (/usr/src/app/node_modules/eslint/lib/config.js:91:48)\n    at loadConfig (/usr/src/app/node_modules/eslint/lib/config.js:110:44)\n    at getLocalConfig (/usr/src/app/node_modules/eslint/lib/config.js:209:23)\n    at Config.getConfig (/usr/src/app/node_modules/eslint/lib/config.js:351:22)\n    at processFile (/usr/src/app/node_modules/eslint/lib/cli-engine.js:178:27)\n    at /usr/src/app/node_modules/eslint/lib/cli-engine.js:332:26\n"

The tool also seems to have issues using eslint plugins:

bash-3.2$ codeclimate analyze
Starting analysis
Running eslint: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine eslint failed with status 1 and stderr "module.js:338\n    throw err;\n          ^\nError: Cannot find module 'eslint-plugin-react'\n    at Function.Module._resolveFilename (module.js:336:15)\n    at Function.Module._load (module.js:278:25)\n    at Module.require (module.js:365:17)\n    at require (module.js:384:17)\n    at /usr/src/app/node_modules/eslint/lib/cli-engine.js:107:26\n    at Array.forEach (native)\n    at loadPlugins (/usr/src/app/node_modules/eslint/lib/cli-engine.js:98:21)\n    at processFile (/usr/src/app/node_modules/eslint/lib/cli-engine.js:179:5)\n    at /usr/src/app/node_modules/eslint/lib/cli-engine.js:332:26\n    at /usr/src/app/node_modules/eslint/lib/util/traverse.js:61:17\n"

The shared config / plugins are installed locally to the project. However the issues still occur even when installing them globally.

@pbrisbin
Copy link
Contributor

Hi @doctyper sorry for the trouble, this is something we'd definitely like to support. It looks like ESLint shared configs are implemented as ESLint plugins, so your two errors are the same issue -- would you agree?

I'll have to familiarize myself with how these plugins are supposed to work before I can ask some better questions to try and get to the bottom of it. My guess is that we need to add the local node_modules directory to npm's load path (or whatever analogous mechanism it has) before invoking eslint so it can find any custom modules you've installed there for this purpose.

@doctyper
Copy link
Author

That sounds right @pbrisbin. The local node_modules should take priority over any other assumed path.

You might also consider warning the user to make sure npm install has been run before running codeclimate analyze.

@dignifiedquire
Copy link

Just ran into the same issue, would be great if this can be fixed.

gdiggs added a commit that referenced this issue Jun 30, 2015
@doctyper
Copy link
Author

@pbrisbin any progress on this issue?

@pbrisbin
Copy link
Contributor

Hi @doctyper, we are making progress on this but it's going to take some time. Unfortunately, eslint shared configs are implemented as eslint plugins. Since eslint plugins are effectively arbitrary remote code executing on our system, we need to be very careful about our architecture choices before we can support them.

It's those architecture decisions we're working on now, so although we are progressing, it is going to look slow from the stance of "it's just shared config support", and I apologize for that.

I will report any updates here as I have them.

@afeld
Copy link

afeld commented Mar 20, 2016

FYI, does seem that eslint-plugin-react was added in #34.

@pbrisbin
Copy link
Contributor

I'm going to close this issue now because eslint-plugin-react was explicitly whitelisted and we've created a sticky issue at qltysh/qlty#480 to track the broader issue of granting engines the network access needed for this kind of use case.

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

No branches or pull requests

4 participants