diff --git a/README.md b/README.md index 2db7aa1..b82b415 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ console.log(Object.keys(sorted)) - [Mocha](https://mochajs.org/) - [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) - [npm-package-json-lint](https://npmpackagejsonlint.org/) +- [oclif](https://oclif.io/) - [Prettier](https://prettier.io/) - [remark](https://remark.js.org/) - [semantic-release](https://github.com/semantic-release/semantic-release) diff --git a/defaultRules.md b/defaultRules.md index b2e8e22..234be5d 100644 --- a/defaultRules.md +++ b/defaultRules.md @@ -79,6 +79,7 @@ _Note: when a specific key order is used, any other keys will be sorted in the e | mocha | Key sort | | nyc | Key sort | | tap | Key sort | +| oclif | Key sort (deep) | | resolutions | Key sort | | dependencies | Key sort | | devDependencies | Key sort | diff --git a/index.js b/index.js index cb02bc6..0aa2a9f 100755 --- a/index.js +++ b/index.js @@ -281,6 +281,7 @@ const fields = [ { key: 'nyc', over: sortObject }, { key: 'c8', over: sortObject }, { key: 'tap', over: sortObject }, + { key: 'oclif', over: sortObjectBy(undefined, true) }, { key: 'resolutions', over: sortObject }, { key: 'dependencies', over: sortObject }, { key: 'devDependencies', over: sortObject }, diff --git a/tests/snapshots/cli.js.snap b/tests/snapshots/cli.js.snap index 87200f1..0433670 100644 Binary files a/tests/snapshots/cli.js.snap and b/tests/snapshots/cli.js.snap differ diff --git a/tests/snapshots/deps.js.snap b/tests/snapshots/deps.js.snap index 4d621cf..366d861 100644 Binary files a/tests/snapshots/deps.js.snap and b/tests/snapshots/deps.js.snap differ diff --git a/tests/snapshots/eslint.js.snap b/tests/snapshots/eslint.js.snap index 4d7a898..4ecd658 100644 Binary files a/tests/snapshots/eslint.js.snap and b/tests/snapshots/eslint.js.snap differ diff --git a/tests/snapshots/fields.js.snap b/tests/snapshots/fields.js.snap index 7c58082..1f4b8d8 100644 Binary files a/tests/snapshots/fields.js.snap and b/tests/snapshots/fields.js.snap differ diff --git a/tests/snapshots/main.js.md b/tests/snapshots/main.js.md index b5b91c3..d9dd5e1 100644 --- a/tests/snapshots/main.js.md +++ b/tests/snapshots/main.js.md @@ -78,6 +78,7 @@ Generated by [AVA](https://avajs.dev). "npmpackagejsonlint": "npmpackagejsonlint",␊ "npmpkgjsonlint": "npmpkgjsonlint",␊ "nyc": "nyc",␊ + "oclif": "oclif",␊ "optionalDependencies": "optionalDependencies",␊ "os": "os",␊ "packageManager": "packageManager",␊ @@ -195,6 +196,7 @@ Generated by [AVA](https://avajs.dev). "nyc": "nyc",␊ "c8": "c8",␊ "tap": "tap",␊ + "oclif": "oclif",␊ "resolutions": "resolutions",␊ "dependencies": "dependencies",␊ "devDependencies": "devDependencies",␊ diff --git a/tests/snapshots/main.js.snap b/tests/snapshots/main.js.snap index 06dbbaa..59217ec 100644 Binary files a/tests/snapshots/main.js.snap and b/tests/snapshots/main.js.snap differ diff --git a/tests/snapshots/prettier.js.snap b/tests/snapshots/prettier.js.snap index 4561efa..7ae48bc 100644 Binary files a/tests/snapshots/prettier.js.snap and b/tests/snapshots/prettier.js.snap differ