-
Notifications
You must be signed in to change notification settings - Fork 14
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
Upgrading from v2.0.8 to 3.0.0 breaks build #25
Comments
Hey @barbalex, we are having the same issue. Did you find a temporal solution for this? The only thing working on our end is removing the optional chaining |
@RevereMarketing |
Is this at all related to these issues? It just seems like babel is no longer properly integrated in some situations and they must not be that rare to get a warning like this. Just wish there was more context around why this was known to break something and how one might fix it. Especially since it seems like a recommended way towards linting a Gatsby site. |
This is quite a bit outside the scope of the plugin (the source is literally 15 lines of code). I'm not a Gatsby contributer, and honestly haven't even used Gatsby since But digging a little I've diagnosed the issue - and I'll let @pieh be the judge of whether or not this is already fixed, or if something more needs to be done on Gatsby's side. Specifically in your project @barbalex this is an issue with Gatsby 2.31.1 If anything, the v2 plugin was SUPPRESSING the issue, and the upgrade to v3 seemed to "break" your build because it no longer suppressed the problem. You can comment out the v2 plugin from your Specifically, the Inside However without an existing rule, it will create it's own rule with the options in TLDR: The reason upgrading to v3 of the plugin breaks your build, is that So, with all that said. What to do about it? At this point for you, there probably two options that make the most sense:
Closing, but pinning the issue for anyone else who runs into this problem |
The bump that caused
was in As @chris-erickson pointed out in #25 (comment) we introduced regression in 2.31.0 / 231.1 and just merged another fix that I tested with various versions of |
Thanks a lot @pieh |
@pieh |
Just an FYI to @pieh, I've rewritten this plugin to work with V3 now that Broad strokes.
Users have instructions on how to re-enable the required rules. The basic approach I supplied is to just add another // gatsby-config.js
{
resolve: "gatsby-plugin-eslint",
options: {
rulePaths: [path.join(process.cwd(), "node_modules", "gatsby", "dist", "utils", "eslint-rules" )]
}
} and // .eslintrc
{
"rules": {
"no-anonymous-exports-page-templates": "warn",
"limited-exports-page-templates": "warn"
}
} Hopefully everything seems reasonable. Let me know if this might be undesirable or if there is a better approach. |
I did the following in a working project:
yarn add --dev eslint-webpack-plugin
yarn && yarn upgrade && yarn dev
The result is hundreds if not thousands of files failing the build. Here an example:
When I check the code mentioned it is always the usage of
?.
for optional chaining, for example in above file:It is possible that other modern js methods cause this too, I haven't checked too many files.
The text was updated successfully, but these errors were encountered: