Custom eslint config is not getting picked up #18796
Labels
help wanted
Issue with a clear description that the community can help with.
type: documentation
An issue or pull request for improving or updating Gatsby's documentation
Hey everyone!
First, I want to thank you for creating Gatsby. I am having more fun developing websites than ever before.
However, I am having trouble using a custom eslint config. Sorry if this is an issue on my side. I also had a look at the existing issues but did not find anything.
Description
Following the docs on eslint, I installed the mentioned dependency, created a
.eslintrc.js
and copied the content as suggested. Now when writing some invalid code, e.g._MyComponent
instead ofMyComponent
it does not give me a lint warning anymore. When I delete the.eslintrc.js
again, it gives me the following lint warning:Reading the docs, copy pasting the
.eslintrc.js
should give me the same warning. However, I added other rules which should throw some warnings but they don't. I am pretty sure the eslint config itself is correct as IntelliJ shows warnings.I also had a quick look at the Gatsby code and found this line. Logging
hasLocalEslint(program.directory)
outputstrue
. Could it be that the local eslint rules are not read?Thanks for your help! If you need more information or help, I am happy to help on this!
Steps to reproduce
I created a minimal reproduction here.
npm run start
, no warnings in console.eslintrc.js
npm run start
again, now you should see warningsExpected result
Gatsby should pick up the custom eslint config and show warnings.
Actual result
Gatsby does not show warnings.
Environment
The text was updated successfully, but these errors were encountered: