From e358934715ae08189099615ce02fdaf16689f5f8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 6 Feb 2024 16:08:54 -0500 Subject: [PATCH 1/2] docs: added sortOrder descriptions to README.md --- README.md | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/README.md b/README.md index bb497e4..e43eca3 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,151 @@ The lack of configuration here is a feature, not a bug. The intent of this tool A lot of people who ask for configuration cite the use case that they simply don't like the given order that exists and want to make sweeping changes. To me this seems far better suited to simply making a fork of this project as then you can go far further than specifying configuration. +### What is the order this package defaults to? + +The default order is exported as a `sortOrder` object. + +
+Properties mentioned in the npm docs + +1. `name` +1. `version` +1. `private` +1. `description` +1. `keywords` +1. `homepage` +1. `bugs` +1. `repository` +1. `funding` +1. `license` +1. `author` +1. `contributors` +1. `main` +1. `browser` +1. `bin` +1. `man` +1. `directories` +1. `files` +1. `workspaces` +1. `scripts` +1. `config` +1. `dependencies` +1. `engines` +1. `os` +1. `cpu` + +
+ +
+Full list of recognized properties + +1. `$schema` +1. `name` +1. `displayName` +1. `version` +1. `private` +1. `description` +1. `categories` +1. `keywords` +1. `homepage` +1. `bugs` +1. `repository` +1. `funding` +1. `license` +1. `qna` +1. `author` +1. `maintainers` +1. `contributors` +1. `publisher` +1. `sideEffects` +1. `type` +1. `imports` +1. `exports` +1. `main` +1. `svelte` +1. `umd:main` +1. `jsdelivr` +1. `unpkg` +1. `module` +1. `source` +1. `jsnext:main` +1. `browser` +1. `react-native` +1. `types` +1. `typesVersions` +1. `typings` +1. `style` +1. `example` +1. `examplestyle` +1. `assets` +1. `bin` +1. `man` +1. `directories` +1. `files` +1. `workspaces` +1. `binary` +1. `scripts` +1. `betterScripts` +1. `contributes` +1. `activationEvents` +1. `husky` +1. `simple-git-hooks` +1. `pre-commit` +1. `commitlint` +1. `lint-staged` +1. `nano-staged` +1. `config` +1. `nodemonConfig` +1. `browserify` +1. `babel` +1. `browserslist` +1. `xo` +1. `prettier` +1. `eslintConfig` +1. `eslintIgnore` +1. `npmpkgjsonlint` +1. `npmPackageJsonLintConfig` +1. `npmpackagejsonlint` +1. `release` +1. `remarkConfig` +1. `stylelint` +1. `ava` +1. `jest` +1. `jest-junit` +1. `jest-stare` +1. `mocha` +1. `nyc` +1. `c8` +1. `tap` +1. `resolutions` +1. `dependencies` +1. `devDependencies` +1. `dependenciesMeta` +1. `peerDependencies` +1. `peerDependenciesMeta` +1. `optionalDependencies` +1. `bundledDependencies` +1. `bundleDependencies` +1. `extensionPack` +1. `extensionDependencies` +1. `flat` +1. `packageManager` +1. `engines` +1. `engineStrict` +1. `volta` +1. `languageName` +1. `os` +1. `cpu` +1. `preferGlobal` +1. `publishConfig` +1. `icon` +1. `badges` +1. `galleryBanner` +1. `preview` +1. `markdown'` + +
+ ### What?! Why would you want to do this?! Well, it's nice to have the keys of a package.json in a well sorted order. Almost everyone would agree having "name" at the top of a package.json is sensible (rather than sorted alphabetically or somewhere silly like the bottom), so why not the rest of the package.json? From 7a465b4abea19435123338d79e30264cee956681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 6 Feb 2024 21:37:10 -0500 Subject: [PATCH 2/2] Update README.md Co-authored-by: fisker Cheung --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e43eca3..2db7aa1 100644 --- a/README.md +++ b/README.md @@ -407,7 +407,7 @@ The default order is exported as a `sortOrder` object. 1. `badges` 1. `galleryBanner` 1. `preview` -1. `markdown'` +1. `markdown`