-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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-airbnb error #465
Comments
You still have to manually add the package to your |
Thanks for the fast reply! I tried Any other ideas? |
ah, you're right, i see it there. However, when you run |
Ooooh, that makes sense! It does run when I use However this lead to me this issue which says that if I need to run eslint globally then I also need to install Thanks! |
I'd strongly recommend not using global installs (per eslint/eslint#1238 (comment)) but as long as it's working for you, yay! :-) |
Yea I agree; it's a recipe for a bad time 😆 i'm going to try and look into not using them for linting in Vim... gotta pour through the syntastic docs. _Thanks_ btw, you guys (and girls!) are awesome for open sourcing this stuff! 🍻 |
Still got this error when using atom with eslint local install. Error: Cannot find module 'eslint-config-airbnb' Referenced from: /Users/xugaofan/developer/git/MyApp/.eslintrc
Error: Cannot find module 'eslint-config-airbnb'
Referenced from: /Users/xugaofan/developer/git/MyApp/.eslintrc
at Function.Module._resolveFilename (module.js:334:15)
at Function.Module._load (module.js:284:25)
at Module.require (module.js:363:17)
at require (module.js:382:17)
at readConfigFromFile (/Users/xugaofan/.atom/packages/linter-eslint/node_modules/eslint/lib/config.js:155:44)
at loadConfig (/Users/xugaofan/.atom/packages/linter-eslint/node_modules/eslint/lib/config.js:176:22)
at /Users/xugaofan/.atom/packages/linter-eslint/node_modules/eslint/lib/config.js:207:46
at Array.reduceRight (native)
at loadConfig (/Users/xugaofan/.atom/packages/linter-eslint/node_modules/eslint/lib/config.js:191:36)
at getLocalConfig (/Users/xugaofan/.atom/packages/linter-eslint/node_modules/eslint/lib/config.js:321:23) |
Same problem here, both Windows 10 and OSX El Capitan, only in Atom, the application is working properly, live reload also working (using npm start). And: npm WARN EPEERINVALID [email protected] requires a peer of eslint@>=1.0.0 but none was installed. |
@kelong what version of eslint do you have installed? you have to manually install peer deps in npm 3. |
eslint 1.9.0 How ? |
|
I did that already, same problem |
I don't use Atom so I can't help there - hopefully someone who does will chime in. |
@kelong, see this issue. I believe we're having the same problem, and it should be resolved shortly. |
@justinsisley, ok thanks, will wait. I see that also jshint is not working with react, lots of warnings (es6) |
@kelong, go ahead and update your Atom plugins. The issue should be resolved. |
@justinsisley, thanks, I got another problem with $PATH, but I installed atom-fix-path package. |
@AdamBrodzinski did you end up finding a way to solve this without instaling |
@gunar If you are referring to using this with syntastic, a trick I learned recently is to just configure function! SyntasticESlintChecker()
let l:npm_bin = ''
let l:eslint = 'eslint'
if executable('npm')
let l:npm_bin = split(system('npm bin'), '\n')[0]
endif
if strlen(l:npm_bin) && executable(l:npm_bin . '/eslint')
let l:eslint = l:npm_bin . '/eslint'
endif
let b:syntastic_javascript_eslint_exec = l:eslint
endfunction
let g:syntastic_javascript_checkers = ["eslint"]
autocmd FileType javascript :call SyntasticESlintChecker() Credit to @gcorne To run the locally installed version of // package.json
{
"scripts": {
"lint": "eslint app"
}
} then just run Updated: Fixed the vim function |
@geekjuice thank you very much. that's precisely what I was looking for. It works, but I had to change |
Ah, yea. Good catch 👍 |
@gunar if you use |
@gcorne yup that makes sense. Will do. Thank you! |
Worked perfect for me 👍 |
Npm url: https://www.npmjs.com/package/eslint-config-airbnb-base
.eslintrc.json before:
after:
Worked for me... |
What you need to run is |
In my case I fixed it by:
run this:
it works:
Reason: |
I don't know if this is the best solution but it seems that installing "eslint-plugin-import@latest" did solve the problem, at least for me. Thanks, @hmagdy !! Note: I didn't install eslint-plugin-markdown |
I was having issues with this on my GatsbyJS site in VS Code. As per https://www.npmjs.com/package/eslint-config-airbnb I ran
This requires npm 5+ |
If it's mono repo or multiple projects in side same folder, |
Indeed, all eslint things should generally be dev deps. |
It's not working from my side now if listed under dev deps
return
But if I use it under reps, it is working fine
|
@hmagdy well sure, you're using a globally installed eslint 7 and you have a locally installed eslint 6. Do not have any global installs, let alone eslint ones - run it locally via an |
(Although I see |
Oh shit here what we have, it seems if libs listed under dev reps, eslint got updated automatically to 7.0 🤦
|
It works fine when I run |
I've added
"extends": "eslint-config-airbnb"
to an empty .eslintrc file and when I runeslint app
I get the following error. If I remove the extends and paste in the node_modules .eslint contents, it works fine. Any ideas? I rannpm install
several timesThe text was updated successfully, but these errors were encountered: