Skip to content

[BUG] eslint error when using yarn berry #11842

@clianor

Description

@clianor

Describe the bug

(Write your answer here.)
eslint error when using yarn berry
eslint says Initialization error (ESLint). Missing "./lib/options" export in "eslint" package

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)
eslint, yarn berry, Initialization error (ESLint), Missing "./lib/options" export in "eslint" package

Environment

(paste the output of the command here.)
Environment Info:

current version of create-react-app: 5.0.0
running from /Users/est/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

System:
OS: macOS 11.6.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.17.3 - /usr/local/bin/node
Yarn: 3.1.1 - /usr/local/bin/yarn
npm: 7.24.2 - /usr/local/bin/npm
Browsers:
Chrome: 96.0.4664.110
Edge: Not Found
Firefox: Not Found
Safari: 15.2
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

// 1. project settings
$ npx create-react-app my-project --template typescript
// 2.yarn berry settings
$ yarn set version berry

// 3. .yarnrc.yml settings
# ADD .yarnrc.yml
nodeLinker: "pnp"
babel-preset-react-app@*:
    dependencies:
      "@babel/plugin-proposal-private-property-in-object": "*"

// 4. dependency install
$ rm -rf node_modules &&  yarn install
// 5. fix jest-watch-typeahead error in jest
$ yarn add -DE jest-watch-typeahead
// 6. add @testing-library/jest-dom type
$ yarn add -DE @types/testing-library__jest-dom
// 7. eslint dependency install
$ yarn add -DE eslint eslint-config-react-app

// 8.
# REMOVE "eslintConfig" in package.json

// 9.
# CREATE FILE ".eslintrc"
{
  "extends": [
    "react-app",
    "react-app/jest"
  ]
}


Expected behavior

(Write what you thought would happen.)
I think eslint will work normally.

Actual behavior

(Write what happened. Please add screenshots!)
image
image
image

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions