Skip to content

Commit cf61d27

Browse files
ci: apply automated fixes
1 parent 374760a commit cf61d27

File tree

139 files changed

+438
-419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+438
-419
lines changed

packages/ajv-validator/eslint-suppressions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
"count": 1
2525
}
2626
}
27-
}
27+
}

packages/ajv-validator/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Basic', () => {
2828
})
2929

3030
type Actual = ExtractSchema<typeof route>
31-
type Expected = {
31+
interface Expected {
3232
'/author': {
3333
$post: {
3434
input: {

packages/ajv-validator/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export function ajvValidator<
7676
E,
7777
P,
7878
{
79-
in: { [K in Target]: T }
80-
out: { [K in Target]: T }
79+
in: Record<Target, T>
80+
out: Record<Target, T>
8181
}
8282
> {
8383
const ajv = new Ajv()

packages/arktype-validator/eslint-suppressions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
"count": 1
3131
}
3232
}
33-
}
33+
}

packages/arktype-validator/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('Basic', () => {
4747
)
4848

4949
type Actual = ExtractSchema<typeof route>
50-
type Expected = {
50+
interface Expected {
5151
'/author': {
5252
$post: {
5353
input: {
@@ -107,7 +107,7 @@ describe('Basic', () => {
107107
expect(res).not.toBeNull()
108108
expect(res.status).toBe(400)
109109
const data = (await res.json()) as { success: boolean }
110-
expect(data['success']).toBe(false)
110+
expect(data.success).toBe(false)
111111
})
112112

113113
it("doesn't return cookies after headers validation", async () => {

packages/arktype-validator/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export const arktypeValidator = <
2222
I = T['inferIn'],
2323
O = T['infer'],
2424
V extends {
25-
in: HasUndefined<I> extends true ? { [K in Target]?: I } : { [K in Target]: I }
26-
out: { [K in Target]: O }
25+
in: HasUndefined<I> extends true ? Partial<Record<Target, I>> : Record<Target, I>
26+
out: Record<Target, O>
2727
} = {
28-
in: HasUndefined<I> extends true ? { [K in Target]?: I } : { [K in Target]: I }
29-
out: { [K in Target]: O }
28+
in: HasUndefined<I> extends true ? Partial<Record<Target, I>> : Record<Target, I>
29+
out: Record<Target, O>
3030
},
3131
>(
3232
target: Target,

packages/auth-js/eslint-suppressions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
"@typescript-eslint/no-floating-promises": {
5555
"count": 3
5656
},
57+
"@typescript-eslint/no-non-null-asserted-optional-chain": {
58+
"count": 1
59+
},
60+
"@typescript-eslint/no-non-null-assertion": {
61+
"count": 1
62+
},
5763
"@typescript-eslint/no-unnecessary-condition": {
5864
"count": 10
5965
},
@@ -76,4 +82,4 @@
7682
"count": 4
7783
}
7884
}
79-
}
85+
}

packages/auth-js/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ export type SessionContextValue<R extends boolean = false> = R extends true
8585
status: 'unauthenticated' | 'loading'
8686
}
8787

88-
export type WindowProps = {
88+
export interface WindowProps {
8989
url: string
9090
title: string
9191
width: number
9292
height: number
9393
}
9494

95-
export type AuthState = {
95+
export interface AuthState {
9696
status: 'loading' | 'success' | 'errored'
9797
error?: string
9898
}

packages/auth-js/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ describe('reqWithEnvUrl()', async () => {
165165
app.use(
166166
'/api/auth/*',
167167
validator('form', (value, _) => {
168-
const csrfToken = value['csrfToken']
168+
const csrfToken = value.csrfToken
169169
return {
170170
csrfToken,
171171
}

packages/auth-js/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ declare module 'hono' {
1414
}
1515
}
1616

17-
export type AuthEnv = {
17+
export interface AuthEnv {
1818
AUTH_URL?: string
1919
AUTH_SECRET: string
2020
AUTH_REDIRECT_PROXY_URL?: string
2121
[key: string]: string | undefined
2222
}
2323

24-
export type AuthUser = {
24+
export interface AuthUser {
2525
session: Session
2626
token?: JWT
2727
user?: AdapterUser
@@ -57,7 +57,7 @@ export function reqWithEnvUrl(req: Request, authUrl?: string): Request {
5757
}
5858
if (host != null) {
5959
url.host = host
60-
const portMatch = host.match(/:(\d+)$/)
60+
const portMatch = /:(\d+)$/.exec(host)
6161
if (portMatch) {
6262
url.port = portMatch[1]
6363
} else {
@@ -82,7 +82,7 @@ export async function getAuthUser(c: Context): Promise<AuthUser | null> {
8282

8383
let authUser: AuthUser = {} as AuthUser
8484

85-
const response = (await Auth(request, {
85+
const response = await Auth(request, {
8686
...config,
8787
callbacks: {
8888
...config.callbacks,
@@ -93,7 +93,7 @@ export async function getAuthUser(c: Context): Promise<AuthUser | null> {
9393
return { user, ...session } satisfies Session
9494
},
9595
},
96-
})) as Response
96+
})
9797

9898
const session = (await response.json()) as Session | null
9999

0 commit comments

Comments
 (0)