sort-package-json
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -368,2 +368,2 @@ import sortObjectKeys from 'sort-object-keys' | ||
export default sortPackageJson | ||
export { defaultSortOrder as sortOrder } | ||
export { sortPackageJson, defaultSortOrder as sortOrder } |
{ | ||
"name": "sort-package-json", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Sort an Object or package.json based on the well-known package.json keys", | ||
@@ -31,9 +31,9 @@ "keywords": [ | ||
"scripts": { | ||
"lint": "eslint .", | ||
"fix": "eslint . --fix && prettier . \"!**/*.js\" --write && node cli.js \"package.json\"", | ||
"lint": "eslint . && prettier . \"!**/*.js\" --check && node cli.js \"package.json\" --check", | ||
"prepare": "husky install", | ||
"semantic-release": "semantic-release", | ||
"sort-package-json": "node cli.js package.json --check", | ||
"test": "ava && dtslint --localTs node_modules/typescript/lib", | ||
"test-coverage": "nyc ava", | ||
"update-snapshot": "ava -u && node cli.js package.json" | ||
"update-snapshots": "ava --update-snapshots" | ||
}, | ||
@@ -46,10 +46,10 @@ "commitlint": { | ||
"lint-staged": { | ||
"package.json": [ | ||
"node cli.js" | ||
], | ||
"*.js": [ | ||
"eslint --fix" | ||
], | ||
"*.ts": [ | ||
"prettier --write" | ||
], | ||
"package.json": [ | ||
"node cli.js" | ||
"**/*,!*.js": [ | ||
"prettier --write --ignore-unkown" | ||
] | ||
@@ -56,0 +56,0 @@ }, |
# Sort Package.json | ||
[![Build Status](https://travis-ci.org/keithamus/sort-package-json.svg)](https://travis-ci.org/keithamus/sort-package-json) | ||
[![Build Status][github_actions_badge]][github_actions_link] | ||
[![NPM Version][package_version_badge]][package_link] | ||
[package_version_badge]: https://img.shields.io/npm/v/sort-package-json.svg | ||
[package_link]: https://www.npmjs.com/package/sort-package-json | ||
[github_actions_badge]: https://img.shields.io/github/actions/workflow/status/keithamus/sort-package-json/pr.yml | ||
[github_actions_link]: https://github.com/keithamus/sort-package-json/actions?query=workflow%3ACI+branch%3Amain | ||
## CLI | ||
@@ -21,3 +27,3 @@ | ||
```bash | ||
```console | ||
$ cd my-project | ||
@@ -37,2 +43,5 @@ $ cat package.json | ||
Found 1 file. | ||
1 file successfully sorted. | ||
$ cat package.json | ||
@@ -61,13 +70,15 @@ { | ||
```bash | ||
```console | ||
$ sort-package-json "**/package.json" --check | ||
# 5 matched files are sorted. | ||
Found 5 files. | ||
5 files were already sorted. | ||
$ sort-package-json "**/package.json" --check | ||
# foo/package.json | ||
# bar/package.json | ||
foo/package.json | ||
bar/package.json | ||
# 2 of 5 matched files are not sorted. | ||
Found 5 files. | ||
3 files were not sorted. | ||
2 files were already sorted. | ||
``` | ||
@@ -152,3 +163,3 @@ | ||
const sorted = sortPackageJson(packageJsonObject, { | ||
sortOrder: ['version'] | ||
sortOrder: ['version'], | ||
}) | ||
@@ -169,3 +180,3 @@ | ||
return left.localeCompare(right) | ||
} | ||
}, | ||
}) | ||
@@ -172,0 +183,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27700
264