From 2b0e28415b58c5ebcecd9a9d2681ece0524d89a2 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 7 Sep 2023 10:37:43 -0400 Subject: [PATCH] ref: Cleanup lint warnings This pollutes the console when running the linter, hopefully also speeds up CI a little bit. --- packages/nextjs/src/common/utils/wrapperUtils.ts | 1 + .../nextjs/src/common/wrapApiHandlerWithSentryVercelCrons.ts | 2 ++ packages/nextjs/src/config/loaders/wrappingLoader.ts | 3 +++ packages/nextjs/src/config/templates/pageWrapperTemplate.ts | 1 + packages/nextjs/src/index.types.ts | 1 + packages/nextjs/src/server/index.ts | 1 + packages/node/test/transports/http.test.ts | 2 +- packages/node/test/transports/https.test.ts | 2 +- packages/remix/src/utils/vendor/response.ts | 1 + 9 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/nextjs/src/common/utils/wrapperUtils.ts b/packages/nextjs/src/common/utils/wrapperUtils.ts index a6d51ceacebb..9ae2cde39f83 100644 --- a/packages/nextjs/src/common/utils/wrapperUtils.ts +++ b/packages/nextjs/src/common/utils/wrapperUtils.ts @@ -188,6 +188,7 @@ export function withTracedServerSideDataFetcher Pr * We only do the following until we move transaction creation into this function: When called, the wrapped function * will also update the name of the active transaction with a parameterized route provided via the `options` argument. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export async function callDataFetcherTraced Promise | any>( origFunction: F, origFunctionArgs: Parameters, diff --git a/packages/nextjs/src/common/wrapApiHandlerWithSentryVercelCrons.ts b/packages/nextjs/src/common/wrapApiHandlerWithSentryVercelCrons.ts index d324cc2de7c3..43672a1acf28 100644 --- a/packages/nextjs/src/common/wrapApiHandlerWithSentryVercelCrons.ts +++ b/packages/nextjs/src/common/wrapApiHandlerWithSentryVercelCrons.ts @@ -11,11 +11,13 @@ type EdgeRequest = { /** * Wraps a function with Sentry crons instrumentation by automaticaly sending check-ins for the given Vercel crons config. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function wrapApiHandlerWithSentryVercelCrons any>( handler: F, vercelCronsConfig: VercelCronsConfig, ): F { return new Proxy(handler, { + // eslint-disable-next-line @typescript-eslint/no-explicit-any apply: (originalFunction, thisArg, args: any[]) => { return runWithAsyncContext(() => { if (!args || !args[0]) { diff --git a/packages/nextjs/src/config/loaders/wrappingLoader.ts b/packages/nextjs/src/config/loaders/wrappingLoader.ts index fc3ced90f384..e6452f815184 100644 --- a/packages/nextjs/src/config/loaders/wrappingLoader.ts +++ b/packages/nextjs/src/config/loaders/wrappingLoader.ts @@ -72,6 +72,7 @@ function moduleExists(id: string): boolean { export default function wrappingLoader( this: LoaderThis, userCode: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any userModuleSourceMap: any, ): void { // We know one or the other will be defined, depending on the version of webpack being used @@ -276,7 +277,9 @@ export default function wrappingLoader( async function wrapUserCode( wrapperCode: string, userModuleCode: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any userModuleSourceMap: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): Promise<{ code: string; map?: any }> { const wrap = (withDefaultExport: boolean): Promise => rollup({ diff --git a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts index 2e1b0d7b6537..16cce1a6cc39 100644 --- a/packages/nextjs/src/config/templates/pageWrapperTemplate.ts +++ b/packages/nextjs/src/config/templates/pageWrapperTemplate.ts @@ -27,6 +27,7 @@ const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : unde const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined; const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined; +// eslint-disable-next-line @typescript-eslint/no-explicit-any const getInitialPropsWrappers: Record = { '/_app': Sentry.wrapAppGetInitialPropsWithSentry, '/_document': Sentry.wrapDocumentGetInitialPropsWithSentry, diff --git a/packages/nextjs/src/index.types.ts b/packages/nextjs/src/index.types.ts index 5fbcf683ec38..479760633b54 100644 --- a/packages/nextjs/src/index.types.ts +++ b/packages/nextjs/src/index.types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable import/export */ // We export everything from both the client part of the SDK and from the server part. Some of the exports collide, diff --git a/packages/nextjs/src/server/index.ts b/packages/nextjs/src/server/index.ts index 0e43291d019d..23f3bc61e4a3 100644 --- a/packages/nextjs/src/server/index.ts +++ b/packages/nextjs/src/server/index.ts @@ -36,6 +36,7 @@ export const ErrorBoundary = (props: React.PropsWithChildren): React.Re * A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch * SSR errors so they should simply be a passthrough. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function withErrorBoundary

>( WrappedComponent: React.ComponentType

, ): React.FC

{ diff --git a/packages/node/test/transports/http.test.ts b/packages/node/test/transports/http.test.ts index 22d091a8583d..219d0c3bde77 100644 --- a/packages/node/test/transports/http.test.ts +++ b/packages/node/test/transports/http.test.ts @@ -212,7 +212,7 @@ describe('makeNewHttpTransport()', () => { describe('proxy', () => { const proxyAgentSpy = jest .spyOn(httpProxyAgent, 'HttpsProxyAgent') - // @ts-expect-error + // @ts-expect-error using http agent as https proxy agent .mockImplementation(() => new http.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 })); it('can be configured through option', () => { diff --git a/packages/node/test/transports/https.test.ts b/packages/node/test/transports/https.test.ts index b4ae670b7542..485b582d8e92 100644 --- a/packages/node/test/transports/https.test.ts +++ b/packages/node/test/transports/https.test.ts @@ -183,7 +183,7 @@ describe('makeNewHttpsTransport()', () => { describe('proxy', () => { const proxyAgentSpy = jest .spyOn(httpProxyAgent, 'HttpsProxyAgent') - // @ts-expect-error + // @ts-expect-error using http agent as https proxy agent .mockImplementation(() => new http.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 })); it('can be configured through option', () => { diff --git a/packages/remix/src/utils/vendor/response.ts b/packages/remix/src/utils/vendor/response.ts index fed25dd0f534..fbcffedf0fdd 100644 --- a/packages/remix/src/utils/vendor/response.ts +++ b/packages/remix/src/utils/vendor/response.ts @@ -128,6 +128,7 @@ export function getRequestMatch(url: URL, matches: RouteMatch[]): R /** * https://github.com/remix-run/remix/blob/3e589152bc717d04e2054c31bea5a1056080d4b9/packages/remix-server-runtime/responses.ts#L75-L85 */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function isDeferredData(value: any): value is DeferredData { const deferred: DeferredData = value; return (