5

I have just updated create-react-app to 4.0.0 and I have encountered many issues. The first one was

TypeError: Cannot add property noFallthroughCasesInSwitch, object is not extensible

I solved it by adding "noFallthroughCasesInSwitch": true, to my tsconfig.json

Now I'm able to start the app, but everything went just wrong. I have millions of apparently unsued variables, even though they are not.

enter image description here

I have updated typescript to 4.0.5 but the problem remains.

Also, my machine becomes very loud when I hit yarn start

5
  • Are you using prettier or some kind of linter like eslint? Can you show your package.json Commented Nov 2, 2020 at 20:25
  • did you cleared your cache when updated create-react-app some old cache package conflict sometimes after updates Commented Nov 5, 2020 at 5:40
  • Did you ever resolve this issue? I'm experiencing the same for all types/interfaces imported. Commented Jan 14, 2021 at 10:10
  • @curly_brackets Unfortunately no, we gave up on it for now, we reversed the upgrade. Commented Jan 14, 2021 at 12:24
  • i have this same issue after upgrading react-scripts v4 in one of our workspaces. not sure how to fix and don't really want to turn the rule off. Commented Mar 25, 2022 at 18:42

1 Answer 1

3
+25

you can temporarily turn off eslint error no-unused-vars and @typescript-eslint/no-unused-vars in file .eslintrc. For example

{
  "extends": [
    "react-app",
    "./node_modules/react-redux-typescript-scripts/eslint.js"
  ],
  "rules": {
    "camelcase": "off",
    "import/no-anonymous-default-export": "off",
    "@typescript-eslint/camelcase": "off",
    "no-unused-vars": "warn",
    "@typescript-eslint/no-unused-vars": "off",
    "@typescript-eslint/ban-ts-ignore": "off",
    "@typescript-eslint/ban-ts-comment": "off",
    "@typescript-eslint/no-empty-function": "off",
    "@typescript-eslint/explicit-module-boundary-types": "off",
    "@typescript-eslint/no-empty-interface": "off",
    "@typescript-eslint/ban-types": "off"
  }
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.