Skip to content
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

ng update/add remove newline in package.json #11744

Closed
thecp opened this issue Aug 2, 2018 · 3 comments · Fixed by #27895
Closed

ng update/add remove newline in package.json #11744

thecp opened this issue Aug 2, 2018 · 3 comments · Fixed by #27895

Comments

@thecp
Copy link

thecp commented Aug 2, 2018

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [X] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node --version
v8.11.3

yarn --version
1.7.0

ng --version
Angular CLI: 6.1.2
Node: 8.11.3
OS: linux x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.7.2
@angular-devkit/build-angular     0.7.2
@angular-devkit/build-optimizer   0.7.2
@angular-devkit/build-webpack     0.7.2
@angular-devkit/core              0.7.2
@angular-devkit/schematics        0.7.2
@angular/cdk                      6.2.0
@angular/cli                      6.1.2
@ngtools/webpack                  6.1.2
@schematics/angular               0.7.2
@schematics/update                0.7.2
rxjs                              6.2.2
typescript                        2.7.2
webpack                           4.9.2

Repro steps

  1. run ng update @angular/something
  2. Git diff of package.json:
-}
+}
\ No newline at end of file

Desired functionality

Not a big deal but ng update should add a newline at te end of package.json so that git doesn't complain anymore.

@alan-agius4 alan-agius4 changed the title ng update remove newline in package.json ng update/add remove newline in package.json Oct 30, 2018
@ngbot ngbot bot added this to the Backlog milestone Jan 24, 2019
@RA80533
Copy link

RA80533 commented May 5, 2021

This issue also seems to occur in angular.json after ng add.

@wojteko22
Copy link
Contributor

This is very annoying, especially if you use sth like Prettier on CI, which requires newlines – to have consistent code formatting and green build you must add this newline after each update command. And to avoid diff cluttering

ddereszkiewicz added a commit to ddereszkiewicz/angular-cli that referenced this issue Jun 21, 2024
…kage.json

As stated in angular#11744,
`ng update`  command removed the newline at the end of the package.json file.
 This commit makes `ng update` to preserve newline,
  if it was present before running the command.
ddereszkiewicz added a commit to ddereszkiewicz/angular-cli that referenced this issue Jun 21, 2024
…kage.json

As stated in angular#11744,
`ng update`  command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.
ddereszkiewicz added a commit to ddereszkiewicz/angular-cli that referenced this issue Jun 21, 2024
…kage.json

As stated in angular#11744,
`ng update` command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.

Fixes angular#11744
ddereszkiewicz added a commit to ddereszkiewicz/angular-cli that referenced this issue Jun 26, 2024
…kage.json

As stated in angular#11744,
`ng update` command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.

Fixes angular#11744
dgp1130 pushed a commit that referenced this issue Jun 27, 2024
…kage.json

As stated in #11744,
`ng update` command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.

Fixes #11744

(cherry picked from commit 4947f29)
dgp1130 pushed a commit that referenced this issue Jun 27, 2024
…kage.json

As stated in #11744,
`ng update` command removed the newline at the end of the package.json file.
This commit makes `ng update` to preserve newline, if it was present before running the command.

Fixes #11744

(cherry picked from commit 4947f29)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants