-
Notifications
You must be signed in to change notification settings - Fork 40
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
ESLint Bug: extended config does not work with globally installed eslint #43
Comments
Noted in the README here: https://github.com/walmartlabs/eslint-config-defaults#limitations |
@baer, is there a way around this limitation? I would like to use Sublime/Atom eslint plugins as well as grunt-eslint and these configs do not work.. |
@mrmartineau -- The code blowing up is here: https://github.com/eslint/eslint/blob/master/lib/config/config-file.js#L159-L175 function loadPackage(filePath) {
debug("Loading config package: " + filePath);
try {
return require(filePath);
} catch (e) {
debug("Error reading package: " + filePath);
e.message = "Cannot read config package: " + filePath + "\nError: " + e.message;
throw e;
}
} Which is essentially just a Offhand, one option is to globally install the same configs that a global |
For reference, this is a known issue in eslint which the other shareable config projects are encountering as well (e.g. google/eslint-config-google#3, airbnb/javascript#465). As noted in the eslint issue, eslint-cli may be an option for some users. A shell alias may work for others. I think |
I do this inside a project folder:
got the same issue with eslint-config-google. Is there a workaroung for now? can't use eslint for my projects... Use Windows 10 64Bit. If you need more info, let me know it. Or whether I have to create the comment to another repo. |
@Chris2011 -- Try a local install of $ npm install eslint --save-dev Then add an "lint": "eslint --config .eslintrc.json --format compact ." Then try: $ npm run lint in your project and see if that works? |
Ok this works, after I changed my .eslintrc.json file, because my json file looked like: {
"extends": "google"
} thx. |
Hi All, is this still an issue? I'm using a globally-installed |
Yes, it's still a problem |
try this |
@j492 -- confirming this solves the issue after adding the global flag.
|
@darekziemba Yes it will also work. -g option install it globally which will let you use this lib in any folder on your machine. I don't use -g as the versions change frequently and I want to use latest available on later projects |
When running lint (
eslint .
) from a globally installed version of eslint (npm install -g eslint
) you will get the following error. This appears to be a problem with ESLint itself.package.json
Workarounds:
node_modules
:./node_modules/.bin/eslint .
npm run lint
The text was updated successfully, but these errors were encountered: