-
-
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
Unstage yarn.lock pre-commit #2700
Conversation
56ac56a
to
b00c985
Compare
Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to remove any staged yarn.lock files before they can even be committed.
b00c985
to
3654c10
Compare
Why shouldn't it be checked in? The docs suggest otherwise https://yarnpkg.com/lang/en/docs/yarn-lock/. I should add that we specifically check this file in to get reproducible builds and would find it very awkward to work around this change. |
To be clear, this PR is relevant only to the create-react-app repo, where yarn.lock is neither committed nor gitignored. Apps using react-scripts would not be affected in any way. |
Ah, sorry, that makes much more sense. |
Seems very useful to me, thanks! |
Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to remove any staged yarn.lock files before they can even be committed.
* commit 'bfaee410c502a95076a6bd89721c76ca08e15f7b': (39 commits) Publish Prepare for 1.0.11 release (facebook#2924) Update dev deps (facebook#2923) Update README.md Use env variable to disable source maps (facebook#2818) Make formatWebpackMessages return all messages (facebook#2834) Adjust the `checkIfOnline` check if in a corporate proxy environment (facebook#2884) Fix the order of arguments in spawned child proc (facebook#2913) Feature/webpack 3 4 (facebook#2875) Allow importing package.json (facebook#2468) Re-enable flowtype warning (facebook#2718) Format UglifyJs error (facebook#2650) Unstage yarn.lock pre-commit (facebook#2700) Update README.md Update README.md Add Electrode to alternatives (facebook#2728) Fix parsing HTML/JSX tags to real elements (facebook#2796) Update webpack version note (facebook#2798) Use modern syntax feature (facebook#2873) Allow use of scoped packages with a pinned version (facebook#2853) ... # Conflicts: # packages/react-scripts/config/webpack.config.dev.js # packages/react-scripts/config/webpack.config.prod.js # packages/react-scripts/package.json
Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to remove any staged yarn.lock files before they can even be committed.
Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to remove any staged yarn.lock files before they can even be committed.
Since yarn.lock shouldn't be added to the repo, nor excluded via .gitignore, lets take advantage of lint-staged to remove any staged yarn.lock files before they can even be committed.
What's going on there? Why not to just add the file into |
We don’t want repo developers each to get their own lockfile that would be respected by Yarn. Since then they wouldn’t get the freshest versions that match what users would get. |
@just-boris I wrote some of the reasons in https://github.com/luftywiranda13/remove-lockfiles#why 😊 |
In any case unstaging should be unnecessary now that we:
|
The create-react-app repo itself should not be using yarn.lock. See e.g. facebook#2700.
Since
yarn.lock
shouldn't be added to the repo, nor excluded via.gitignore
, lets take advantage oflint-staged
to unstage any stagedyarn.lock
files before they can even be committed.