Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a downside to disabling create-react-app's SKIP_PREFLIGHT_CHECK?

I've installed eslint as a dev dependency on my create-react-app project. I'm doing this to

1) run eslint as a pre-commit check via husky and lint-staged

2) extend CRA's eslint with airbnb and prettier lint configs

I got the warning:

Manually installing incompatible versions is known to cause hard-to-debug issues ...

I just wanted to know if there's actually any real risk to having eslint manually installed? Or can I just "safely ignore" this warning? (via SKIP_PREFLIGHT_CHECK=true)

like image 797
adrayv Avatar asked Nov 05 '19 01:11

adrayv


People also ask

Why you should stop using create react app?

CRA provides a bunch of tools not required for basic applications, which surely makes it overwhelming for beginners and makes our app slow in various ways. Due to the excessive amount of libraries required by CRA, It takes a lot longer bundling time than VITE! Vite makes it a lot easier for developers.

Can I uninstall create react app?

When you create a new React project, all the project files are stored inside a project directory. To delete React app, just simply delete this directory. If you get any errors during this process, try to use the terminal instead of file explorer.

Is create react app recommended?

Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in React. npx on the first line is not a typo — it's a package runner tool that comes with npm 5.2+.


Video Answer


1 Answers

CRA projects scan the dependency tree for version mismatches issues, warning the developers about them to fix. SKIP_PREFLIGHT_CHECK=true skips this scan, so you may have version mismatches in your project without any advice. IMO you have 3 options:

  1. Use SKIP_PREFLIGHT_CHECK=true with the possibility of a false positive

  2. (NOT recommended) Eject your react project so that you can be responsible for managing all the package versions in it. This is probably not what you want and will likely lead to bigger future problems.

  3. (I'd go for this one) Check if you really need to override the CRA package version. I've already worked on some projects with Airbnb eslint and prettier and never had this warning.

like image 87
Gabriel Marques Avatar answered Oct 06 '22 00:10

Gabriel Marques