-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overwhelmed by ESLint errors during gatsby develop
after updating to Gatsby 2.31.0
#29105
Comments
Thanks for reproduciton, will have a fix shortly (and will capture details of problem etc in pull request description). Short of it there is issue that originated from #28911 |
Thank you for reporting this, I'm having the same issues. |
PR with fix was merged, we will backport it hopefully soon and release new patch with it. Will also notify here when fix is released |
Published in |
This updated fixed the existing errors but it introduced a new error for me.
for the. following code: So i'm getting this error when using the optional chaining operator. |
@t2ca Damn, sorry about not handling all of it. For immediate unblock it seems like you add export const eslintRequiredConfig: CLIEngine.Options = {
rulePaths: [eslintRulePaths],
useEslintrc: false,
baseConfig: {
+ parser: require.resolve(`babel-eslint`),
parserOptions: {
ecmaVersion: 2018,
sourceType: `module`,
ecmaFeatures: {
jsx: true,
},
},
globals: {
graphql: true,
__PATH_PREFIX__: true,
__BASE_PATH__: true, // this will rarely, if ever, be used by consumers
},
extends: [eslintRequirePreset],
},
} In https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/utils/eslint-config.ts. / I think now that this is a bit of whack-a-mole with it and this just needs not only that change but also some proper test setup for it to cover variety of inputs and make sure things like that don't block users. One additional thing is to check if problems like that - if they happen, don't cause errors - at most it should be some warning, which while annoying shouldn't block users |
Thank you @pieh, this fix worked and everything is working normally again. There are no other errors. |
Same here :( |
We're still seeing a ton of these errors after upgrading to gatsby One example: one file,
It also has a
When I run
|
I'm also experiencing both issues mentioned by @nikoladev and @sflahave. So far, I've managed to work around the first problem by monkey patching For the second problem, it seems a possible workaround is to also monkey patch the The final // ...
const eslintRequiredConfig = {
rulePaths: [eslintRulePaths],
- useEslintrc: false,
+ useEslintrc: true,
baseConfig: {
+ parser: require.resolve(`babel-eslint`),
parserOptions: {
ecmaVersion: 2018,
sourceType: `module`,
ecmaFeatures: {
jsx: true
}
},
globals: {
graphql: true,
__PATH_PREFIX__: true,
__BASE_PATH__: true // this will rarely, if ever, be used by consumers
},
extends: [eslintRequirePreset]
}
};
// ... |
No, oops, I'm an idiot, I am accidentally running Gatsby 2.31.1. |
Fix published in |
Works great, thank you. |
Description
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 beforegatsby@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:
yarn
to install all dependenciesyarn develop
package.json
change"resolutions_REMOVETHIS"
to"resolutions"
and save the changesyarn
to reinstall dependenciesyarn develop
Expected result
The develop process should run normally and show no errors.
Actual result
This is shown in the terminal:
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here.The text was updated successfully, but these errors were encountered: