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

eslint-config-angular support #47

Closed
healthypets opened this issue Sep 19, 2016 · 22 comments
Closed

eslint-config-angular support #47

healthypets opened this issue Sep 19, 2016 · 22 comments

Comments

@healthypets
Copy link

healthypets commented Sep 19, 2016

Is it possible to get this working with eslint-config-angular?

I have been having issues with it not finding the module, even though I have tried both global and local installations.

Thanks!

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

Can you provide a link to your project on github?
Or create a sample one if you don't have it.
Thanks

@healthypets
Copy link
Author

https://github.com/healthypets/project-base

Wasn't sure if you wanted the node modules or not so I intentionally left them. Can do a clean install if necessary. ESLint in brackets throws a 'cannot find module eslint-config-angular' error when trying to lint inside of brackets for lint-test.js

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

So, your project is using eslint-config-angular but the error message says this:

image

You can fix it by doing npm install --save eslint-plugin-angular in your project. After that:

image

@zaggino zaggino closed this as completed Sep 19, 2016
@healthypets
Copy link
Author

Hmm perhaps there is a difference in environment here then.

Mine is showing:

ESLint terminated with error: Error: Cannot find module 'eslint-config-angular' Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js  

I'm on Windows, though that's likely not the only env difference.

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

What version of Brackets are you running?

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

I recommend trying out latest 1.8 pre-release from here: https://github.com/adobe/brackets/releases or my electron build from here: https://github.com/zaggino/brackets-electron/releases

Brackets before 1.8 doesn't work with eslint version 3

@healthypets
Copy link
Author

Currently running Release 1.7 so that would make sense. I'll install that release. Apparently I missed that memo, thanks!

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

#36

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

Let me know if the upgrade to 1.8 did work for you please.

@healthypets
Copy link
Author

Updated the to latest 1.8 pre-release from Brackets. Still getting the following:

ESLint terminated with error: Error: Cannot find module 'eslint-config-angular' Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js

If I just have base rules in the .eslintrc.js then it seems to function fine. It just can't seem to find the module when I use: "extends": "angular"

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

When you open brackets console (Debug > Show developer tools or F12), do you have anything else there?

@healthypets
Copy link
Author

NodeDebugUtils.js:111 [node-error 2:47:18 PM] [brackets-eslint] Error thrown in executeOnText: Error: Cannot find module 'eslint-config-angular'
Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js
    at Object.ModuleResolver.resolve (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\util\module-resolver.js:75:19)
    at resolve (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:479:33)
    at load (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:496:24)
    at C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:363:28)
    at Object.load (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:530:22)
    at loadConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:64:33)
    at getLocalConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:126:23)
    at Config.getConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:227:22)
    at processText (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\cli-engine.js:223:27)
    at CLIEngine.executeOnText (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\cli-engine.js:761:26)
    at C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\dist\node\eslint.js:238:23
    at fs.js:266:14
    at C:\xampp\htdocs\project-base\node_modules\graceful-fs\graceful-fs.js:43:10
    at C:\Program Files (x86)\Brackets\www\extensibility\node\node_modules\fs-extra\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:103:5

@zaggino
Copy link
Member

zaggino commented Sep 19, 2016

I have now tried on second windows machine with your project and npm install eslint-plugin-angular fixes it again. Can't help here. (I'm using brackets-electron for windows on both but that should not make a difference)

@healthypets
Copy link
Author

Okay, I will look at setting this up on a clean virtual machine. An acquaintance tried this as well and had the same issue not being able to find the config module. Perhaps a clean env will be different.

Thanks for your time!

@zaggino
Copy link
Member

zaggino commented Sep 20, 2016

I'd be interesting to find out what the problem is. If you wan't me to provide any settings, installed apps or whatever from my windows machines, let me know. But they are quite normal, latest versions of node, npm, git, etc.

@zaggino
Copy link
Member

zaggino commented Sep 20, 2016

Please also be sure to test this with https://github.com/zaggino/brackets-electron/releases too when you're at it, thanks!

@zaggino
Copy link
Member

zaggino commented Sep 20, 2016

I've also released brackets-eslint@3.0.0 which includes a fair bit of refactoring, maybe that'll help too.

@karol-majewski
Copy link

Updated Brackets to 1.8 and now ESLint doesn't work at all.
It worked just fine with 1.7, but now there's no coming back.

ESLintError: Legacy node process detected, please update to Brackets 1.8 or Brackets-Electron

@zaggino
Copy link
Member

zaggino commented Sep 20, 2016

Did you install Brackets 1.8 from here? https://github.com/adobe/brackets/releases

@zaggino
Copy link
Member

zaggino commented Sep 20, 2016

@guess-and-correct 3.0.2 will fix it but you need to use eslint 2.x in your project

@karol-majewski
Copy link

@zaggino I did (the .msi package).
For what it's worth, when updating ESLint using npm-registry, it threw a couple warnings about npm being too old. Even after updating Brackets to 1.8, npm-registry is still using node v0.10.24 and npm 2.14.5.

@zaggino
Copy link
Member

zaggino commented Nov 21, 2016

This is now fixed with latest Brackets (includes node v6)

@zaggino zaggino closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants