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

Added support for npm package.json. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# No trailing comma

Placeholder package for clean diffs in JSON package definition files.

## Usage

### Composer

1. Configure root project to automatically sort packages.
```sh
$ composer config sort-packages true
```
```json
"config": {
"sort-packages": true
}
```

1. Install this package as dependency.
```sh
$ composer require zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma
$ composer require --dev zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma
```

### npm

1. Install this package as dependency.
```sh
$ npm install zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma
$ npm install --save-dev zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma
```

Notes
* npm sorts packages alphabetically whenever you invoke the commands `install` and `remove`. You can pass the name of a non-existing package to them to manually sort dependencies in `package.json` once.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
}
],
"minimum-stability": "dev",
"require": {}
"require": {},
"config": {
"sort-packages": true
}
}
Empty file added index.js
Empty file.
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma",
"version": "1.1.0",
"description": "Placeholder package for clean diffs in package.json.",
"keywords": ["npm", "package", "json", "package.json", "diff", "dev", "development"],
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma.git"
},
"author": "Daniel Kudwien <[email protected]> (https://netzstrategen.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma/issues"
},
"homepage": "https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma"
}