diff --git a/package.json b/package.json index 33010e45cf14..9e02a3f547df 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "mocha": "^6.1.4", "nodemon": "^2.0.16", "npm-run-all": "^4.1.5", - "prettier": "2.7.1", + "prettier": "2.8.7", "recast": "^0.20.5", "replace-in-file": "^4.0.0", "rimraf": "^3.0.2", diff --git a/packages/core/src/tracing/idletransaction.ts b/packages/core/src/tracing/idletransaction.ts index afb81fd2dbf8..2a25fa9b45bf 100644 --- a/packages/core/src/tracing/idletransaction.ts +++ b/packages/core/src/tracing/idletransaction.ts @@ -90,7 +90,7 @@ export class IdleTransaction extends Transaction { */ private _idleTimeoutID: ReturnType | undefined; - private _finishReason: typeof IDLE_TRANSACTION_FINISH_REASONS[number] = IDLE_TRANSACTION_FINISH_REASONS[4]; + private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number] = IDLE_TRANSACTION_FINISH_REASONS[4]; public constructor( transactionContext: TransactionContext, diff --git a/packages/nextjs/src/client/wrapAppGetInitialPropsWithSentry.ts b/packages/nextjs/src/client/wrapAppGetInitialPropsWithSentry.ts index 41a24d57c5c2..8c757be6a3c8 100644 --- a/packages/nextjs/src/client/wrapAppGetInitialPropsWithSentry.ts +++ b/packages/nextjs/src/client/wrapAppGetInitialPropsWithSentry.ts @@ -1,6 +1,6 @@ import type App from 'next/app'; -type AppGetInitialProps = typeof App['getInitialProps']; +type AppGetInitialProps = (typeof App)['getInitialProps']; /** * A passthrough function in case this function is used on the clientside. We need to make the returned function async diff --git a/packages/nextjs/src/server/wrapAppGetInitialPropsWithSentry.ts b/packages/nextjs/src/server/wrapAppGetInitialPropsWithSentry.ts index 4499b6bacee2..178e7617866c 100644 --- a/packages/nextjs/src/server/wrapAppGetInitialPropsWithSentry.ts +++ b/packages/nextjs/src/server/wrapAppGetInitialPropsWithSentry.ts @@ -10,7 +10,7 @@ import { withTracedServerSideDataFetcher, } from './utils/wrapperUtils'; -type AppGetInitialProps = typeof App['getInitialProps']; +type AppGetInitialProps = (typeof App)['getInitialProps']; /** * Create a wrapped version of the user's exported `getInitialProps` function in diff --git a/packages/node/src/requestdata.ts b/packages/node/src/requestdata.ts index d13aa78700f2..a0d5aed926a9 100644 --- a/packages/node/src/requestdata.ts +++ b/packages/node/src/requestdata.ts @@ -25,9 +25,9 @@ export type AddRequestDataToEventOptions = { /** Flags controlling whether each type of data should be added to the event */ include?: { ip?: boolean; - request?: boolean | Array; + request?: boolean | Array<(typeof DEFAULT_REQUEST_INCLUDES)[number]>; transaction?: boolean | TransactionNamingScheme; - user?: boolean | Array; + user?: boolean | Array<(typeof DEFAULT_USER_INCLUDES)[number]>; }; }; diff --git a/packages/tracing-internal/src/node/integrations/mongo.ts b/packages/tracing-internal/src/node/integrations/mongo.ts index 5364f234df8d..dd5474dd4d51 100644 --- a/packages/tracing-internal/src/node/integrations/mongo.ts +++ b/packages/tracing-internal/src/node/integrations/mongo.ts @@ -8,7 +8,7 @@ import { shouldDisableAutoInstrumentation } from './utils/node-utils'; // This allows us to use the same array for both defaults options and the type itself. // (note `as const` at the end to make it a union of string literal types (i.e. "a" | "b" | ... ) // and not just a string[]) -type Operation = typeof OPERATIONS[number]; +type Operation = (typeof OPERATIONS)[number]; const OPERATIONS = [ 'aggregate', // aggregate(pipeline, options, callback) 'bulkWrite', // bulkWrite(operations, options, callback) diff --git a/packages/utils/src/instrument.ts b/packages/utils/src/instrument.ts index d8779afee1b5..f6927b34be46 100644 --- a/packages/utils/src/instrument.ts +++ b/packages/utils/src/instrument.ts @@ -624,7 +624,7 @@ function instrumentDOM(): void { }); } -let _oldOnErrorHandler: typeof WINDOW['onerror'] | null = null; +let _oldOnErrorHandler: (typeof WINDOW)['onerror'] | null = null; /** JSDoc */ function instrumentError(): void { _oldOnErrorHandler = WINDOW.onerror; @@ -649,7 +649,7 @@ function instrumentError(): void { WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true; } -let _oldOnUnhandledRejectionHandler: typeof WINDOW['onunhandledrejection'] | null = null; +let _oldOnUnhandledRejectionHandler: (typeof WINDOW)['onunhandledrejection'] | null = null; /** JSDoc */ function instrumentUnhandledRejection(): void { _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection; diff --git a/packages/utils/src/logger.ts b/packages/utils/src/logger.ts index b3cc6ddacdea..e773ae28f0b5 100644 --- a/packages/utils/src/logger.ts +++ b/packages/utils/src/logger.ts @@ -6,10 +6,10 @@ import { getGlobalSingleton, GLOBAL_OBJ } from './worldwide'; const PREFIX = 'Sentry Logger '; export const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] as const; -export type ConsoleLevel = typeof CONSOLE_LEVELS[number]; +export type ConsoleLevel = (typeof CONSOLE_LEVELS)[number]; type LoggerMethod = (...args: unknown[]) => void; -type LoggerConsoleMethods = Record; +type LoggerConsoleMethods = Record<(typeof CONSOLE_LEVELS)[number], LoggerMethod>; /** JSDoc */ interface Logger extends LoggerConsoleMethods { @@ -47,7 +47,7 @@ export function consoleSandbox(callback: () => T): T { } finally { // Revert restoration to wrapped state Object.keys(wrappedLevels).forEach(level => { - originalConsole[level] = wrappedLevels[level as typeof CONSOLE_LEVELS[number]]; + originalConsole[level] = wrappedLevels[level as (typeof CONSOLE_LEVELS)[number]]; }); } } diff --git a/yarn.lock b/yarn.lock index afcf0c584dbb..b0f473085a6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22093,7 +22093,12 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@2.7.1, prettier@^2.5.1: +prettier@2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== + +prettier@^2.5.1: version "2.7.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==