Skip to content

Commit

Permalink
feat(eslint-config): add rules for sorting named exports and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrbrown committed Nov 30, 2024
1 parent e85df7d commit 43726b5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/plenty-maps-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bfra.me/api-core": patch
---

Fix linter errors.

6 changes: 6 additions & 0 deletions .changeset/young-cats-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bfra.me/eslint-config": minor
---

Add rules for sorting named exports and imports.

2 changes: 1 addition & 1 deletion packages/api-core/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions packages/eslint-config/src/configs/perfectionist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export async function perfectionist(): Promise<Config[]> {
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'}],
},
},
Expand Down

0 comments on commit 43726b5

Please sign in to comment.