Make grunt-eslint use globally installed eslint plugin

255 Views Asked by At

Calling grunt-eslint causes a Cannot find module 'eslint-plugin-react' error that doesn't happen when calling eslint directly from the command line.

I have eslint-plugin-react installed globally.

Is there an easy way to make grunt eslint behave the same way as eslint?

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming you don't want to install the node module locally for some reason, I can think of two options. 1. Use grunt-exec within your grunt file to run eslint, or 2. As per the answer in the link below setup a symbolic link to your global node modules folder: How to use grunt-html installed globally?