facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.65k stars 26.81k forks source link

Swap out eslint-plugin-flowtype for eslint-plugin-ft-flow #11856

Open Brianzchen opened 2 years ago

Brianzchen commented 2 years ago

Describe the bug

Hi 👋 , I'm a maintainer on flow-typed and a new flowtype eslint library eslint-plugin-ft-flow

A user on stack overflow reported an issue with eslint-plugin-flowtype in eslint-config-react-app when using create-react-app. Full information can be read here

I've already fixed the issue in eslint-plugin-ft-flow and provide the library active maintenance compared to the original. Would the team at create-react-app be interested in swapping over to the new library to solve this and future issues.

ryancwalsh commented 2 years ago

I'm having this problem too: https://stackoverflow.com/q/70397587/470749

ram-sankhavaram commented 2 years ago

+1

alhabibhasan commented 2 years ago

same here, please resolve asap

Brianzchen commented 2 years ago

@iansu who would be the best person to look into this?

4vanger commented 2 years ago

I'm having same issue in CRA 5.0.0 and eslint 8.6.0

emao commented 2 years ago

fwiw, I had this same issue and upgrading my node from v12 to v17 (latest) fixed it

Brianzchen commented 2 years ago

One thing you can do as a quick fix is use a different eslint config, you can find a property in package.json that should look something like this

  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },

You can then remove the extends values and replace it with whatever your preference is like airbnb which is a popular one

ricovitch commented 2 years ago

Had the same issue with node12. Switching to a more recent version of nodejs solves the issue. create-react-app has officially dropped support for node12 since v5. See https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md#breaking-changes

Brianzchen commented 2 years ago

@iansu it looks like you're a maintainer. Can we please get at least from response here? This also blocks people from using flow enums

flyskywhy commented 2 years ago

Had the same issue with node12. Switching to a more recent version of nodejs solves the issue. create-react-app has officially dropped support for node12 since v5. See https://github.com/facebook/create-react-app/blob/main/CHANGELOG.md#breaking-changes

DISABLE_ESLINT_PLUGIN=true react-app-rewired start can avoid this error, and even node10 can work, for only eslint@8 is using Module.createRequire, ref to doc Upgrade to react-scripts@5 and Add Web Workers support and APP PixelShapeRN commit Add Web Workers support for CRA v5 (and Webpack 5)