chore(lint): use eslint v9 (#197) · TransparentLC/node-server@d560932 · GitHub
Skip to content

Commit d560932

Browse files
authored
chore(lint): use eslint v9 (honojs#197)
* chore(lint): use eslint v9 * chore(ci): remove node 19 tests
1 parent fc74926 commit d560932

12 files changed

Lines changed: 311 additions & 865 deletions

File tree

‎.eslintrc.cjs‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion

‎eslint.config.mjs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import baseConfig from '@hono/eslint-config'
2+
3+
export default [...baseConfig]

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"postbuild": "publint",
6161
"prerelease": "yarn build && yarn test",
6262
"release": "np",
63-
"lint": "eslint --ext js,ts src test",
64-
"lint:fix": "eslint --ext js,ts src test --fix",
63+
"lint": "eslint src test",
64+
"lint:fix": "eslint src test --fix",
6565
"format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
6666
"format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
6767
},
@@ -80,12 +80,12 @@
8080
"node": ">=18.14.1"
8181
},
8282
"devDependencies": {
83-
"@hono/eslint-config": "^0.0.4",
83+
"@hono/eslint-config": "^1.0.1",
8484
"@types/jest": "^29.5.3",
8585
"@types/node": "^20.10.0",
8686
"@types/supertest": "^2.0.12",
8787
"@whatwg-node/fetch": "^0.9.14",
88-
"eslint": "^8.55.0",
88+
"eslint": "^9.10.0",
8989
"hono": "^4.4.10",
9090
"jest": "^29.6.1",
9191
"np": "^7.7.0",

‎src/conninfo.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { AddressInfo } from 'net'
21
import type { GetConnInfo } from 'hono/conninfo'
2+
import type { AddressInfo } from 'net'
33
import type { HttpBindings } from './types'
44

55
/**

‎src/response.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export function getInternalBody(
9999
response = (response as any)[getResponseCache]()
100100
}
101101

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

105104
return (state && state.body) || undefined

‎src/serve-static.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { ReadStream, Stats } from 'fs'
2-
import { createReadStream, lstatSync } from 'fs'
31
import type { Context, MiddlewareHandler } from 'hono'
42
import { getFilePath, getFilePathWithoutDefaultDocument } from 'hono/utils/filepath'
53
import { getMimeType } from 'hono/utils/mime'
4+
import { createReadStream, lstatSync } from 'fs'
5+
import type { ReadStream, Stats } from 'fs'
66

77
export type ServeStaticOptions = {
88
/**

‎test/conninfo.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { AddressInfo } from 'net'
21
import { Hono } from 'hono'
32
import type { AddressType, ConnInfo } from 'hono/conninfo'
3+
import type { AddressInfo } from 'net'
44
import { getConnInfo } from '../src/conninfo'
55

66
describe('ConnInfo', () => {

‎test/listener.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createServer } from 'node:http'
21
import request from 'supertest'
2+
import { createServer } from 'node:http'
33
import { getRequestListener } from '../src/listener'
44
import { GlobalRequest, Request as LightweightRequest, RequestError } from '../src/request'
55
import { GlobalResponse, Response as LightweightResponse } from '../src/response'

‎test/response.test.ts‎

Lines changed: 2 additions & 1 deletion

0 commit comments

Comments
 (0)