From f97d588c0787941be7632b343d5c05100b052ef5 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 4 Jan 2023 16:48:08 +0100 Subject: [PATCH 1/2] build: bump `@typescript-eslint` dependencies from 3.9.0 to 5.48.0 --- packages/eslint-config-sdk/package.json | 4 +- yarn.lock | 131 +++++++++++++++++++----- 2 files changed, 105 insertions(+), 30 deletions(-) diff --git a/packages/eslint-config-sdk/package.json b/packages/eslint-config-sdk/package.json index 4b117f149d0e..a03cc033bb9d 100644 --- a/packages/eslint-config-sdk/package.json +++ b/packages/eslint-config-sdk/package.json @@ -21,8 +21,8 @@ "dependencies": { "@sentry-internal/eslint-plugin-sdk": "7.29.0", "@sentry-internal/typescript": "7.29.0", - "@typescript-eslint/eslint-plugin": "^3.9.0", - "@typescript-eslint/parser": "^3.9.0", + "@typescript-eslint/eslint-plugin": "^5.48.0", + "@typescript-eslint/parser": "^5.48.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-deprecation": "^1.1.0", "eslint-plugin-import": "^2.22.0", diff --git a/yarn.lock b/yarn.lock index 94f6c6af9482..d1bfebbebeba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4055,11 +4055,6 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint-visitor-keys@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" - integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - "@types/eslint@*": version "8.2.1" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.2.1.tgz#13f3d69bac93c2ae008019c28783868d0a1d6605" @@ -4464,6 +4459,11 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + "@types/semver@^7.3.9": version "7.3.9" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" @@ -4592,19 +4592,22 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^3.9.0": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz#7e061338a1383f59edc204c605899f93dc2e2c8f" - integrity sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ== +"@typescript-eslint/eslint-plugin@^5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz#54f8368d080eb384a455f60c2ee044e948a8ce67" + integrity sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ== dependencies: - "@typescript-eslint/experimental-utils" "3.10.1" - debug "^4.1.1" - functional-red-black-tree "^1.0.1" - regexpp "^3.0.0" - semver "^7.3.2" - tsutils "^3.17.1" + "@typescript-eslint/scope-manager" "5.48.0" + "@typescript-eslint/type-utils" "5.48.0" + "@typescript-eslint/utils" "5.48.0" + debug "^4.3.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + regexpp "^3.2.0" + semver "^7.3.7" + tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@3.10.1", "@typescript-eslint/experimental-utils@^2.19.2 || ^3.0.0": +"@typescript-eslint/experimental-utils@^2.19.2 || ^3.0.0": version "3.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686" integrity sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw== @@ -4615,16 +4618,33 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^3.9.0": - version "3.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.1.tgz#1883858e83e8b442627e1ac6f408925211155467" - integrity sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw== +"@typescript-eslint/parser@^5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.48.0.tgz#02803355b23884a83e543755349809a50b7ed9ba" + integrity sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg== dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.10.1" - "@typescript-eslint/types" "3.10.1" - "@typescript-eslint/typescript-estree" "3.10.1" - eslint-visitor-keys "^1.1.0" + "@typescript-eslint/scope-manager" "5.48.0" + "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/typescript-estree" "5.48.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz#607731cb0957fbc52fd754fd79507d1b6659cecf" + integrity sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow== + dependencies: + "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/visitor-keys" "5.48.0" + +"@typescript-eslint/type-utils@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz#40496dccfdc2daa14a565f8be80ad1ae3882d6d6" + integrity sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g== + dependencies: + "@typescript-eslint/typescript-estree" "5.48.0" + "@typescript-eslint/utils" "5.48.0" + debug "^4.3.4" + tsutils "^3.21.0" "@typescript-eslint/types@3.10.1": version "3.10.1" @@ -4636,6 +4656,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.23.0.tgz#da1654c8a5332f4d1645b2d9a1c64193cae3aa3b" integrity sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw== +"@typescript-eslint/types@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.48.0.tgz#d725da8dfcff320aab2ac6f65c97b0df30058449" + integrity sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw== + "@typescript-eslint/typescript-estree@3.10.1": version "3.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853" @@ -4650,6 +4675,19 @@ semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz#a7f04bccb001003405bb5452d43953a382c2fac2" + integrity sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw== + dependencies: + "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/visitor-keys" "5.48.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/typescript-estree@^4.8.2": version "4.23.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz#0753b292097523852428a6f5a1aa8ccc1aae6cd9" @@ -4663,6 +4701,20 @@ semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/utils@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.48.0.tgz#eee926af2733f7156ad8d15e51791e42ce300273" + integrity sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.48.0" + "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/typescript-estree" "5.48.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + "@typescript-eslint/visitor-keys@3.10.1": version "3.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931" @@ -4678,6 +4730,14 @@ "@typescript-eslint/types" "4.23.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@5.48.0": + version "5.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz#4446d5e7f6cadde7140390c0e284c8702d944904" + integrity sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q== + dependencies: + "@typescript-eslint/types" "5.48.0" + eslint-visitor-keys "^3.3.0" + "@vue/compiler-core@3.2.45": version "3.2.45" resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz#d9311207d96f6ebd5f4660be129fb99f01ddb41b" @@ -9405,7 +9465,7 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -11189,6 +11249,11 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + eslint@7.32.0: version "7.32.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" @@ -12792,7 +12857,7 @@ globby@10.0.0: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.1, globby@^11.0.2, globby@^11.0.3: +globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -17356,6 +17421,11 @@ native-url@0.3.4: dependencies: querystring "^0.2.0" +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -20486,6 +20556,11 @@ regexpp@^3.0.0, regexpp@^3.1.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" @@ -23386,7 +23461,7 @@ tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3 resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tsutils@^3.0.0, tsutils@^3.17.1: +tsutils@^3.0.0, tsutils@^3.17.1, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== From 065929018b4be4ade292e43ad208d8d4c037dd3f Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 4 Jan 2023 17:15:17 +0100 Subject: [PATCH 2/2] build: Fix linting errors due to eslint update --- packages/browser/.eslintignore | 1 + packages/browser/src/helpers.ts | 2 +- packages/browser/src/sdk.ts | 1 - packages/browser/test/unit/sdk.test.ts | 5 +---- packages/core/src/hub.ts | 1 - packages/nextjs/src/config/wrappers/types.ts | 4 ++-- packages/node/src/handlers.ts | 3 +-- .../src/integrations/onuncaughtexception.ts | 4 +--- packages/node/src/transports/http.ts | 3 ++- packages/node/src/types.ts | 4 ++-- packages/react/src/redux.ts | 1 - packages/replay/src/eventBuffer.ts | 20 +++++++++---------- packages/replay/src/integration.ts | 16 +++++++-------- packages/replay/src/util/debounce.ts | 2 +- .../tracing/src/browser/browsertracing.ts | 5 ++--- packages/tracing/src/browser/request.ts | 2 +- packages/types/src/envelope.ts | 2 +- packages/types/src/eventprocessor.ts | 2 +- packages/utils/src/object.ts | 4 +--- 19 files changed, 36 insertions(+), 46 deletions(-) create mode 100644 packages/browser/.eslintignore diff --git a/packages/browser/.eslintignore b/packages/browser/.eslintignore new file mode 100644 index 000000000000..81c6b54e0be2 --- /dev/null +++ b/packages/browser/.eslintignore @@ -0,0 +1 @@ +tmp.js diff --git a/packages/browser/src/helpers.ts b/packages/browser/src/helpers.ts index 68a1d25f00ce..7b56e30fa829 100644 --- a/packages/browser/src/helpers.ts +++ b/packages/browser/src/helpers.ts @@ -179,5 +179,5 @@ export interface ReportDialogOptions { errorFormEntry?: string; successMessage?: string; /** Callback after reportDialog showed up */ - onLoad?(): void; + onLoad?(this: void): void; } diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index f4c05482b4a9..9b10074f8b51 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -164,7 +164,6 @@ export function showReportDialog(options: ReportDialogOptions = {}, hub: Hub = g script.src = getReportDialogEndpoint(dsn, options); if (options.onLoad) { - // eslint-disable-next-line @typescript-eslint/unbound-method script.onload = options.onLoad; } diff --git a/packages/browser/test/unit/sdk.test.ts b/packages/browser/test/unit/sdk.test.ts index 5d03d26d3312..facf8f9f4aae 100644 --- a/packages/browser/test/unit/sdk.test.ts +++ b/packages/browser/test/unit/sdk.test.ts @@ -1,14 +1,11 @@ /* eslint-disable @typescript-eslint/unbound-method */ -import { Scope } from '@sentry/core'; -import { createTransport } from '@sentry/core'; +import { createTransport, Scope } from '@sentry/core'; import { MockIntegration } from '@sentry/core/test/lib/sdk.test'; import { Client, Integration } from '@sentry/types'; import { resolvedSyncPromise } from '@sentry/utils'; import { BrowserOptions } from '../../src'; import { init } from '../../src/sdk'; -// eslint-disable-next-line no-var -declare var global: any; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/core/src/hub.ts b/packages/core/src/hub.ts index e5f161559d39..aa3a8015c0a0 100644 --- a/packages/core/src/hub.ts +++ b/packages/core/src/hub.ts @@ -258,7 +258,6 @@ export class Hub implements HubInterface { if (!scope || !client) return; - // eslint-disable-next-line @typescript-eslint/unbound-method const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = (client.getOptions && client.getOptions()) || {}; diff --git a/packages/nextjs/src/config/wrappers/types.ts b/packages/nextjs/src/config/wrappers/types.ts index 16197e4cedc7..7ad042cc2474 100644 --- a/packages/nextjs/src/config/wrappers/types.ts +++ b/packages/nextjs/src/config/wrappers/types.ts @@ -23,14 +23,14 @@ import type { NextApiRequest, NextApiResponse } from 'next'; // wrapped route from being wrapped again by the auto-wrapper. export type NextApiHandler = { - __sentry_route__?: string; (req: NextApiRequest, res: NextApiResponse): void | Promise | unknown | Promise; + __sentry_route__?: string; }; export type WrappedNextApiHandler = { + (req: NextApiRequest, res: NextApiResponse): Promise | Promise; __sentry_route__?: string; __sentry_wrapped__?: boolean; - (req: NextApiRequest, res: NextApiResponse): Promise | Promise; }; export type AugmentedNextApiRequest = NextApiRequest & { diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index 7433ad8720dd..a5e5ff3b6f11 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -256,7 +256,7 @@ export function errorHandler(options?: { * Callback method deciding whether error should be captured and sent to Sentry * @param error Captured middleware error */ - shouldHandleError?(error: MiddlewareError): boolean; + shouldHandleError?(this: void, error: MiddlewareError): boolean; }): ( error: MiddlewareError, req: http.IncomingMessage, @@ -269,7 +269,6 @@ export function errorHandler(options?: { res: http.ServerResponse, next: (error: MiddlewareError) => void, ): void { - // eslint-disable-next-line @typescript-eslint/unbound-method const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError; if (shouldHandleError(error)) { diff --git a/packages/node/src/integrations/onuncaughtexception.ts b/packages/node/src/integrations/onuncaughtexception.ts index 2108e2829f63..e97796a3a33c 100644 --- a/packages/node/src/integrations/onuncaughtexception.ts +++ b/packages/node/src/integrations/onuncaughtexception.ts @@ -29,7 +29,7 @@ interface OnUncaughtExceptionOptions { * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError` * was running. */ - onFatalError?(firstError: Error, secondError?: Error): void; + onFatalError?(this: void, firstError: Error, secondError?: Error): void; } /** Global Exception handler */ @@ -84,10 +84,8 @@ export class OnUncaughtException implements Integration { const client = getCurrentHub().getClient(); if (this._options.onFatalError) { - // eslint-disable-next-line @typescript-eslint/unbound-method onFatalError = this._options.onFatalError; } else if (client && client.getOptions().onFatalError) { - // eslint-disable-next-line @typescript-eslint/unbound-method onFatalError = client.getOptions().onFatalError as OnFatalErrorHandler; } diff --git a/packages/node/src/transports/http.ts b/packages/node/src/transports/http.ts index 687325b776f4..49a6a5821011 100644 --- a/packages/node/src/transports/http.ts +++ b/packages/node/src/transports/http.ts @@ -63,7 +63,8 @@ export function makeNodeTransport(options: NodeTransportOptions): Transport { // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node // versions(>= 8) as they had memory leaks when using it: #2555 const agent = proxy - ? (new (require('https-proxy-agent'))(proxy) as http.Agent) + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + (new (require('https-proxy-agent'))(proxy) as http.Agent) : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 }); const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent); diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index d4ca5dd4900d..7b71d7bab988 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -45,10 +45,10 @@ export interface BaseNodeOptions { * }); * ``` */ - shouldCreateSpanForRequest?(url: string): boolean; + shouldCreateSpanForRequest?(this: void, url: string): boolean; /** Callback that is executed when a fatal global error occurs. */ - onFatalError?(error: Error): void; + onFatalError?(this: void, error: Error): void; } /** diff --git a/packages/react/src/redux.ts b/packages/react/src/redux.ts index d0751b4f43c3..35f5348c5e08 100644 --- a/packages/react/src/redux.ts +++ b/packages/react/src/redux.ts @@ -111,7 +111,6 @@ function createReduxEnhancer(enhancerOptions?: Partial): } /* Allow user to configure scope with latest state */ - // eslint-disable-next-line @typescript-eslint/unbound-method const { configureScopeWithState } = options; if (typeof configureScopeWithState === 'function') { configureScopeWithState(scope, newState); diff --git a/packages/replay/src/eventBuffer.ts b/packages/replay/src/eventBuffer.ts index 1d670506de67..f5fbfb2497ff 100644 --- a/packages/replay/src/eventBuffer.ts +++ b/packages/replay/src/eventBuffer.ts @@ -43,14 +43,14 @@ class EventBufferArray implements EventBuffer { this._events = []; } - public destroy(): void { - this._events = []; - } - public get length(): number { return this._events.length; } + public destroy(): void { + this._events = []; + } + public addEvent(event: RecordingEvent, isCheckout?: boolean): void { if (isCheckout) { this._events = [event]; @@ -82,12 +82,6 @@ export class EventBufferCompressionWorker implements EventBuffer { this._worker = worker; } - public destroy(): void { - __DEBUG_BUILD__ && logger.log('[Replay] Destroying compression worker'); - this._worker?.terminate(); - this._worker = null; - } - /** * Note that this may not reflect what is actually in the event buffer. This * is only a local count of the buffer size since `addEvent` is async. @@ -96,6 +90,12 @@ export class EventBufferCompressionWorker implements EventBuffer { return this._eventBufferItemLength; } + public destroy(): void { + __DEBUG_BUILD__ && logger.log('[Replay] Destroying compression worker'); + this._worker?.terminate(); + this._worker = null; + } + public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise { if (isCheckout) { // This event is a checkout, make sure worker buffer is cleared before diff --git a/packages/replay/src/integration.ts b/packages/replay/src/integration.ts index 34862682b325..d5fe1275f7bd 100644 --- a/packages/replay/src/integration.ts +++ b/packages/replay/src/integration.ts @@ -36,14 +36,6 @@ export class Replay implements Integration { readonly options: ReplayPluginOptions; - protected get _isInitialized(): boolean { - return _initialized; - } - - protected set _isInitialized(value: boolean) { - _initialized = value; - } - private _replay?: ReplayContainer; constructor({ @@ -134,6 +126,14 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`, this._isInitialized = true; } + protected get _isInitialized(): boolean { + return _initialized; + } + + protected set _isInitialized(value: boolean) { + _initialized = value; + } + /** * We previously used to create a transaction in `setupOnce` and it would * potentially create a transaction before some native SDK integrations have run diff --git a/packages/replay/src/util/debounce.ts b/packages/replay/src/util/debounce.ts index fafd541fa98b..88057c14a4c5 100644 --- a/packages/replay/src/util/debounce.ts +++ b/packages/replay/src/util/debounce.ts @@ -1,7 +1,7 @@ type DebouncedCallback = { + (): void | unknown; flush: () => void | unknown; cancel: () => void; - (): void | unknown; }; type CallbackFunction = () => unknown; type DebounceOptions = { maxWait?: number }; diff --git a/packages/tracing/src/browser/browsertracing.ts b/packages/tracing/src/browser/browsertracing.ts index 1207ab8be9de..c9ca077fb179 100644 --- a/packages/tracing/src/browser/browsertracing.ts +++ b/packages/tracing/src/browser/browsertracing.ts @@ -109,13 +109,14 @@ export interface BrowserTracingOptions extends RequestInstrumentationOptions { * * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped. */ - beforeNavigate?(context: TransactionContext): TransactionContext | undefined; + beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined; /** * Instrumentation that creates routing change transactions. By default creates * pageload and navigation transactions. */ routingInstrumentation( + this: void, customStartTransaction: (context: TransactionContext) => T | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean, @@ -187,7 +188,6 @@ export class BrowserTracing implements Integration { public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void { this._getCurrentHub = getCurrentHub; - // eslint-disable-next-line @typescript-eslint/unbound-method const { routingInstrumentation: instrumentRouting, startTransactionOnLocationChange, @@ -230,7 +230,6 @@ export class BrowserTracing implements Integration { return undefined; } - // eslint-disable-next-line @typescript-eslint/unbound-method const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options; const isPageloadTransaction = context.op === 'pageload'; diff --git a/packages/tracing/src/browser/request.ts b/packages/tracing/src/browser/request.ts index dbd041619699..ca6c15b0e96d 100644 --- a/packages/tracing/src/browser/request.ts +++ b/packages/tracing/src/browser/request.ts @@ -49,7 +49,7 @@ export interface RequestInstrumentationOptions { * * Default: (url: string) => true */ - shouldCreateSpanForRequest?(url: string): boolean; + shouldCreateSpanForRequest?(this: void, url: string): boolean; } /** Data returned from fetch callback */ diff --git a/packages/types/src/envelope.ts b/packages/types/src/envelope.ts index 74cb2764b7e3..75c18498d5f1 100644 --- a/packages/types/src/envelope.ts +++ b/packages/types/src/envelope.ts @@ -44,7 +44,7 @@ export type BaseEnvelopeItemHeaders = { length?: number; }; -type BaseEnvelopeItem = [ItemHeader & BaseEnvelopeItemHeaders, P]; // P is for payload +type BaseEnvelopeItem = [ItemHeader & BaseEnvelopeItemHeaders, P]; // P is for payload type BaseEnvelope = [ EnvelopeHeader & BaseEnvelopeHeaders, diff --git a/packages/types/src/eventprocessor.ts b/packages/types/src/eventprocessor.ts index 5be90a755367..543c0163ea5f 100644 --- a/packages/types/src/eventprocessor.ts +++ b/packages/types/src/eventprocessor.ts @@ -7,6 +7,6 @@ import { Event, EventHint } from './event'; * Event processing will be deferred until your Promise is resolved. */ export interface EventProcessor { - id?: string; // This field can't be named "name" because functions already have this field natively (event: Event, hint: EventHint): PromiseLike | Event | null; + id?: string; // This field can't be named "name" because functions already have this field natively } diff --git a/packages/utils/src/object.ts b/packages/utils/src/object.ts index 5b789b29060d..1e02d1fd163e 100644 --- a/packages/utils/src/object.ts +++ b/packages/utils/src/object.ts @@ -99,9 +99,7 @@ export function urlEncode(object: { [key: string]: any }): string { * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor * an Error. */ -export function convertToPlainObject( - value: V, -): +export function convertToPlainObject(value: V): | { [ownProps: string]: unknown; type: string;