Skip to content

Commit

Permalink
chore(lint): use eslint v9 (#197)
Browse files Browse the repository at this point in the history
* chore(lint): use eslint v9

* chore(ci): remove node 19 tests
  • Loading branch information
Jayllyz authored Sep 12, 2024
1 parent fc74926 commit d560932
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 865 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 19.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import baseConfig from '@hono/eslint-config'

export default [...baseConfig]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"postbuild": "publint",
"prerelease": "yarn build && yarn test",
"release": "np",
"lint": "eslint --ext js,ts src test",
"lint:fix": "eslint --ext js,ts src test --fix",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
"format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
},
Expand All @@ -80,12 +80,12 @@
"node": ">=18.14.1"
},
"devDependencies": {
"@hono/eslint-config": "^0.0.4",
"@hono/eslint-config": "^1.0.1",
"@types/jest": "^29.5.3",
"@types/node": "^20.10.0",
"@types/supertest": "^2.0.12",
"@whatwg-node/fetch": "^0.9.14",
"eslint": "^8.55.0",
"eslint": "^9.10.0",
"hono": "^4.4.10",
"jest": "^29.6.1",
"np": "^7.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/conninfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AddressInfo } from 'net'
import type { GetConnInfo } from 'hono/conninfo'
import type { AddressInfo } from 'net'
import type { HttpBindings } from './types'

/**
Expand Down
1 change: 0 additions & 1 deletion src/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export function getInternalBody(
response = (response as any)[getResponseCache]()
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state = (response as any)[stateKey] as { body?: InternalBody } | undefined

return (state && state.body) || undefined
Expand Down
4 changes: 2 additions & 2 deletions src/serve-static.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ReadStream, Stats } from 'fs'
import { createReadStream, lstatSync } from 'fs'
import type { Context, MiddlewareHandler } from 'hono'
import { getFilePath, getFilePathWithoutDefaultDocument } from 'hono/utils/filepath'
import { getMimeType } from 'hono/utils/mime'
import { createReadStream, lstatSync } from 'fs'
import type { ReadStream, Stats } from 'fs'

export type ServeStaticOptions = {
/**
Expand Down
2 changes: 1 addition & 1 deletion test/conninfo.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AddressInfo } from 'net'
import { Hono } from 'hono'
import type { AddressType, ConnInfo } from 'hono/conninfo'
import type { AddressInfo } from 'net'
import { getConnInfo } from '../src/conninfo'

describe('ConnInfo', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/listener.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createServer } from 'node:http'
import request from 'supertest'
import { createServer } from 'node:http'
import { getRequestListener } from '../src/listener'
import { GlobalRequest, Request as LightweightRequest, RequestError } from '../src/request'
import { GlobalResponse, Response as LightweightResponse } from '../src/response'
Expand Down
3 changes: 2 additions & 1 deletion test/response.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createServer, type Server } from 'node:http'
import { createServer } from 'node:http'
import type { Server } from 'node:http'
import type { AddressInfo } from 'node:net'
import { GlobalResponse, Response as LightweightResponse } from '../src/response'

Expand Down
6 changes: 3 additions & 3 deletions test/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import fs from 'node:fs'
import { createServer as createHttp2Server } from 'node:http2'
import { createServer as createHTTPSServer } from 'node:https'
import { Response as PonyfillResponse } from '@whatwg-node/fetch'
import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'
Expand All @@ -9,6 +6,9 @@ import { etag } from 'hono/etag'
import { poweredBy } from 'hono/powered-by'
import { stream } from 'hono/streaming'
import request from 'supertest'
import fs from 'node:fs'
import { createServer as createHttp2Server } from 'node:http2'
import { createServer as createHTTPSServer } from 'node:https'
import { GlobalRequest, Request as LightweightRequest, getAbortController } from '../src/request'
import { GlobalResponse, Response as LightweightResponse } from '../src/response'
import { createAdaptorServer } from '../src/server'
Expand Down
Loading

0 comments on commit d560932

Please sign in to comment.