fix: replace @ts-ignore with @ts-expect-error to fix biome lint errors (#26849)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Volnei MunhozandDevin AI authored and GitHub committed 2026-01-14 19:05:57 -03:00
1 parent 9bfd11a36a
commit 92d2b59946
21 files changed
+30 -81

No files matched your search

@@ -44,8 +44,7 @@ export class FloatingButton extends HTMLElement {
// Button added here triggers the modal on click. So, it has to have the same data attributes as the modal target as well
dataset!: DOMStringMap & FloatingButtonDataset & ModalTargetDatasetProps;
buttonWrapperStyleDisplay!: HTMLElement["style"]["display"];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
static get observedAttributes() {
return dataAttributes;
}
@@ -12,8 +12,6 @@ export class ModalBox extends EmbedElement {
}
};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
static get observedAttributes() {
return ["state"];
}
+4 -8
View File
@@ -266,8 +266,7 @@ export class Cal {
error(`Instruction ${method} not FOUND`);
}
try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore There can be any method which can have any number of arguments.
// @ts-expect-error There can be any method which can have any number of arguments.
this.api[method](...args);
} catch (e) {
// Instead of throwing error, log and move forward in the queue
@@ -283,8 +282,7 @@ export class Cal {
queue.splice(0);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
/** @ts-ignore */ // We changed the definition of push here.
// @ts-expect-error We changed the definition of push here.
queue.push = (instruction) => {
this.processInstruction(instruction);
};
@@ -363,8 +361,7 @@ export class Cal {
}
// Merge searchParams from config onto the URL which might have query params already
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-ignore TS2802: URLSearchParams iteration requires downlevelIteration
for (const [key, value] of searchParams) {
urlInstance.searchParams.append(key, value);
}
@@ -1565,8 +1562,7 @@ window.addEventListener("message", (e) => {
if (!actionManager) {
throw new Error(`Unhandled Action ${parsedAction}`);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error
actionManager.fire(parsedAction.type, detail.data);
});
+1 -2
View File
@@ -33,8 +33,7 @@ export function fromEntriesWithDuplicateKeys(entries: IterableIterator<[string,
}
// Consider setting atleast ES2015 as target
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore TS2802: IterableIterator iteration requires downlevelIteration
for (const [key, value] of entries) {
if (result.hasOwnProperty(key)) {
let currentValue = result[key];
+2 -4
View File
@@ -70,8 +70,7 @@ if (!calLink) {
// TODO: Reuse the embed code snippet from the embed-snippet package - Not able to use it because of circular dependency
// Install Cal Embed Code Snippet
(function (C, A, L) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
const p = function (a, ar) {
a.q.push(ar);
};
@@ -95,8 +94,7 @@ if (!calLink) {
p(api, arguments);
};
const namespace = ar[1];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
api.q = api.q || [];
if (typeof namespace === "string") {
// Make sure that even after re-execution of the snippet, the namespace is not overridden
@@ -43,7 +43,6 @@ export default function EmbedSnippet(url = EMBED_LIB_URL) {
cal.ns = {};
cal.q = cal.q || [];
//@ts-ignore
d.head.appendChild(d.createElement("script")).src = A;
cal.loaded = true;
}
+1 -6
View File
@@ -33,19 +33,14 @@ beforeEach(() => {
export const constantsScenarios = {
enableTeamBilling: () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
mockedConstants.IS_TEAM_BILLING_ENABLED = true;
},
setWebsiteUrl: (url: string) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
mockedConstants.WEBSITE_URL = url;
},
set: (envVariables: Record<string, string>) => {
Object.entries(envVariables).forEach(([key, value]) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error - dynamic key access on Partial type
mockedConstants[key] = value;
});
},
@@ -60,8 +60,7 @@ const createBooking = (overrides = {}) => ({
describe("buildCalEventFromBooking", () => {
beforeEach(() => {
// vi.resetAllMocks();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error
getTranslation.mockImplementation((locale: string, namespace: string) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
const translate = () => {};
+1 -2
View File
@@ -46,8 +46,7 @@ export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: numb
return cause;
}
if (typeof cause === "string") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore https://github.com/tc39/proposal-error-cause
// @ts-ignore https://github.com/tc39/proposal-error-cause - must use @ts-ignore because different packages have different TS lib targets
return new Error(cause, { cause });
}
+1 -2
View File
@@ -6,8 +6,7 @@ export function fromEntriesWithDuplicateKeys(entries: IterableIterator<[string,
}
// Consider setting atleast ES2015 as target
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error
for (const [key, value] of entries) {
if (result.hasOwnProperty(key)) {
let currentValue = result[key];
+1 -2
View File
@@ -12,8 +12,7 @@ function fromEntriesWithDuplicateKeys(entries: IterableIterator<[string, string]
}
// Consider setting atleast ES2015 as target
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error
for (const [key, value] of entries) {
if (result.hasOwnProperty(key)) {
let currentValue = result[key];
+2 -4
View File
@@ -4,11 +4,9 @@ export function useTraceUpdate(props: { [s: string]: unknown } | ArrayLike<unkno
const prev = useRef(props);
useEffect(() => {
const changedProps = Object.entries(props).reduce((ps, [k, v]) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: fix this
// @ts-expect-error TODO: fix this
if (prev.current[k] !== v) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: fix this
// @ts-expect-error TODO: fix this
ps[k] = [prev.current[k], v];
}
return ps;
-2
View File
@@ -37,8 +37,6 @@ export class HttpError<TCode extends number = number> extends Error {
url: response.url,
method: request.method,
statusCode: response.status,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore the data property is a custom one from ErrorWithCode
data: parsedError.data as Record<string, unknown>,
});
}
@@ -1,8 +1,6 @@
import { vi } from "vitest";
vi.mock("@calcom/lib/server/serviceAccountKey", async (importOriginal) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const actual = await importOriginal<any>();
return {
...actual,
@@ -177,10 +177,7 @@ export class SelectedCalendarRepository {
error: { not: null },
watchAttempts: {
lt: {
// Using ts-ignore instead of ts-expect-error because I am seeing conflicting errors in CI. In one case ts-expect-error fails with `Unused '@ts-expect-error' directive.`
// Removing ts-expect-error fails in another case that _ref isn't defined
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error - _ref is a Prisma extension field
_ref: "maxAttempts",
_container: "SelectedCalendar",
},
@@ -220,10 +217,7 @@ export class SelectedCalendarRepository {
error: { not: null },
unwatchAttempts: {
lt: {
// Using ts-ignore instead of ts-expect-error because I am seeing conflicting errors in CI. In one case ts-expect-error fails with `Unused '@ts-expect-error' directive.`
// Removing ts-expect-error fails in another case that _ref isn't defined
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error - _ref is a Prisma extension field
_ref: "maxAttempts",
_container: "SelectedCalendar",
},
+5 -10
View File
@@ -6,13 +6,11 @@ import { usernameCheckForSignup } from "./username";
describe("usernameCheckForSignup ", async () => {
beforeEach(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
prismaMock.user.findUnique.mockImplementation(() => {
return null;
});
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
prismaMock.user.findMany.mockImplementation(() => {
return [];
});
@@ -60,8 +58,7 @@ describe("usernameCheckForSignup ", async () => {
});
function mockUserInDB({ id, email, username }: { id: number; email: string; username: string }) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
prismaMock.user.findUnique.mockImplementation((arg) => {
if (arg.where.email === email) {
return {
@@ -75,12 +72,10 @@ function mockUserInDB({ id, email, username }: { id: number; email: string; user
}
function mockMembership({ userId }: { userId: number }) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
prismaMock.membership.findFirst.mockImplementation((arg) => {
const isOrganizationWhereClause =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
arg?.where?.team?.metadata?.path[0] === "isOrganization" && arg?.where?.team?.metadata?.equals === true;
if (arg?.where?.userId === userId && isOrganizationWhereClause) {
return {
+2 -4
View File
@@ -10,11 +10,9 @@ export const slugify = (str: string, forDisplayingInput?: boolean) => {
.toLowerCase() // Convert to lowercase
.trim() // Remove whitespace from both sides
.normalize("NFD") // Normalize to decomposed form for handling accents
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore - Unicode property escapes require ES6+ target in some TS configs
.replace(/\p{Diacritic}/gu, "") // Remove any diacritics (accents) from characters
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore - Unicode property escapes require ES6+ target in some TS configs
.replace(/[^.\p{L}\p{N}\p{Zs}\p{Emoji}]+/gu, "-") // Replace any non-alphanumeric characters (including Unicode and except "." period) with a dash
.replace(/[\s_#]+/g, "-") // Replace whitespace, # and underscores with a single dash
.replace(/^-+/, "") // Remove dashes from start
@@ -131,11 +131,9 @@ export const toggleHandler = async ({ input, ctx }: ToggleOptions) => {
...(eventType.metadata as object),
apps: {
// From this comment we can not type JSON fields in Prisma https://github.com/prisma/prisma/issues/3219#issuecomment-670202980
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
...eventType.metadata?.apps,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
[app.slug]: { ...eventType.metadata?.apps[app.slug], enabled: false },
},
},
@@ -101,8 +101,7 @@ export const duplicateHandler = async ({ ctx, input }: DuplicateOptions) => {
webhooks: _webhooks,
schedule: _schedule,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - descriptionAsSafeHTML is added on the fly using a prisma middleware it shouldn't be used to create event type. Such a property doesn't exist on schema
// @ts-expect-error - descriptionAsSafeHTML is added on the fly using a prisma middleware it shouldn't be used to create event type. Such a property doesn't exist on schema
descriptionAsSafeHTML: _descriptionAsSafeHTML,
secondaryEmailId,
instantMeetingScheduleId: _instantMeetingScheduleId,
@@ -42,8 +42,7 @@ async function createTestTeam(data: {
slug: data.slug || slugify(data.name),
parentId: data.parentId,
isOrganization: data.isOrganization ?? false,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-expect-error
metadata: data.metadata || {},
isPlatform: data.isPlatform ?? false,
},
@@ -17,8 +17,7 @@ const inviteMemberUtilsMock = mockDeep<typeof inviteMemberUtils>();
export const inviteMemberutilsScenarios = {
checkPermissions: {
fakePassed: () =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
inviteMemberUtilsMock.checkPermissions.mockResolvedValue(undefined),
},
getTeamOrThrow: {
@@ -29,8 +28,7 @@ export const inviteMemberutilsScenarios = {
parentId: null,
...team,
};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error
inviteMemberUtilsMock.getTeamOrThrow.mockImplementation((teamId) => {
if (forInput.teamId === teamId) {
return fakedVal;
@@ -49,8 +47,6 @@ export const inviteMemberutilsScenarios = {
useActual: async function () {
const actualImport = await vi.importActual<typeof inviteMemberUtils>("../utils");
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
return inviteMemberUtilsMock.getOrgState.mockImplementation(actualImport.getOrgState);
},
},
@@ -58,8 +54,6 @@ export const inviteMemberutilsScenarios = {
useActual: async function () {
const actualImport = await vi.importActual<typeof inviteMemberUtils>("../utils");
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
return inviteMemberUtilsMock.getUniqueInvitationsOrThrowIfEmpty.mockImplementation(
actualImport.getUniqueInvitationsOrThrowIfEmpty
);
@@ -90,8 +84,6 @@ export const inviteMemberutilsScenarios = {
useActual: async function () {
const actualImport = await vi.importActual<typeof inviteMemberUtils>("../utils");
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
return inviteMemberUtilsMock.getOrgConnectionInfo.mockImplementation(actualImport.getOrgConnectionInfo);
},
},