Closed BracketJohn closed 1 month ago
For context, it throws this if column number exceeds 400.
An improvement should be print out the error message but don't print the code frame.
Just to add / clarify, as I'm unsure whether the change you proposed would address it: The invocation currently also fails with a non-zero status code, blocking CI from passing. This to me feels undesired. I lack experience to say whether this is actually undesired or correct.
Further info: I identified the line that is causing the error. It's the input
-parameter line of this function-signature. It does not seem to exceed 400
column numbers (width as displayed by editor: 201
):
export const getTasks = async (
user: { email: string, role: UserRole },
prisma: ExtendedPrismaClient,
input: z.infer<typeof getTasksInputSchema> = { assignedToUsers: { in: [] }, assignedToRole: { in: [] }, isRelatedToOffer: 'is-related-or-unrelated', relatedOfferId: [], createdByEmail: { in: [] } },
) => {
}
Breaking this line as follows stops the File is too long to fit on the screen
-error from being thrown:
export const getTasks = async (
user: { email: string, role: UserRole },
prisma: ExtendedPrismaClient,
input: z.infer<typeof getTasksInputSchema> =
{ assignedToUsers:
{ in: [] }, assignedToRole: { in: [] }, isRelatedToOffer: 'is-related-or-unrelated', relatedOfferId: [], createdByEmail: { in: [] } },
) => {
}
And instead reveals the "true" error:
> oxlint -c .oxlintrc.json --deny-warnings -D correctness -D perf -D suspicious -D pedantic && eslint --max-warnings 0 .
× eslint-plugin-unicorn(no-object-as-default-parameter): Do not use an object literal as default for parameter `input`.
╭─[server/trpc/routers/userTask/index.ts:33:3]
32 │ input: z.infer<typeof getTasksInputSchema> =
33 │ ╭─▶ { assignedToUsers:
34 │ ╰─▶ { in: [] }, assignedToRole: { in: [] }, isRelatedToOffer: 'is-related-or-unrelated', relatedOfferId: [], createdByEmail: { in: [] } },
35 │ ) => {
╰────
Made some improvements in https://github.com/oxc-project/oxc/pull/5120
Description
We are on
oxlint@0.6.0
. With the following.oxlintrc.json
:And the following oxlint invocation:
The following invocation succeeds (note how I dropped
-D pedantic
):server/trpc/routers/userTask/index.ts
is not a minified file. It's a tRPC router file with 556 LoC.Expected behavior
Given the same
.oxlintrc.json
the invocation including-D pedantic
returns: