chore: let oxfmt sort imports instead of eslint (#5442)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Yusuke Wada · committed by GitHub · parent 57ba76a · Browse files · 60 files·+89 added−87 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
60 files+89 added−87 removed
- tests:+73 added−75 removed
- other:+16 added−12 removed
Provenance
- Commit
859e2c2- Tree
d90acee- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
GitHub <noreply@github.com>- Parent
57ba76a
60 files changed+89 added−87 removed
modified:benchmarks/jsx/src/react-jsx/benchmark.ts-1 removed
123345631 unmodified linesimport { Suite } from 'benchmark'import { parse } from 'node-html-parser'
import { render as renderHono } from './hono'import { render as renderNano } from './nano'import { render as renderPreact } from './preact'import { render as renderReact } from './react'31 unmodified linesmodified:benchmarks/jsx/src/benchmark.ts-1 removed
123345631 unmodified linesimport { Suite } from 'benchmark'import { parse } from 'node-html-parser'
import { render as renderHono } from './hono'import { render as renderNano } from './nano'import { render as renderPreact } from './preact'import { render as renderReact } from './react'31 unmodified linesmodified:build/build.ts+2 added-2 removed
5 unmodified lines6789101112131413141516171896 unmodified lines5 unmodified lines*/
/// <reference types="bun-types" />
import fs from 'fs'import path from 'path'import { $, Glob } from 'bun'import { build, context } from 'esbuild'import type { Plugin, PluginBuild, BuildOptions } from 'esbuild'import fs from 'fs'import path from 'path'import { removePrivateFields } from './remove-private-fields'import { validateExports } from './validate-exports'
const isWatch = process.argv.includes('--watch')96 unmodified linesmodified:build/remove-private-fields.ts+1 added-1 removed
1+import { readFile, writeFile } from 'fs/promises'2 import type { PropertyDefinition, ParseResult } from 'oxc-parser'3 import { parseSync, Visitor } from 'oxc-parser'3-import { readFile, writeFile } from 'fs/promises'4 5 export async function removePrivateFields(files: string[]) {6 const start = performance.now()7 const parsed = await Promise.all(50 unmodified linesmodified:perf-measures/bundle-check/scripts/check-bundle-size.ts+1 added-1 removed
1-import * as esbuild from 'esbuild'1 import * as fs from 'node:fs'2 import * as os from 'os'3 import * as path from 'path'4+import * as esbuild from 'esbuild'5 6 async function main() {7 const tempDir = os.tmpdir()8 const tempFilePath = path.join(tempDir, 'bundle.tmp.js')44 unmodified linesmodified:runtime-tests/bun/index.test.tsx+1 added-1 removed
1-import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'1 import fs from 'fs/promises'2 import path from 'path'3+import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'4 import { stream, streamSSE } from '../..//src/helper/streaming'5 import { serveStatic, toSSG } from '../../src/adapter/bun'6 import { createBunWebSocket } from '../../src/adapter/bun/websocket'7 import type { BunWebSocketData } from '../../src/adapter/bun/websocket'452 unmodified linesmodified:runtime-tests/deno/hono.test.ts-1 removed
1 import { assertEquals } from '@std/assert'2-2 import { Context } from '../../src/context.ts'3 import { env, getRuntimeKey } from '../../src/helper/adapter/index.ts'4 import { Hono } from '../../src/hono.ts'5 29 unmodified linesmodified:runtime-tests/lambda/stream-mock.ts+1 added-1 removed
1-import { vi } from 'vitest'1 import { Writable } from 'node:stream'2+import { vi } from 'vitest'3 import type {4 APIGatewayProxyEvent,5 APIGatewayProxyEventV2,6 } from '../../src/adapter/aws-lambda/handler'38 unmodified linesmodified:runtime-tests/node/index.test.ts+1 added-1 removed
1-import { createAdaptorServer, serve } from '@hono/node-server'1 import { once } from 'node:events'2 import type { Server } from 'node:http'3 import type { AddressInfo } from 'node:net'4+import { createAdaptorServer, serve } from '@hono/node-server'5 import { Hono } from '../../src'6 import { Context } from '../../src/context'7 import { env, getRuntimeKey } from '../../src/helper/adapter'8 import { stream, streamSSE } from '../../src/helper/streaming'288 unmodified linesmodified:src/adapter/cloudflare-workers/websocket.test.ts+1 added-1 removed
1+import { upgradeWebSocket } from '.'2 import { Hono } from '../..'3 import { Context } from '../../context'3-import { upgradeWebSocket } from '.'4 5 describe('upgradeWebSocket middleware', () => {6 const server = new EventTarget()7 155 unmodified linesmodified:src/adapter/lambda-edge/handler.ts-1 removed
1 import crypto from 'node:crypto'2 import type { Hono } from '../../hono'3-3 import { decodeBase64, encodeBase64 } from '../../utils/encode'4 5 // eslint-disable-next-line @typescript-eslint/ban-ts-comment6 // @ts-ignore233 unmodified linesmodified:src/client/types.test.ts+1 added-1 removed
1 /* eslint-disable @typescript-eslint/no-unused-vars */2 import { expectTypeOf } from 'vitest'3+import { hc } from '.'4 import { Hono } from '..'5 import { upgradeWebSocket } from '../adapter/deno/websocket'6 import type { TypedURL } from './types'6-import { hc } from '.'7 8 describe('WebSockets', () => {9 const app = new Hono()10 .get(136 unmodified linesmodified:src/helper/adapter/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { env, getRuntimeKey } from '.'2+import { Hono } from '../../hono'3 4 describe('getRuntimeKey', () => {5 it('Should return the current runtime key', () => {6 // Now, using the `bun run test` command.49 unmodified linesmodified:src/helper/cookie/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import {2 deleteCookie,3 getCookie,4 getSignedCookie,1 unmodified line6 setSignedCookie,7 generateCookie,8 generateSignedCookie,9 } from '.'10+import { Hono } from '../../hono'11 12 describe('Cookie Middleware', () => {13 describe('Parse cookie', () => {14 const apps: Record<string, Hono> = {}496 unmodified linesmodified:src/helper/dev/index.test.ts+1 added-1 removed
1+import { getRouterName, inspectRoutes, showRoutes } from '.'2 import { Hono } from '../../hono'3 import { RegExpRouter } from '../../router/reg-exp-router'4 import type { Handler, MiddlewareHandler } from '../../types'4-import { getRouterName, inspectRoutes, showRoutes } from '.'5 6 const namedMiddleware: MiddlewareHandler = (_, next) => next()7 const namedHandler: Handler = (c) => c.text('hi')8 const app = new Hono()173 unmodified linesmodified:src/helper/html/index.test.ts+1 added-1 removed
1-import { HtmlEscapedCallbackPhase, resolveCallback } from '../../utils/html'1 import { html, raw } from '.'2+import { HtmlEscapedCallbackPhase, resolveCallback } from '../../utils/html'3 4 describe('Tagged Template Literals', () => {5 it('Should escape special characters', () => {6 const name = 'John "Johnny" Smith'72 unmodified linesmodified:src/helper/proxy/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { proxy } from '.'2+import { Hono } from '../../hono'3 4 describe('Proxy Middleware', () => {5 describe('proxy', () => {6 beforeEach(() => {350 unmodified linesmodified:src/helper/route/index.test.ts+1 added-1 removed
1+import { matchedRoutes, routePath, baseRoutePath, basePath } from '.'2 import { Context } from '../../context'3 import { Hono } from '../../hono'3-import { matchedRoutes, routePath, baseRoutePath, basePath } from '.'4 5 const defaultContextOptions = {6 executionCtx: {7 waitUntil: () => {},233 unmodified linesmodified:src/helper/streaming/sse.test.tsx+1 added-1 removed
1+import { streamSSE } from '.'2 /** @jsxImportSource ../../jsx */3 import { Context } from '../../context'4 import { ErrorBoundary, Suspense } from '../../jsx'4-import { streamSSE } from '.'5 6 describe('SSE Streaming helper', () => {7 const req = new Request('http://localhost/')8 let c: Context549 unmodified linesmodified:src/helper/streaming/stream.test.ts+1 added-1 removed
1-import { Context } from '../../context'1 import { stream } from '.'2+import { Context } from '../../context'3 4 describe('Basic Streaming Helper', () => {5 const req = new Request('http://localhost/')6 let c: Context122 unmodified linesmodified:src/helper/streaming/text.test.ts+1 added-1 removed
1-import { Context } from '../../context'1 import { streamText } from '.'2+import { Context } from '../../context'3 4 describe('Text Streaming Helper', () => {5 const req = new Request('http://localhost/')6 let c: Context28 unmodified linesmodified:src/helper/testing/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { testClient } from '.'2+import { Hono } from '../../hono'3 4 describe('hono testClient', () => {5 it('Should return the correct search result', async () => {6 const app = new Hono().get('/search', (c) => c.json({ hello: 'world' }))36 unmodified linesmodified:src/helper/websocket/index.test.ts+1 added-1 removed
1-import { Context } from '../../context'1 import type { WSContextInit } from '.'2 import { WSContext, createWSMessageEvent, defineWebSocketHelper } from '.'3+import { Context } from '../../context'4 5 describe('`createWSMessageEvent`', () => {6 it('Should `createWSMessageEvent` is working for string', () => {7 const randomString = Math.random().toString()117 unmodified linesmodified:src/jsx/dom/hooks/index.test.tsx+1 added-1 removed
1 /** @jsxImportSource ../../ */2 import { JSDOM } from 'jsdom'3-import { render, useCallback, useState } from '..'3 import { useActionState, useFormStatus, useOptimistic } from '.'4+import { render, useCallback, useState } from '..'5 6 describe('Hooks', () => {7 beforeAll(() => {8 global.requestAnimationFrame = (cb) => setTimeout(cb)164 unmodified linesmodified:src/jsx/dom/client.test.tsx+1 added-1 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3-import DefaultExport, { createRoot, hydrateRoot } from './client'3 import { useEffect } from '.'4+import DefaultExport, { createRoot, hydrateRoot } from './client'5 6 describe('createRoot', () => {7 beforeAll(() => {8 global.requestAnimationFrame = (cb) => setTimeout(cb)120 unmodified linesmodified:src/jsx/dom/components.test.tsx+1 added-1 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3+import { ErrorBoundary as ErrorBoundaryDom, Suspense as SuspenseDom, render } from '.' // for dom4 import { ErrorBoundary as ErrorBoundaryCommon, Suspense as SuspenseCommon } from '..' // for common5 // run tests by old style jsx default6 // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings7 import { use, useState } from '../hooks'7-import { ErrorBoundary as ErrorBoundaryDom, Suspense as SuspenseDom, render } from '.' // for dom8 9 runner('Common', SuspenseCommon, ErrorBoundaryCommon)10 runner('DOM', SuspenseDom, ErrorBoundaryDom)11 319 unmodified linesmodified:src/jsx/dom/context.test.tsx+3 added-3 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3+// run tests by old style jsx default4+// hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings5+import { createContext as createContextDom, render, useContext as useContextDom, useState } from '.' // for dom6 import {7 Suspense,8 createContext as createContextCommon,9 use,10 useContext as useContextCommon,11 } from '..' // for common9-// run tests by old style jsx default10-// hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings11-import { createContext as createContextDom, render, useContext as useContextDom, useState } from '.' // for dom12 13 runner('Common', createContextCommon, useContextCommon)14 runner('DOM', createContextDom, useContextDom)15 169 unmodified linesmodified:src/jsx/dom/css.test.tsx+1 added-2 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3 // run tests by old style jsx default4 // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings5-5+import { render } from '.'6 import type { JSXNode } from '..'7 import { Style, createCssContext, css, rawCssString } from '../../helper/css'8 import { minify } from '../../helper/css/common'9 import { renderTest } from '../../helper/css/common.case.test'10-import { render } from '.'10 11 describe('Style and css for jsx/dom', () => {12 beforeAll(() => {13 global.requestAnimationFrame = (cb) => setTimeout(cb)136 unmodified linesmodified:src/jsx/dom/index.test.tsx+13 added-13 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3+import DefaultExport, {4+ cloneElement,5+ cloneElement as cloneElementForDom,6+ createElement as createElementForDom,7+ createContext,8+ useContext,9+ createPortal,10+ flushSync,11+ isValidElement,12+ memo,13+ render,14+ version,15+} from '.'16 import type { Child, FC } from '..'17 // run tests by old style jsx default18 // hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings19 import { createElement, jsx } from '..'9 unmodified lines29 useState,30 } from '../hooks'31 import type { NodeObject } from './render'32 import { build, buildNode } from './render'20-import DefaultExport, {21- cloneElement,22- cloneElement as cloneElementForDom,23- createElement as createElementForDom,24- createContext,25- useContext,26- createPortal,27- flushSync,28- isValidElement,29- memo,30- render,31- version,32-} from '.'33 34 describe('Common', () => {35 ;[createElement, createElementForDom].forEach((createElement) => {36 describe('createElement', () => {3645 unmodified linesmodified:src/jsx/hooks/dom.test.tsx+3 added-3 removed
1 /** @jsxImportSource ../ */2 import { JSDOM } from 'jsdom'3-// run tests by old style jsx default4-// hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings5-import { ErrorBoundary, Suspense, render } from '../dom'3 import {4 createRef,5 forwardRef,6 startTransition,9 unmodified lines16 useSyncExternalStore,17 useTransition,18 useViewTransition,19 } from '.'20+// run tests by old style jsx default21+// hono/jsx/jsx-runtime and hono/jsx/dom/jsx-runtime are tested in their respective settings22+import { ErrorBoundary, Suspense, render } from '../dom'23 24 describe('Hooks', () => {25 beforeAll(() => {26 global.requestAnimationFrame = (cb) => setTimeout(cb)833 unmodified linesmodified:src/jsx/children.test.ts+1 added-1 removed
1-import { Children } from './children'1 import { createElement } from '.'2+import { Children } from './children'3 4 describe('map', () => {5 it('should map children', () => {6 const element = createElement('div', null, 1, 2, 3)46 unmodified linesmodified:src/jsx/components.ts+1 added-1 removed
1 import { raw } from '../helper/html'2 import type { HtmlEscapedCallback, HtmlEscapedString } from '../utils/html'3 import { HtmlEscapedCallbackPhase, resolveCallback } from '../utils/html'4+import type { Child, FC, PropsWithChildren } from './'5 import { jsx, Fragment, isUntrustedObject, renderChildren, renderUntrustedObject } from './base'6 import { DOM_RENDERER } from './constants'7 import { captureRenderContext, useContext } from './context'8 import { ErrorBoundary as ErrorBoundaryDomRenderer } from './dom/components'9 import type { HasRenderToDom } from './dom/render'10 import { StreamingContext } from './streaming'10-import type { Child, FC, PropsWithChildren } from './'11 12 let errorBoundaryCounter = 013 14 export const childrenToString = async (children: Child[]): Promise<HtmlEscapedString[]> => {243 unmodified linesmodified:src/jsx/context.ts+1 added-1 removed
1 import { raw } from '../helper/html'2 import type { HtmlEscapedString } from '../utils/html'3+import type { FC, PropsWithChildren } from './'4 import { isUntrustedObject, JSXFragmentNode, renderChildren, renderUntrustedObject } from './base'5 import { DOM_RENDERER } from './constants'6 import { createContextProviderFunction } from './dom/context'6-import type { FC, PropsWithChildren } from './'7 8 export interface Context<T> extends FC<PropsWithChildren<{ value: T }>> {9 values: T[]10 Provider: FC<PropsWithChildren<{ value: T }>>256 unmodified linesmodified:src/jsx/index.test.tsx+7 added-7 removed
1-/** @jsxImportSource ./ */2-/* eslint-disable @typescript-eslint/no-explicit-any */3-import { html, raw } from '../helper/html'4-import { Hono } from '../hono'5-import { DOM_MEMO } from './constants'6-import { captureRenderContext } from './context'7-import { Suspense, renderToReadableStream } from './streaming'1 import DefaultExport, {2 ErrorBoundary,3 Fragment,4 StrictMode,4 unmodified lines9 useContext,10 version,11 } from '.'12 import type { Context, FC, PropsWithChildren } from '.'13+/** @jsxImportSource ./ */14+/* eslint-disable @typescript-eslint/no-explicit-any */15+import { html, raw } from '../helper/html'16+import { Hono } from '../hono'17+import { DOM_MEMO } from './constants'18+import { captureRenderContext } from './context'19+import { Suspense, renderToReadableStream } from './streaming'20 21 interface SiteData {22 title: string23 children?: any1722 unmodified linesmodified:src/jsx/streaming.ts+1 added-1 removed
4 unmodified lines5 6 import { raw } from '../helper/html'7 import { HtmlEscapedCallbackPhase, resolveCallback } from '../utils/html'8 import type { HtmlEscapedString } from '../utils/html'9+import type { Child, FC, PropsWithChildren, Context as JSXContext } from './'10 import { isUntrustedObject, JSXNode, renderChildren, renderUntrustedObject } from './base'11 import { childrenToString } from './components'12 import { DOM_RENDERER, DOM_STASH } from './constants'13 import { captureRenderContext, createContext, useContext } from './context'14 import { Suspense as SuspenseDomRenderer } from './dom/components'15 import { buildDataStack } from './dom/render'16 import type { HasRenderToDom, NodeObject } from './dom/render'16-import type { Child, FC, PropsWithChildren, Context as JSXContext } from './'17 18 /**19 * Used to specify nonce for scripts generated by `Suspense` and `ErrorBoundary`.20 *211 unmodified linesmodified:src/middleware/basic-auth/index.test.ts+1 added-1 removed
1 import { createHash } from 'crypto'2-import { Hono } from '../../hono'2 import { basicAuth } from '.'3+import { Hono } from '../../hono'4 5 describe('Basic Auth by Middleware', () => {6 let handlerExecuted: boolean7 427 unmodified linesmodified:src/middleware/bearer-auth/index.test.ts+1 added-1 removed
1 import { expectTypeOf } from 'vitest'2+import { bearerAuth } from '.'3 import { Hono } from '../../hono'4 import type { Context, MiddlewareHandler } from '../../index'4-import { bearerAuth } from '.'5 6 describe('Bearer Auth by Middleware', () => {7 let app: Hono8 let handlerExecuted: boolean1010 unmodified linesmodified:src/middleware/body-limit/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { bodyLimit } from '.'2+import { Hono } from '../../hono'3 4 const buildRequestInit = (init: RequestInit = {}): RequestInit & { duplex: 'half' } => {5 const headers: Record<string, string> = {6 'Content-Type': 'text/plain',267 unmodified linesmodified:src/middleware/cache/index.test.ts+1 added-1 removed
1 import { vi } from 'vitest'2+import { cache } from '.'3 import type { ExecutionContext } from '../../context'4 import { Hono } from '../../hono'4-import { cache } from '.'5 6 // Mock7 type StoreMap = Map<string | Request, Response>8 1203 unmodified linesmodified:src/middleware/combine/index.test.ts+1 added-1 removed
1+import { every, except, some } from '.'2 import { Hono } from '../../hono'3 import type { MiddlewareHandler } from '../../types'3-import { every, except, some } from '.'4 5 const nextMiddleware: MiddlewareHandler = async (_, next) => await next()6 7 describe('some', () => {331 unmodified linesmodified:src/middleware/compress/index.test.ts+1 added-1 removed
1+import { compress } from '.'2 import { stream, streamSSE } from '../../helper/streaming'3 import { Hono } from '../../hono'3-import { compress } from '.'4 5 describe('Compress Middleware', () => {6 const app = new Hono()7 528 unmodified linesmodified:src/middleware/context-storage/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { contextStorage, getContext, tryGetContext } from '.'2+import { Hono } from '../../hono'3 4 describe('Context Storage Middleware', () => {5 type Env = {6 Variables: {37 unmodified linesmodified:src/middleware/etag/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { RETAINED_304_HEADERS, etag } from '.'2+import { Hono } from '../../hono'3 4 const createPatternedBody = (length: number) => {5 const body = new Uint8Array(length)6 for (let i = 0; i < body.byteLength; i++) {495 unmodified linesmodified:src/middleware/ip-restriction/index.test.ts+2 added-2 removed
1+import { ipRestriction } from '.'2+import type { IPRestrictionRule } from '.'3 import { Context } from '../../context'4 import type { AddressType, GetConnInfo } from '../../helper/conninfo'5 import { Hono } from '../../hono'4-import { ipRestriction } from '.'5-import type { IPRestrictionRule } from '.'6 7 describe('ipRestriction middleware', () => {8 it('Should restrict', async () => {9 const getConnInfo: GetConnInfo = (c) => {208 unmodified linesmodified:src/middleware/jsx-renderer/index.test.tsx+1 added-1 removed
1 /** @jsxImportSource ../../jsx */2 import { expectTypeOf } from 'vitest'3+import { jsxRenderer, useRequestContext } from '.'4 import { html } from '../../helper/html'5 import { Hono } from '../../hono'6 import type { FC } from '../../jsx'7 import { Suspense } from '../../jsx/streaming'7-import { jsxRenderer, useRequestContext } from '.'8 9 const RequestUrl: FC = () => {10 const c = useRequestContext()11 return html`${c.req.url}`519 unmodified linesmodified:src/middleware/jwk/index.test.ts+1 added-1 removed
1 import { HttpResponse, http } from 'msw'2 import { setupServer } from 'msw/node'3+import { jwk } from '.'4 import { setSignedCookie } from '../../helper/cookie'5 import { Hono } from '../../hono'6 import { HTTPException } from '../../http-exception'7 import { encodeBase64Url } from '../../utils/encode'3 unmodified lines11 import { verifyWithJwks } from '../../utils/jwt/jwt'12 import type { JWTPayload } from '../../utils/jwt/types'13 import { utf8Encoder } from '../../utils/jwt/utf8'14 import * as test_keys from './keys.test.json'14-import { jwk } from '.'15 16 const verify_keys = test_keys.public_keys17 18 describe('JWK', () => {1117 unmodified linesmodified:src/middleware/jwt/index.test.ts+2 added-2 removed
1 import { describe, expectTypeOf } from 'vitest'2-import { Hono } from '../../hono'3-import { HTTPException } from '../../http-exception'2 import { jwt } from '.'3 import type { JwtVariables } from '.'4+import { Hono } from '../../hono'5+import { HTTPException } from '../../http-exception'6 7 describe('JWT', () => {8 describe('Credentials in header', () => {9 let handlerExecuted: boolean793 unmodified linesmodified:src/middleware/language/index.test.ts+1 added-1 removed
1+import { languageDetector } from '.'2 import { Hono } from '../../hono'3 import { DEFAULT_OPTIONS, detectors, normalizeLanguage } from './language'3-import { languageDetector } from '.'4 5 describe('languageDetector', () => {6 const createTestApp = (options = {}) => {7 const app = new Hono()545 unmodified linesmodified:src/middleware/logger/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { logger } from '.'2+import { Hono } from '../../hono'3 4 describe('Logger by Middleware', () => {5 let app: Hono6 let log: string198 unmodified linesmodified:src/middleware/method-not-allowed/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { methodNotAllowed } from '.'2+import { Hono } from '../../hono'3 4 describe('Method Not Allowed Middleware', () => {5 it('infers the environment from the app', () => {6 const app = new Hono<{ Variables: { requestId: string } }>()286 unmodified linesmodified:src/middleware/powered-by/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { poweredBy } from '.'2+import { Hono } from '../../hono'3 4 describe('Powered by Middleware', () => {5 const app = new Hono()6 31 unmodified linesmodified:src/middleware/pretty-json/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { prettyJSON } from '.'2+import { Hono } from '../../hono'3 4 describe('JSON pretty by Middleware', () => {5 it('Should return pretty JSON output', async () => {6 const app = new Hono()212 unmodified linesmodified:src/middleware/request-id/index.test.ts+1 added-1 removed
1+import { requestId } from '.'2 import type { Context } from '../../context'3 import { Hono } from '../../hono'3-import { requestId } from '.'4 5 const regexUUIDv4 = /([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})/6 7 describe('Request ID Middleware', () => {161 unmodified linesmodified:src/middleware/secure-headers/index.test.ts+2 added-2 removed
1-import { Hono } from '../../hono'2-import { poweredBy } from '../powered-by'1 import { NONCE, secureHeaders } from '.'2 import type { ContentSecurityPolicyOptionHandler } from '.'3+import { Hono } from '../../hono'4+import { poweredBy } from '../powered-by'5 6 declare module '../..' {7 interface ContextVariableMap {8 ['test-scriptSrc-nonce']?: string663 unmodified linesmodified:src/middleware/serve-static/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { serveStatic as baseServeStatic } from '.'2+import { Hono } from '../../hono'3 4 describe('Serve Static Middleware', () => {5 const app = new Hono()6 const getContent = vi.fn(async (path) => {315 unmodified linesmodified:src/middleware/timeout/index.test.ts+2 added-2 removed
1+import type { HTTPExceptionFunction } from '.'2+import { timeout } from '.'3 import type { Context } from '../../context'4 import { Hono } from '../../hono'5 import { HTTPException } from '../../http-exception'4-import type { HTTPExceptionFunction } from '.'5-import { timeout } from '.'6 7 describe('Timeout API', () => {8 const app = new Hono()9 61 unmodified linesmodified:src/middleware/timing/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { endTime, setMetric, startTime, timing, wrapTime } from '.'2+import { Hono } from '../../hono'3 4 describe('Server-Timing API', () => {5 const app = new Hono()6 304 unmodified linesmodified:src/middleware/trailing-slash/index.test.ts+1 added-1 removed
1-import { Hono } from '../../hono'1 import { appendTrailingSlash, trimTrailingSlash } from '.'2+import { Hono } from '../../hono'3 4 describe('Resolve trailing slash', () => {5 describe('trimTrailingSlash middleware', () => {6 const app = new Hono({ strict: true })375 unmodified linesmodified:.oxfmtrc.json+3 added
4 unmodified lines5 "semi": false,6 "singleQuote": true,7 "jsxSingleQuote": true,8 "endOfLine": "lf",9+ "sortImports": {10+ "newlinesBetween": false11+ },12 "sortPackageJson": false,13 "ignorePatterns": [14 "dist/",15 "coverage/",4 unmodified linesmodified:eslint.config.mjs+5 added-1 removed
75 unmodified lines76 linterOptions: {77 reportUnusedDisableDirectives: 'error',78 reportUnusedInlineConfigs: 'error',79 },80- rules: typeCheckedRules,80+ rules: {81+ ...typeCheckedRules,82+ // Import order is handled by oxfmt's `sortImports`.83+ 'import-x/order': 'off',84+ },85 })