diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index d47a4147b..9f162a4f3 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -16,7 +16,7 @@ I want to write the code as I like. So, if you propose great ideas, but I do not appropriate them, the idea may not be accepted. Although, don't worry! -Hono is tested well, polished by the contributors, and used by many developers. And I'll try my best to make Hono cool, beautiful, and ultrafast. +Hono is tested well, polished by the contributors, and used by many developers. And I'll try my best to make Hono cool and hot, beautiful, and ultrafast. ## Installing dependencies diff --git a/runtime-tests/deno/middleware.test.tsx b/runtime-tests/deno/middleware.test.tsx index 9ca6f9bf4..711857183 100644 --- a/runtime-tests/deno/middleware.test.tsx +++ b/runtime-tests/deno/middleware.test.tsx @@ -13,7 +13,7 @@ Deno.test('Basic Auth Middleware', async () => { const app = new Hono() const username = 'hono' - const password = 'acoolproject' + const password = 'ahotproject' app.use( '/auth/*', @@ -29,7 +29,7 @@ Deno.test('Basic Auth Middleware', async () => { assertEquals(res.status, 401) assertEquals(await res.text(), 'Unauthorized') - const credential = 'aG9ubzphY29vbHByb2plY3Q=' + const credential = 'aG9ubzphaG90cHJvamVjdA==' const req = new Request('http://localhost/auth/a') req.headers.set('Authorization', `Basic ${credential}`) diff --git a/runtime-tests/lambda-edge/index.test.ts b/runtime-tests/lambda-edge/index.test.ts index e97558ec5..fa8860c0b 100644 --- a/runtime-tests/lambda-edge/index.test.ts +++ b/runtime-tests/lambda-edge/index.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable quotes */ import type { Callback, CloudFrontConfig, diff --git a/src/adapter/cloudflare-pages/handler.test.ts b/src/adapter/cloudflare-pages/handler.test.ts index 747d11e07..4c74fe54e 100644 --- a/src/adapter/cloudflare-pages/handler.test.ts +++ b/src/adapter/cloudflare-pages/handler.test.ts @@ -18,7 +18,7 @@ function createEventContext( env: { ...context.env, ASSETS: { fetch: vi.fn(), ...context.env?.ASSETS }, - TOKEN: context.env?.TOKEN ?? 'HONOISCOOL', + TOKEN: context.env?.TOKEN ?? 'HONOISHOT', }, functionPath: '_worker.js', next: vi.fn(), @@ -35,7 +35,7 @@ describe('Adapter for Cloudflare Pages', () => { const request = new Request('http://localhost/api/foo') const env = { ASSETS: { fetch }, - TOKEN: 'HONOISCOOL', + TOKEN: 'HONOISHOT', } const waitUntil = vi.fn() const passThroughOnException = vi.fn() @@ -59,7 +59,7 @@ describe('Adapter for Cloudflare Pages', () => { ) expect(res.status).toBe(200) expect(await res.json()).toEqual({ - TOKEN: 'HONOISCOOL', + TOKEN: 'HONOISHOT', requestURL: 'http://localhost/api/foo', }) }) @@ -250,7 +250,7 @@ describe('serveStatic()', () => { const request = new Request('http://localhost/foo.png') const env = { ASSETS: { fetch: assetsFetch }, - TOKEN: 'HONOISCOOL', + TOKEN: 'HONOISHOT', } const eventContext = createEventContext({ request, env }) @@ -269,7 +269,7 @@ describe('serveStatic()', () => { const request = new Request('http://localhost/foo.png') const env = { ASSETS: { fetch: assetsFetch }, - TOKEN: 'HONOISCOOL', + TOKEN: 'HONOISHOT', } const eventContext = createEventContext({ request, env }) diff --git a/src/adapter/service-worker/handler.test.ts b/src/adapter/service-worker/handler.test.ts index f9f2bb673..336f1c8b6 100644 --- a/src/adapter/service-worker/handler.test.ts +++ b/src/adapter/service-worker/handler.test.ts @@ -10,7 +10,6 @@ beforeAll(() => { function fetch(this: undefined | typeof globalThis, arg0: string | Request) { if (this !== globalThis) { const error = new Error( - // eslint-disable-next-line quotes "Failed to execute 'fetch' on 'WorkerGlobalScope': Illegal invocation" ) error.name = 'TypeError' diff --git a/src/context.ts b/src/context.ts index 9c19eff31..ce7220074 100644 --- a/src/context.ts +++ b/src/context.ts @@ -575,7 +575,7 @@ export class Context< * @example * ```ts * app.use('*', async (c, next) => { - * c.set('message', 'Hono is cool!!') + * c.set('message', 'Hono is hot!!') * await next() * }) * ``` diff --git a/src/helper/css/common.case.test.tsx b/src/helper/css/common.case.test.tsx index 112acd190..502fac430 100644 --- a/src/helper/css/common.case.test.tsx +++ b/src/helper/css/common.case.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable quotes */ /** @jsxImportSource ../../jsx */ import type { Style as StyleComponent, diff --git a/src/helper/css/common.ts b/src/helper/css/common.ts index aff38a280..12f543376 100644 --- a/src/helper/css/common.ts +++ b/src/helper/css/common.ts @@ -51,7 +51,7 @@ const toHash = (str: string): string => { const cssStringReStr: string = [ '"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"', // double quoted string - // eslint-disable-next-line quotes + "'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'", // single quoted string ].join('|') const minifyCssRe: RegExp = new RegExp( diff --git a/src/helper/html/index.test.ts b/src/helper/html/index.test.ts index ab4199fd7..5df267972 100644 --- a/src/helper/html/index.test.ts +++ b/src/helper/html/index.test.ts @@ -4,7 +4,7 @@ import { html, raw } from '.' describe('Tagged Template Literals', () => { it('Should escape special characters', () => { const name = 'John "Johnny" Smith' - // eslint-disable-next-line quotes + expect(html`

I'm ${name}.

`.toString()).toBe("

I'm John "Johnny" Smith.

") }) @@ -35,7 +35,7 @@ describe('Tagged Template Literals', () => { const name = Promise.resolve('John "Johnny" Smith') const res = html`

I'm ${name}.

` expect(res).toBeInstanceOf(Promise) - // eslint-disable-next-line quotes + expect((await res).toString()).toBe("

I'm John "Johnny" Smith.

") }) @@ -59,10 +59,9 @@ describe('Tagged Template Literals', () => { ]) const res = html`

I'm ${name}.

` expect(res).toBeInstanceOf(Promise) - // eslint-disable-next-line quotes + expect((await res).toString()).toBe("

I'm Hono.

") expect(await resolveCallback(await res, HtmlEscapedCallbackPhase.Stringify, false, {})).toBe( - // eslint-disable-next-line quotes "

I'm Hono!.

" ) }) @@ -73,7 +72,6 @@ describe('raw', () => { it('Should be marked as escaped.', () => { const name = 'John "Johnny" Smith' expect(html`

I'm ${raw(name)}.

`.toString()).toBe( - // eslint-disable-next-line quotes "

I'm John "Johnny" Smith.

" ) }) diff --git a/src/jsx/dom/css.ts b/src/jsx/dom/css.ts index 5a3b34403..5e073f267 100644 --- a/src/jsx/dom/css.ts +++ b/src/jsx/dom/css.ts @@ -27,7 +27,7 @@ const splitRule = (rule: string): string[] => { const char = rule[i] // consume quote - // eslint-disable-next-line quotes + if (char === "'" || char === '"') { const quote = char i++ @@ -44,7 +44,6 @@ const splitRule = (rule: string): string[] => { } // comments are removed from the rule in advance - if (char === '{') { depth++ continue diff --git a/src/middleware/basic-auth/index.ts b/src/middleware/basic-auth/index.ts index 45d5f6c65..b27b38c3f 100644 --- a/src/middleware/basic-auth/index.ts +++ b/src/middleware/basic-auth/index.ts @@ -49,7 +49,7 @@ type BasicAuthOptions = * '/auth/*', * basicAuth({ * username: 'hono', - * password: 'acoolproject', + * password: 'ahotproject', * }) * ) * diff --git a/src/middleware/bearer-auth/index.ts b/src/middleware/bearer-auth/index.ts index 0388e5e65..1b5ab9b18 100644 --- a/src/middleware/bearer-auth/index.ts +++ b/src/middleware/bearer-auth/index.ts @@ -60,7 +60,7 @@ type BearerAuthOptions = * ```ts * const app = new Hono() * - * const token = 'honoiscool' + * const token = 'honoishot' * * app.use('/api/*', bearerAuth({ token })) * diff --git a/src/middleware/body-limit/index.test.ts b/src/middleware/body-limit/index.test.ts index 60fae554b..a923005f2 100644 --- a/src/middleware/body-limit/index.test.ts +++ b/src/middleware/body-limit/index.test.ts @@ -20,12 +20,12 @@ const buildRequestInit = (init: RequestInit = {}): RequestInit & { duplex: 'half describe('Body Limit Middleware', () => { let app: Hono - const exampleText = 'hono is so cool' // 15byte - const exampleText2 = 'hono is so cool and cute' // 24byte + const exampleText = 'hono is so hot' // 14byte + const exampleText2 = 'hono is so hot and cute' // 23byte beforeEach(() => { app = new Hono() - app.use('*', bodyLimit({ maxSize: 15 })) + app.use('*', bodyLimit({ maxSize: 14 })) app.get('/', (c) => c.text('index')) app.post('/body-limit-15byte', async (c) => { return c.text(await c.req.raw.text()) diff --git a/src/middleware/context-storage/index.test.ts b/src/middleware/context-storage/index.test.ts index d9713b975..432d4ef6e 100644 --- a/src/middleware/context-storage/index.test.ts +++ b/src/middleware/context-storage/index.test.ts @@ -12,7 +12,7 @@ describe('Context Storage Middleware', () => { app.use(contextStorage()) app.use(async (c, next) => { - c.set('message', 'Hono is cool!!') + c.set('message', 'Hono is hot!!') await next() }) app.get('/', (c) => { @@ -25,6 +25,6 @@ describe('Context Storage Middleware', () => { it('Should get context', async () => { const res = await app.request('/') - expect(await res.text()).toBe('Hono is cool!!') + expect(await res.text()).toBe('Hono is hot!!') }) }) diff --git a/src/middleware/context-storage/index.ts b/src/middleware/context-storage/index.ts index 4447303c5..a7b69afe0 100644 --- a/src/middleware/context-storage/index.ts +++ b/src/middleware/context-storage/index.ts @@ -29,7 +29,7 @@ const asyncLocalStorage = new AsyncLocalStorage() * app.use(contextStorage()) * * app.use(async (c, next) => { - * c.set('message', 'Hono is cool!!) + * c.set('message', 'Hono is hot!!) * await next() * }) * diff --git a/src/middleware/etag/index.test.ts b/src/middleware/etag/index.test.ts index 296c74bb9..c8bba193e 100644 --- a/src/middleware/etag/index.test.ts +++ b/src/middleware/etag/index.test.ts @@ -6,18 +6,18 @@ describe('Etag Middleware', () => { const app = new Hono() app.use('/etag/*', etag()) app.get('/etag/abc', (c) => { - return c.text('Hono is cool') + return c.text('Hono is hot') }) app.get('/etag/def', (c) => { - return c.json({ message: 'Hono is cool' }) + return c.json({ message: 'Hono is hot' }) }) let res = await app.request('http://localhost/etag/abc') expect(res.headers.get('ETag')).not.toBeFalsy() - expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"') + expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"') res = await app.request('http://localhost/etag/def') expect(res.headers.get('ETag')).not.toBeFalsy() - expect(res.headers.get('ETag')).toBe('"4515561204e8269cb4468d5b39288d8f2482dcfe"') + expect(res.headers.get('ETag')).toBe('"67340414f1a52c4669a6cec71f0ae04532b29249"') }) it('Should return etag header with another algorithm', async () => { @@ -35,21 +35,21 @@ describe('Etag Middleware', () => { }) ) app.get('/etag/abc', (c) => { - return c.text('Hono is cool') + return c.text('Hono is hot') }) app.get('/etag/def', (c) => { - return c.json({ message: 'Hono is cool' }) + return c.json({ message: 'Hono is hot' }) }) let res = await app.request('http://localhost/etag/abc') expect(res.headers.get('ETag')).not.toBeFalsy() expect(res.headers.get('ETag')).toBe( - '"ee7e84f92c4f54fec768123ac23003a6eb8437db95bcfbfc35db477af1ccb49e"' + '"ed00834279b4fd5dcdc7ab6a5c9774de8afb2de30da2c8e0f17d0952839b5370"' ) res = await app.request('http://localhost/etag/def') expect(res.headers.get('ETag')).not.toBeFalsy() expect(res.headers.get('ETag')).toBe( - '"6ae7438c67f07b60b2ab069dbce206b00d3528c690840a77e0222d37398a8547"' + '"83b61a767db6e22afea68dd645b4d4597a06276c8ce7f895ad865cf4ab154ec4"' ) }) @@ -159,12 +159,12 @@ describe('Etag Middleware', () => { const app = new Hono() app.use('/etag/*', etag({ weak: true })) app.get('/etag/abc', (c) => { - return c.text('Hono is cool') + return c.text('Hono is hot') }) const res = await app.request('http://localhost/etag/abc') expect(res.headers.get('ETag')).not.toBeFalsy() - expect(res.headers.get('ETag')).toBe('W/"4e32298b1cb4edc595237405e5b696e105c2399a"') + expect(res.headers.get('ETag')).toBe('W/"d104fafdb380655dab607c9bddc4d4982037afa1"') }) it('Should handle conditional GETs', async () => { @@ -222,11 +222,11 @@ describe('Etag Middleware', () => { const app = new Hono() app.use('/etag/*', etag()) app.use('/etag/*', etag()) - app.get('/etag/abc', (c) => c.text('Hono is cool')) + app.get('/etag/abc', (c) => c.text('Hono is hot')) const res = await app.request('http://localhost/etag/abc') expect(res.headers.get('ETag')).not.toBeFalsy() - expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"') + expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"') }) it('Should not override ETag headers from upstream', async () => { @@ -251,7 +251,7 @@ describe('Etag Middleware', () => { }) ) app.get('/etag', (c) => { - return c.text('Hono is cool', 200, { + return c.text('Hono is hot', 200, { 'cache-control': cacheControl, 'x-message-retain': message, 'x-message': message, @@ -259,12 +259,12 @@ describe('Etag Middleware', () => { }) const res = await app.request('/etag', { headers: { - 'If-None-Match': '"4e32298b1cb4edc595237405e5b696e105c2399a"', + 'If-None-Match': '"d104fafdb380655dab607c9bddc4d4982037afa1"', }, }) expect(res.status).toBe(304) expect(res.headers.get('ETag')).not.toBeFalsy() - expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"') + expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"') expect(res.headers.get('Cache-Control')).toBe(cacheControl) expect(res.headers.get('x-message-retain')).toBe(message) expect(res.headers.get('x-message')).toBeFalsy() @@ -288,7 +288,7 @@ describe('Etag Middleware', () => { it('Should not generate etag', async () => { const app = new Hono() app.use('/etag/*', etag()) - app.get('/etag/no-digest', (c) => c.text('Hono is cool')) + app.get('/etag/no-digest', (c) => c.text('Hono is hot')) const res = await app.request('/etag/no-digest') expect(res.status).toBe(200) expect(res.headers.get('ETag')).toBeNull() diff --git a/src/middleware/etag/index.ts b/src/middleware/etag/index.ts index 663b25613..9309e1bcb 100644 --- a/src/middleware/etag/index.ts +++ b/src/middleware/etag/index.ts @@ -68,7 +68,7 @@ function initializeGenerator( * * app.use('/etag/*', etag()) * app.get('/etag/abc', (c) => { - * return c.text('Hono is cool') + * return c.text('Hono is hot') * }) * ``` */ diff --git a/src/middleware/request-id/index.test.ts b/src/middleware/request-id/index.test.ts index 739cddedd..1ca247001 100644 --- a/src/middleware/request-id/index.test.ts +++ b/src/middleware/request-id/index.test.ts @@ -20,13 +20,13 @@ describe('Request ID Middleware', () => { it('Should return custom request id', async () => { const res = await app.request('http://localhost/requestId', { headers: { - 'X-Request-Id': 'hono-is-cool', + 'X-Request-Id': 'hono-is-hot', }, }) expect(res).not.toBeNull() expect(res.status).toBe(200) - expect(res.headers.get('X-Request-Id')).toBe('hono-is-cool') - expect(await res.text()).toBe('hono-is-cool') + expect(res.headers.get('X-Request-Id')).toBe('hono-is-hot') + expect(await res.text()).toBe('hono-is-hot') }) it('Should return random request id without using request header', async () => { @@ -136,13 +136,13 @@ describe('Request ID Middleware with custom header', () => { it('Should return custom request id', async () => { const res = await app.request('http://localhost/requestId', { headers: { - 'Hono-Request-Id': 'hono-is-cool', + 'Hono-Request-Id': 'hono-is-hot', }, }) expect(res).not.toBeNull() expect(res.status).toBe(200) - expect(res.headers.get('Hono-Request-Id')).toBe('hono-is-cool') - expect(await res.text()).toBe('hono-is-cool') + expect(res.headers.get('Hono-Request-Id')).toBe('hono-is-hot') + expect(await res.text()).toBe('hono-is-hot') }) it('Should not return request id', async () => { diff --git a/src/middleware/secure-headers/index.test.ts b/src/middleware/secure-headers/index.test.ts index 0dbccd980..c9d932b90 100644 --- a/src/middleware/secure-headers/index.test.ts +++ b/src/middleware/secure-headers/index.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable quotes */ import { Hono } from '../../hono' import { poweredBy } from '../powered-by' import { NONCE, secureHeaders } from '.' @@ -199,7 +198,7 @@ describe('Secure Headers Middleware', () => { const app = new Hono() app.get('/test', secureHeaders(), poweredBy(), async (c) => { - return c.text('Hono is cool') + return c.text('Hono is hot') }) app.get( @@ -209,19 +208,19 @@ describe('Secure Headers Middleware', () => { }), poweredBy(), async (c) => { - return c.text('Hono is cool') + return c.text('Hono is hot') } ) const res = await app.request('/test') const poweredby = res.headers.get('X-Powered-By') expect(poweredby).toEqual(null) - expect(await res.text()).toEqual('Hono is cool') + expect(await res.text()).toEqual('Hono is hot') const res2 = await app.request('/test2') const poweredby2 = res2.headers.get('X-Powered-By') expect(poweredby2).toEqual('Hono') - expect(await res2.text()).toEqual('Hono is cool') + expect(await res2.text()).toEqual('Hono is hot') }) describe.each([ diff --git a/src/utils/accept.test.ts b/src/utils/accept.test.ts index 4d5655182..ee7f2800d 100644 --- a/src/utils/accept.test.ts +++ b/src/utils/accept.test.ts @@ -47,7 +47,7 @@ describe('parseAccept Comprehensive Tests', () => { expect(result[0].params).toEqual({ a: '1', b: '"2"', - // eslint-disable-next-line quotes + c: "'3'", d: '"semi;colon"', e: '"nested"quoted""',