-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Proposal: Option to build without linting #7828
Comments
Do you have any stats on how long it takes (as a percentage of total build time) to do the linting in your case? I'm wondering if it's worth adding something like this. |
This is part of the problem, I have no visibility into the cost of this because the only indication of linting is when it fails. I could give it a try if there were a way, but it is safe to assume that there is a cost to the extra linting and that it increases with the scale of the codebase. Is there a way to collect those stats? |
The specific lint configuration is also not being respected:
|
Not really, but you could run a lint with the same linting rules as CRA and see how long it takes, that would give you an indication. |
Another potentially undocumented "feature" is noop gzipping during production build which definitely slows down the build. I would suggest to have both lint/gzip being optional. We have custom react scripts where we got rid of eslint & gzip and the build time went from ~4:40 to ~2:40 |
I think it makes sense in certain scenarios like CI/CD environments. As long as they stay opt out I don’t think it harms to add this. |
There is another scenario that happens to our team quite a lot. We have a git hook to ensure that all files committed are fine, running prettier and linters. When we are bugfixing in the browser, sometimes we comment out pieces of code, just to have the browser throw us an error of "you are importing stuff and then not using it". It makes quick checks way less trivial. I'd rather have the option to avoid linting on dev build, since we know that we're not committing offending code, plus we have the linters in our editors. |
Exhuming this - it seems like this was never pursued? |
Perfect that actually solves it for me!
In my CI build job (that comes after lint) does not run it again but compiles directly 🎉 |
Is your proposal related to a problem?
I'm always frustrated when the build command is linting my code and there is no way for me to skip the linting step. My pipeline is
lint > test > build
. I want to lint before testing because my test files are also linted. With the current setup, linting happens twice.Describe the solution you'd like
I would like to be able to opt out of linting:
"build" : "react-scripts built --no-lint"
Or (even better) have linting separated from the build command so I can remove it. It would appear this way in the default setup:
"build": "react-scripts lint && react-scripts build"
The README never mentions that linting will happen within the build step, so this makes the actual process much more visible.
Describe alternatives you've considered
Somehow disabling linting by configuration before the build step happens.
Additional context
A related issue was auto-staled without solution:
#7078
The text was updated successfully, but these errors were encountered: