c7861be520
Once this is merged, oxlint is at a pretty sensible baseline. **Enable `no-unused-vars`, `typescript/consistent-type-imports`, and `import/no-duplicates` lint rules** Turns on three previously-disabled oxlint rules across the monorepo and fixes all violations: - **`no-unused-vars`** – enabled as an error with standard ignore patterns: unused function arguments are ignored by default (`args: "none"`), variables/caught errors/destructured array elements prefixed with `_` are allowed, and rest siblings are permitted. - **`typescript/consistent-type-imports`** – enforced as an error; all type-only imports now use the `import type` syntax. - **`import/no-duplicates`** – enforced as an error; duplicate import statements from the same module have been merged. The remaining commits clean up the violations found across the codebase: removing unused variables/imports/type aliases, adding `_` prefixes to intentionally unused bindings, fixing duplicate imports, and converting value imports to `import type` where appropriate.
26 lines
919 B
TypeScript
26 lines
919 B
TypeScript
import type { TaskTriggerSource } from "@trigger.dev/database";
|
|
import type { PrismaClientOrTransaction } from "~/db.server";
|
|
import { sqlDatabaseSchema } from "~/db.server";
|
|
|
|
export { getTaskIdentifiers } from "~/services/taskIdentifierRegistry.server";
|
|
export type { TaskIdentifierEntry } from "~/services/taskIdentifierCache.server";
|
|
|
|
/**
|
|
*
|
|
* @param prisma An efficient query to get all task identifiers for a project.
|
|
* It has indexes for fast performance.
|
|
* It does NOT care about versions, so includes all tasks ever created.
|
|
*/
|
|
export function getAllTaskIdentifiers(prisma: PrismaClientOrTransaction, environmentId: string) {
|
|
return prisma.$queryRaw<
|
|
{
|
|
slug: string;
|
|
triggerSource: TaskTriggerSource;
|
|
}[]
|
|
>`
|
|
SELECT DISTINCT(slug), "triggerSource"
|
|
FROM ${sqlDatabaseSchema}."BackgroundWorkerTask"
|
|
WHERE "runtimeEnvironmentId" = ${environmentId}
|
|
ORDER BY slug ASC;`;
|
|
}
|