Skip to content

Commit 377de01

Browse files
committed
fix: Correctly sort type only imports.
1 parent 049a675 commit 377de01

File tree

7 files changed

+26
-35
lines changed

7 files changed

+26
-35
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"dependencies": {
4141
"ajv": "^8.17.1",
4242
"fastify-plugin": "^5.1.0",
43-
"http-errors-enhanced": "^4.0.1"
43+
"http-errors-enhanced": "^4.0.2"
4444
},
4545
"devDependencies": {
46-
"@cowtech/eslint-config": "^11.0.0",
47-
"@cowtech/typescript-config": "^0.2.2",
46+
"@cowtech/eslint-config": "^11.1.3",
47+
"@cowtech/typescript-config": "^0.2.5",
4848
"@types/node": "^24.10.1",
4949
"ajv-formats": "^3.0.1",
5050
"c8": "^10.1.3",
51-
"cleaner-spec-reporter": "^1.0.0",
51+
"cleaner-spec-reporter": "^1.0.3",
5252
"eslint": "^9.39.1",
5353
"fastify": "^5.6.2",
5454
"prettier": "^3.6.2",

src/handlers.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { type FastifyError, type FastifyReply, type FastifyRequest } from 'fastify'
1+
import type { FastifyError, FastifyReply, FastifyRequest } from 'fastify'
2+
import type { HttpError } from 'http-errors-enhanced'
3+
import type { GenericObject, NodeError, RequestSection } from './interfaces.ts'
4+
import type { ValidationResult } from './validation.ts'
25
import {
36
BadRequestError,
47
INTERNAL_SERVER_ERROR,
@@ -8,17 +11,11 @@ import {
811
UnsupportedMediaTypeError,
912
addAdditionalProperties,
1013
messagesByCodes,
11-
serializeError,
12-
type HttpError
14+
serializeError
1315
} from 'http-errors-enhanced'
14-
import {
15-
kHttpErrorsEnhancedConfiguration,
16-
type GenericObject,
17-
type NodeError,
18-
type RequestSection
19-
} from './interfaces.ts'
16+
import { kHttpErrorsEnhancedConfiguration } from './interfaces.ts'
2017
import { upperFirst } from './utils.ts'
21-
import { convertValidationErrors, validationMessagesFormatters, type ValidationResult } from './validation.ts'
18+
import { convertValidationErrors, validationMessagesFormatters } from './validation.ts'
2219

2320
export function handleNotFoundError(request: FastifyRequest, reply: FastifyReply): void {
2421
handleErrors(new NotFoundError('Not found.'), request, reply)

src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { type FastifyError, type FastifyInstance, type FastifyPluginOptions } from 'fastify'
1+
import type { FastifyError, FastifyInstance, FastifyPluginOptions } from 'fastify'
2+
import type { Configuration } from './interfaces.ts'
23
import fastifyPlugin from 'fastify-plugin'
34
import { handleErrors, handleNotFoundError } from './handlers.ts'
4-
import {
5-
type Configuration,
6-
kHttpErrorsEnhancedConfiguration,
7-
kHttpErrorsEnhancedResponseValidations
8-
} from './interfaces.ts'
5+
import { kHttpErrorsEnhancedConfiguration, kHttpErrorsEnhancedResponseValidations } from './interfaces.ts'
96
import { addResponseValidation, compileResponseValidationSchema } from './validation.ts'
107

118
export * from './handlers.ts'

src/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type Ajv, type ValidateFunction } from 'ajv'
2-
import { type FastifyError } from 'fastify'
1+
import type { Ajv, ValidateFunction } from 'ajv'
2+
import type { FastifyError } from 'fastify'
33

44
export const kHttpErrorsEnhancedConfiguration = Symbol('fastify-http-errors-enhanced-configuration')
55
export const kHttpErrorsEnhancedResponseValidations = Symbol('fastify-http-errors-enhanced-response-validation')

test/hooks.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import fastify, { type FastifyError, type FastifyInstance, type FastifyPluginOptions } from 'fastify'
2-
import { INTERNAL_SERVER_ERROR } from 'http-errors-enhanced'
1+
import type { FastifyError, FastifyInstance, FastifyPluginOptions } from 'fastify'
32
import { deepStrictEqual, match } from 'node:assert'
43
import { test } from 'node:test'
4+
import fastify from 'fastify'
5+
import { INTERNAL_SERVER_ERROR } from 'http-errors-enhanced'
56
import { plugin as fastifyHttpErrorsEnhanced } from '../src/index.ts'
67

78
async function buildServer(options: FastifyPluginOptions = {}): Promise<FastifyInstance> {

test/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { deepStrictEqual, match } from 'node:assert'
2+
import { test } from 'node:test'
13
import fastify, {
24
type FastifyInstance,
35
type FastifyPluginOptions,
@@ -14,8 +16,6 @@ import {
1416
UNSUPPORTED_MEDIA_TYPE,
1517
createError
1618
} from 'http-errors-enhanced'
17-
import { deepStrictEqual, match } from 'node:assert'
18-
import { test } from 'node:test'
1919
import { plugin as fastifyHttpErrorsEnhanced, handleErrors } from '../src/index.ts'
2020

2121
type Callback = () => void

test/validation.test.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1+
import type { FastifyInstance, FastifyPluginOptions, FastifyReply, FastifyRequest } from 'fastify'
2+
import type { ValidationResult } from '../src/validation.ts'
3+
import { deepStrictEqual, match, ok } from 'node:assert'
4+
import { test } from 'node:test'
15
import Ajv from 'ajv'
26
import addFormats from 'ajv-formats'
3-
import fastify, {
4-
type FastifyInstance,
5-
type FastifyPluginOptions,
6-
type FastifyReply,
7-
type FastifyRequest
8-
} from 'fastify'
7+
import fastify from 'fastify'
98
import { ACCEPTED, INTERNAL_SERVER_ERROR, OK } from 'http-errors-enhanced'
10-
import { deepStrictEqual, match, ok } from 'node:assert'
11-
import { test } from 'node:test'
129
import { convertValidationErrors, plugin as fastifyErrorProperties, niceJoin } from '../src/index.ts'
13-
import { type ValidationResult } from '../src/validation.ts'
1410

1511
async function buildServer(options: FastifyPluginOptions = {}): Promise<FastifyInstance> {
1612
const server = fastify({

0 commit comments

Comments
 (0)