diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index b4adf1dacd..b7fb17a5a8 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -12,7 +12,6 @@ import { DialogClose, DialogContent, HorizontalTabs, - InputLeading, Label, showToast, Switch, diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index 88039a5eb1..879f579c06 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -6,7 +6,7 @@ import { useSession } from "next-auth/react"; import Head from "next/head"; import { useRouter } from "next/router"; import { useEffect, useMemo, useReducer, useState } from "react"; -import { useFieldArray, useForm, useWatch, Controller } from "react-hook-form"; +import { useFieldArray, useForm, useWatch } from "react-hook-form"; import { FormattedNumber, IntlProvider } from "react-intl"; import { v4 as uuidv4 } from "uuid"; import { z } from "zod"; diff --git a/packages/config/eslint-preset.js b/packages/config/eslint-preset.js index 05f2dc7dee..a0eeee0c8a 100644 --- a/packages/config/eslint-preset.js +++ b/packages/config/eslint-preset.js @@ -2,6 +2,7 @@ module.exports = { root: true, extends: ["plugin:playwright/playwright-test", "next", "plugin:prettier/recommended", "turbo"], + plugins: ["unused-imports"], parserOptions: { tsconfigRootDir: __dirname, project: ["./tsconfig.json"], @@ -18,6 +19,12 @@ module.exports = { "jsx-a11y/role-supports-aria-props": "off", // @see https://github.com/vercel/next.js/issues/27989#issuecomment-897638654 "react/jsx-curly-brace-presence": ["error", { props: "never", children: "never" }], "react/self-closing-comp": ["error", { component: true, html: true }], + "@typescript-eslint/no-unused-vars": "off", + "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-vars": [ + "warn", + { vars: "all", varsIgnorePattern: "^_", args: "after-used", argsIgnorePattern: "^_" }, + ], }, overrides: [ { diff --git a/packages/config/package.json b/packages/config/package.json index 821ae7c4ae..8c9312bab1 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -24,6 +24,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.1", "eslint": "^8.22.0", + "eslint-plugin-unused-imports": "^2.0.0", "prettier": "^2.7.1", "prettier-plugin-tailwindcss": "^0.1.13", "tailwind-scrollbar": "^2.0.1", diff --git a/packages/lib/hooks/useKeyPress.ts b/packages/lib/hooks/useKeyPress.ts index c025367d81..8ee7e83c17 100644 --- a/packages/lib/hooks/useKeyPress.ts +++ b/packages/lib/hooks/useKeyPress.ts @@ -1,4 +1,4 @@ -import { useState, useEffect, RefObject, useRef } from "react"; +import { useState, useEffect, RefObject } from "react"; export function useKeyPress( targetKey: string, diff --git a/packages/lib/payment/deletePayment.ts b/packages/lib/payment/deletePayment.ts index 53033f4cca..ea7954caf8 100644 --- a/packages/lib/payment/deletePayment.ts +++ b/packages/lib/payment/deletePayment.ts @@ -1,5 +1,4 @@ import appStore from "@calcom/app-store"; -import { EventTypeAppsList } from "@calcom/app-store/utils"; import { AppCategories, Payment, Prisma } from ".prisma/client"; diff --git a/packages/ui/components/form/selectimproved/components/Select.tsx b/packages/ui/components/form/selectimproved/components/Select.tsx index 9364818457..7407e9e7e2 100755 --- a/packages/ui/components/form/selectimproved/components/Select.tsx +++ b/packages/ui/components/form/selectimproved/components/Select.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useRef, useState } from "react"; +import React, { useCallback, useRef, useState } from "react"; import { classNames as cn } from "@calcom/lib"; import { useKeyPress } from "@calcom/lib/hooks/useKeyPress"; diff --git a/yarn.lock b/yarn.lock index ac3b5c556d..4830775426 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13782,6 +13782,18 @@ eslint-plugin-turbo@0.0.3: resolved "https://registry.yarnpkg.com/eslint-plugin-turbo/-/eslint-plugin-turbo-0.0.3.tgz#9d86895732f95b0c236d6363177a52368fffdc71" integrity sha512-QjidATGxWtaB9QUrD3NocUySmsgWKZlBMFlw4kX2IIjRLAxMPwukk90h3ZTaNXyRHuaQsrEgh7hhlCZoxP0TTw== +eslint-plugin-unused-imports@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz#d8db8c4d0cfa0637a8b51ce3fd7d1b6bc3f08520" + integrity sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A== + dependencies: + eslint-rule-composer "^0.3.0" + +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"