lint: array-type (#1165)
* lint: array-type * format --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>pull/1176/head
parent
52a1d46cd2
commit
deeeac9e1c
|
@ -3,7 +3,7 @@ dist
|
|||
node_modules
|
||||
*.tgz
|
||||
coverage
|
||||
|
||||
.eslintcache
|
||||
.yarn/*
|
||||
!.yarn/cache
|
||||
!.yarn/patches
|
||||
|
|
|
@ -17,7 +17,6 @@ export default defineConfig(globalIgnores(['.yarn', '**/coverage', '**/dist']),
|
|||
},
|
||||
|
||||
rules: {
|
||||
'@typescript-eslint/array-type': 'off',
|
||||
'@typescript-eslint/await-thenable': 'off',
|
||||
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
||||
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||
|
|
|
@ -145,7 +145,7 @@ export const createEmitter = <EPMap extends EventPayloadMap>(
|
|||
if (!handlers.has(key as EventKey)) {
|
||||
handlers.set(key as EventKey, [])
|
||||
}
|
||||
const handlerArray = handlers.get(key as EventKey) as Array<EventHandler<EPMap[Key]>>
|
||||
const handlerArray = handlers.get(key as EventKey) as EventHandler<EPMap[Key]>[]
|
||||
const limit = options?.maxHandlers ?? 10
|
||||
if (handlerArray.length >= limit) {
|
||||
throw new RangeError(
|
||||
|
|
|
@ -32,7 +32,7 @@ type Options<E extends Env = any, P extends string = any, I extends Input = {}>
|
|||
schema: GraphQLSchema
|
||||
rootResolver?: RootResolver<E, P, I>
|
||||
pretty?: boolean
|
||||
validationRules?: ReadonlyArray<ValidationRule>
|
||||
validationRules?: readonly ValidationRule[]
|
||||
graphiql?: boolean
|
||||
}
|
||||
|
||||
|
|
|
@ -183,9 +183,7 @@ describe('Standard Schema Validation', () => {
|
|||
'/post',
|
||||
sValidator('json', schema, (result, c) => {
|
||||
if (!result.success) {
|
||||
type verify = Expect<
|
||||
Equal<ReadonlyArray<StandardSchemaV1.Issue>, typeof result.error>
|
||||
>
|
||||
type verify = Expect<Equal<readonly StandardSchemaV1.Issue[], typeof result.error>>
|
||||
return c.text(`${result.data.id} is invalid!`, 400)
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -14,7 +14,7 @@ type Hook<
|
|||
> = (
|
||||
result: (
|
||||
| { success: true; data: T }
|
||||
| { success: false; error: ReadonlyArray<StandardSchemaV1.Issue>; data: T }
|
||||
| { success: false; error: readonly StandardSchemaV1.Issue[]; data: T }
|
||||
) & {
|
||||
target: Target
|
||||
},
|
||||
|
|
|
@ -313,7 +313,7 @@ describe('Remove non schema items', () => {
|
|||
})
|
||||
|
||||
const res = await app.request(req)
|
||||
const { message, success } = (await res.json()) as { success: boolean; message: Array<any> }
|
||||
const { message, success } = (await res.json()) as { success: boolean; message: any[] }
|
||||
expect(res.status).toBe(200)
|
||||
expect(success).toBe(true)
|
||||
expect(message).toEqual([
|
||||
|
|
Loading…
Reference in New Issue