Skip to content
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
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ console.log(Object.keys(sorted))
- [Browserify](http://browserify.org/)
- [c8](https://github.com/bcoe/c8)
- [commitlint](https://commitlint.js.org/)
- [ESLint](https://eslint.org/)
- [Husky](https://github.com/typicode/husky)
- [Istanbul](https://istanbul.js.org/)
- [Jest](https://jestjs.io/)
Expand Down Expand Up @@ -376,8 +375,6 @@ The default order is exported as a `sortOrder` object.
1. `browserslist`
1. `xo`
1. `prettier`
1. `eslintConfig`
1. `eslintIgnore`
1. `npmpkgjsonlint`
1. `npmPackageJsonLintConfig`
1. `npmpackagejsonlint`
Expand Down
2 changes: 0 additions & 2 deletions defaultRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ _Note: when a specific key order is used, any other keys will be sorted in the e
| browserslist | |
| xo | Key sort |
| prettier | [Prettier sort](#prettier) |
| eslintConfig | [ESLint sort](#eslint) |
| eslintIgnore | |
| npmpackagejsonlint | Key sort (also recognizes: npmPackageJsonLintConfig, npmpkgjsonlint) |
| release | Key sort |
| remarkConfig | Key sort |
Expand Down
44 changes: 0 additions & 44 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,48 +157,6 @@ const sortWorkspaces = (workspaces) => {
return sortedWorkspaces
}

// https://github.com/eslint/eslint/blob/acc0e47572a9390292b4e313b4a4bf360d236358/conf/config-schema.js
const eslintBaseConfigProperties = [
// `files` and `excludedFiles` are only on `overrides[]`
// for easier sort `overrides[]`,
// add them to here, so we don't need sort `overrides[]` twice
'files',
'excludedFiles',
// baseConfig
'env',
'parser',
'parserOptions',
'settings',
'plugins',
'extends',
'rules',
'overrides',
'globals',
'processor',
'noInlineConfig',
'reportUnusedDisableDirectives',
]
const sortEslintConfig = onObject(
pipe([
sortObjectBy(eslintBaseConfigProperties),
overProperty('env', sortObject),
overProperty('globals', sortObject),
overProperty(
'overrides',
onArray((overrides) => overrides.map(sortEslintConfig)),
),
overProperty('parserOptions', sortObject),
overProperty(
'rules',
sortObjectBy(
(rule1, rule2) =>
rule1.split('/').length - rule2.split('/').length ||
rule1.localeCompare(rule2),
),
),
overProperty('settings', sortObject),
]),
)
const sortVSCodeBadgeObject = sortObjectBy(['description', 'url', 'href'])

const sortPrettierConfig = onObject(
Expand Down Expand Up @@ -447,8 +405,6 @@ const fields = [
{ key: 'browserslist' },
{ key: 'xo', over: sortObject },
{ key: 'prettier', over: sortPrettierConfig },
{ key: 'eslintConfig', over: sortEslintConfig },
{ key: 'eslintIgnore' },
{ key: 'npmpkgjsonlint', over: sortObject },
{ key: 'npmPackageJsonLintConfig', over: sortObject },
{ key: 'npmpackagejsonlint', over: sortObject },
Expand Down
87 changes: 0 additions & 87 deletions tests/eslint.js

This file was deleted.

5 changes: 1 addition & 4 deletions tests/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ Generated by [AVA](https://avajs.dev).
"displayName": "displayName",␊
"engineStrict": "engineStrict",␊
"engines": "engines",␊
"eslintConfig": "eslintConfig",␊
"eslintIgnore": "eslintIgnore",␊
"example": "example",␊
"examplestyle": "examplestyle",␊
"exports": "exports",␊
Expand Down Expand Up @@ -166,6 +164,7 @@ Generated by [AVA](https://avajs.dev).
"man": "man",␊
"directories": "directories",␊
"files": "files",␊
"workspaces": "workspaces",␊
"binary": "binary",␊
"scripts": "scripts",␊
"betterScripts": "betterScripts",␊
Expand All @@ -185,8 +184,6 @@ Generated by [AVA](https://avajs.dev).
"browserslist": "browserslist",␊
"xo": "xo",␊
"prettier": "prettier",␊
"eslintConfig": "eslintConfig",␊
"eslintIgnore": "eslintIgnore",␊
"npmpkgjsonlint": "npmpkgjsonlint",␊
"npmPackageJsonLintConfig": "npmPackageJsonLintConfig",␊
"npmpackagejsonlint": "npmpackagejsonlint",␊
Expand Down
Binary file modified tests/snapshots/main.js.snap
Binary file not shown.