I followed instructions to enable ESLint warnings within (Atom) editor. On opening a .js file in the editor I get this error.
Error: Failed to load plugin flowtype: Cannot find module 'eslint-plugin-flowtype' Referenced from: package.json
I found I was hitting that issue too when using the linter-eslint
package for atom. My work around was to first make sure that all of the required plugins were installed globally with npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flowtype
and then telling linter-eslint
to use the global eslint installation
@andyeskridge thanks, your solution (checking - use global ESLint installation) fixed the error. Closing issue.
Please follow these instructions for integrating linting with your editor:
https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#display-lint-output-in-the-editor
It is unfortunate that we require global installation but this is a problem on ESLint鈥檚 end, and they intend to solve it: https://github.com/eslint/eslint/issues/3458.
Should the docs give that hint on the extra configuration at the ESLint plugin or is it too specific to Atom?
I am bringing this because as it is unchecked by default, the error wasn't entirely fixed after I installed the plugins globally.
They actually do give this hint.
Have you had a chance to look through the README generated in your project folder?
Is there something we can do to make it more discoverable?
Ugh, sorry, do you mean should the docs mention Atom plugin specifically? I think yes (we should mention major plugins and how to configure them). If you can send a PR that would he rad.
Yes, that what I meant.
This would be my very first PR, but I am more than pleasured to do. I think I'll would need some help, though, if you're up to.
Sure, happy to review and suggest changes etc.
Created PR on #348.
Most helpful comment
I found I was hitting that issue too when using the
linter-eslint
package for atom. My work around was to first make sure that all of the required plugins were installed globally withnpm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flowtype
and then tellinglinter-eslint
to use the global eslint installation