Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-config): add rules for sorting named exports and imports #690

Merged
merged 1 commit into from
Nov 30, 2024
Merged
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
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