Closed natapg closed 3 years ago
Your configs looks fine, the problem is that you're running eslint
with the CLI, and the CLI doesn't understand where to look for the additional rules.
See the Eslint CLI docs where it has the --rulesdir
flag to allow you to set additional rule directories.
Eslint will complain if you run a command without specifying the rulesdir like: yarn eslint src/*/**.js --config ./.eslintrc
I'm not sure how your CI system is set up specifically, but as gatsby-plugin-eslint
's docs mention: the location of the rules reside at node_modules/gatsby/dist/utils/eslint-rules
So running your lint command with the flag like: yarn eslint src/*/**.js --config ./.eslintrc --rulesdir ./node_modules/gatsby/dist/utils/eslint-rules
fixes the issue.
That's the general idea for you to fix your CI linting command. Closing because this is more of a CLI issue than a plugin issue, but I hope this helps!
Hi guys, I just updated our gatsby-plugin-eslint following the guide, I added both new rules to muy .eslintrc.js and then fixed all the new warning showed in gatsby develop, but now when I run
yarn eslint
(which is part of our CI process) I get the following errors:which I think is to be expected since eslint doesn't "get" gatsby's own plugins, right? Is there any way to fix it?
.eslintrc.js
gatsby-config
package.json