Skip to content
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

Disabling built-in ESLint breaks optional chaining #29264

Closed
aaronadamsCA opened this issue Jan 29, 2021 · 4 comments
Closed

Disabling built-in ESLint breaks optional chaining #29264

aaronadamsCA opened this issue Jan 29, 2021 · 4 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@aaronadamsCA
Copy link
Contributor

aaronadamsCA commented Jan 29, 2021

(I didn't want to clutter #29105 with what might be a different issue, but they may well be related, since we're both observing broken optional chaining.)

Description

Long ago I disabled Gatsby's built-in ESLint for my sites by following this how-to (TL;DR, touch .eslintrc).

This week, when I switched from Lerna + NPM to Yarn (v1) Workspaces, my Gatsby sites started throwing Webpack parsing errors during gatsby develop when encountering optional chaining syntax. Everything is fine during gatsby build.

If I remove the blank .eslintrc, it resolves the issue.

Steps to reproduce

I'm not entirely sure. I can't say if the different dependency tree calculated by Yarn is actually the root cause. I tried removing recently added dev dependencies like TypeScript, I tried messing with my root workspace ESLint config, but the only thing that works is removing that blank .eslintrc file from each site.

I'm not seeing any detrimental effects from removing the blank .eslintrc, I just wanted to report the very strange change in behaviour, because I never would have expected that file to impact Webpack behaviour. It took quite some time to figure out.

Environment

Node 12.19 with Gatsby 2.29.2 (I'm updating some packages later today, I'll update to confirm whether it's still occurring with newer Gatsby).

@aaronadamsCA aaronadamsCA added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 29, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 29, 2021
@LekoArts
Copy link
Contributor

LekoArts commented Feb 1, 2021

This is a duplicate of #29105

@LekoArts LekoArts closed this as completed Feb 1, 2021
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 1, 2021
@aaronadamsCA
Copy link
Contributor Author

Hey @LekoArts, just noting my issue was on 2.29.2.

#29105 is reporting something that broke as of 2.31.0.

I can continue the conversation in the other ticket, but I had opened a separate issue assuming the differing version ranges might indicate a different issue. Just FYI, thanks.

@LekoArts
Copy link
Contributor

LekoArts commented Feb 1, 2021

If you inspect your lock file or check with yarn why gatsby you probably won't see 2.29.2 - we didn't touch the logic for this in that version range so in your change yarn followed semver and installed 2.31.0 in your project. As your error sounds exactly like the on the in the mentioned issue you must be on the latest version as well.

Also it seems like it worked fine with NPM + Lerna on that 2.29.2 version?

@aaronadamsCA
Copy link
Contributor Author

@LekoArts You are correct! Sorry about that. I had not considered that in regenerating my lockfile I'd get a Gatsby upgrade as a side effect, my mistake.

Yes, it worked correctly when I actually had 2.29.2. I'll revise my comment in the other thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants