Skip to content

Commit

Permalink
fix: use correct node name for npm-package-json-lint (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneog committed Nov 12, 2021
1 parent 732347e commit 668b47f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion defaultRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _Note: when a specific key order is used, any other keys will be sorted in the e
| prettier | [Prettier sort](#prettier) |
| eslintConfig | [ESLint sort](#eslint) |
| eslintIgnore | |
| npmpkgjsonlint | Key sort |
| npmpackagejsonlint | Key sort (also recognizes: npmPackageJsonLintConfig, npmpkgjsonlint) |
| release | Key sort |
| remarkConfig | Key sort |
| stylelint | |
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ const fields = [
{ key: 'eslintConfig', over: sortEslintConfig },
{ key: 'eslintIgnore' },
{ key: 'npmpkgjsonlint', over: sortObject },
{ key: 'npmPackageJsonLintConfig', over: sortObject },
{ key: 'npmpackagejsonlint', over: sortObject },
{ key: 'release', over: sortObject },
{ key: 'remarkConfig', over: sortObject },
{ key: 'stylelint' },
Expand Down
4 changes: 3 additions & 1 deletion tests/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ for (const field of [
'publishConfig',
'galleryBanner',
'remarkConfig',
'npmpkgjsonlint',
'release',
'npmpkgjsonlint',
'npmPackageJsonLintConfig',
'npmpackagejsonlint',
]) {
test(field, macro.sortObjectAlphabetically, { path: field })
}
Expand Down
Binary file modified tests/snapshots/cli.js.snap
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Generated by [AVA](https://avajs.dev).
"module": "module",␊
"name": "name",␊
"nodemonConfig": "nodemonConfig",␊
"npmPackageJsonLintConfig": "npmPackageJsonLintConfig",␊
"npmpackagejsonlint": "npmpackagejsonlint",␊
"npmpkgjsonlint": "npmpkgjsonlint",␊
"nyc": "nyc",␊
"optionalDependencies": "optionalDependencies",␊
Expand Down Expand Up @@ -170,6 +172,8 @@ Generated by [AVA](https://avajs.dev).
"eslintConfig": "eslintConfig",␊
"eslintIgnore": "eslintIgnore",␊
"npmpkgjsonlint": "npmpkgjsonlint",␊
"npmPackageJsonLintConfig": "npmPackageJsonLintConfig",␊
"npmpackagejsonlint": "npmpackagejsonlint",␊
"release": "release",␊
"remarkConfig": "remarkConfig",␊
"stylelint": "stylelint",␊
Expand Down
Binary file modified tests/snapshots/main.js.snap
Binary file not shown.

0 comments on commit 668b47f

Please sign in to comment.