From 43726b5f75c50d15bb3cad5b6cebdcbc143e501c Mon Sep 17 00:00:00 2001 From: "Marcus R. Brown" Date: Fri, 29 Nov 2024 20:24:03 -0700 Subject: [PATCH] feat(eslint-config): add rules for sorting named exports and imports --- .changeset/plenty-maps-attend.md | 6 ++++++ .changeset/young-cats-check.md | 6 ++++++ packages/api-core/test/index.test.ts | 2 +- packages/eslint-config/src/configs/perfectionist.ts | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .changeset/plenty-maps-attend.md create mode 100644 .changeset/young-cats-check.md diff --git a/.changeset/plenty-maps-attend.md b/.changeset/plenty-maps-attend.md new file mode 100644 index 00000000..82b7d0e6 --- /dev/null +++ b/.changeset/plenty-maps-attend.md @@ -0,0 +1,6 @@ +--- +"@bfra.me/api-core": patch +--- + +Fix linter errors. + \ No newline at end of file diff --git a/.changeset/young-cats-check.md b/.changeset/young-cats-check.md new file mode 100644 index 00000000..8d6976ad --- /dev/null +++ b/.changeset/young-cats-check.md @@ -0,0 +1,6 @@ +--- +"@bfra.me/eslint-config": minor +--- + +Add rules for sorting named exports and imports. + \ No newline at end of file diff --git a/packages/api-core/test/index.test.ts b/packages/api-core/test/index.test.ts index 40efdde6..747e9b9c 100644 --- a/packages/api-core/test/index.test.ts +++ b/packages/api-core/test/index.test.ts @@ -3,7 +3,7 @@ import assert from 'node:assert' import {loadSpec, responses as mockResponse} from '@api/test-utils' import datauri from 'datauri' import fetchMock from 'fetch-mock' -import {describe, beforeEach, afterEach, it, expect} from 'vitest' +import {afterEach, beforeEach, describe, expect, it} from 'vitest' import FetchError from '../src/errors/fetchError.js' import APICore from '../src/index.js' diff --git a/packages/eslint-config/src/configs/perfectionist.ts b/packages/eslint-config/src/configs/perfectionist.ts index ee186ce2..e387c31d 100644 --- a/packages/eslint-config/src/configs/perfectionist.ts +++ b/packages/eslint-config/src/configs/perfectionist.ts @@ -14,6 +14,14 @@ export async function perfectionist(): Promise { perfectionist: pluginPerfectionist as any, }, rules: { + 'perfectionist/sort-named-exports': [ + 'error', + {groupKind: 'values-first', order: 'asc', type: 'natural'}, + ], + 'perfectionist/sort-named-imports': [ + 'error', + {groupKind: 'values-first', order: 'asc', type: 'natural'}, + ], 'perfectionist/sort-exports': ['error', {type: 'natural'}], }, },