Overwhelmed by ESLint errors during `gatsby develop` after updating to Gatsby 2.31.0
See original GitHub issueDescription
After updating to the newest version (gatsby@2.31.0) my terminal is flooded by ESLint errors. I’ve pasted an example below under “Actual result”, but the error is repeated for every JSX file at once, resulting in the terminal being full of nothing but ESLint errors.
The “undefined rules” mentioned in the terminal are defined in eslint-config-standard.
The errors disappear if I force Gatsby to use eslint@^7
using yarn’s resolutions field. This didn’t happend before gatsby@2.31.0
.
Steps to reproduce
There’s a minimal reproduction here. Follow the steps in the README (copied below) to see the errors and to see them disappear when using yarn’s resolution:
- Run
yarn
to install all dependencies - Run
yarn develop
- Look at all the errors in the terminal
- Stop the develop process
- In
package.json
change"resolutions_REMOVETHIS"
to"resolutions"
and save the changes - Run
yarn
to reinstall dependencies - Run
yarn develop
- There are no errors in the terminal
Expected result
The develop process should run normally and show no errors.
Actual result
This is shown in the terminal:
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
/Users/[...]/gatsby-eslint-warnings/src/pages/index.jsx
1:1 error Definition for rule 'default-case-last' was not found default-case-last
1:1 error Definition for rule 'no-useless-backreference' was not found no-useless-backreference
1:1 error Definition for rule 'no-loss-of-precision' was not found no-loss-of-precision
1:1 error Definition for rule 'no-unreachable-loop' was not found no-unreachable-loop
✖ 4 problems (4 errors, 0 warnings)
File: src/pages/index.jsx
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
.eslintrc » eslint-config-standard:
Environment key "es2021" is unknown
File: .cache/polyfill-entry.js
failed Building development bundle - 3.242s
Environment
Run gatsby info --clipboard
in your project directory and paste the output here.
System:
OS: macOS 10.15.7
Binaries:
Node: 14.15.4 - ~/.n/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
Languages:
Python: 2.7.17 - /usr/local/bin/python
Browsers:
Chrome: 87.0.4280.141
Firefox: 84.0.2
Safari: 14.0.2
npmPackages:
gatsby: 2.31.0 => 2.31.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:14 (12 by maintainers)
Top GitHub Comments
We’re still seeing a ton of these errors after upgrading to gatsby
2.31.1
for every file that useseslint-disable
oreslint-disable-next-line
, it seems.One example: one file,
SomeComponent.js
has this at the top:It also has a
useEffect
block with this applied:When I run
gatsby develop
:This updated fixed the existing errors but it introduced a new error for me.
for the. following code:
<Header siteTitle={data.site.siteMetadata?.title ||
Title} />
So i’m getting this error when using the optional chaining operator.