-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: package.json saving optional deps
When saving over existing files that contains optionalDependencies it should avoid also saving that dep to dependencies, respecting our docs recommendation on it: Entries in optionalDependencies will override entries of the same name in dependencies, so it's usually best to only put in one place. This patches this UX problem by adding an extra check that will avoid adding a dependency to the package.json `dependencies` object in case that package is already listed under `optionalDependencies`. Relates to: npm/arborist#221 Fixes: npm/cli#724 PR-URL: #109 Credit: @ruyadorno Close: #109 Reviewed-by: @nlf, @wraithgar
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters