From c578a0cb74bdc6492bed58007f8b7971eef43e30 Mon Sep 17 00:00:00 2001 From: Brad Dunbar Date: Tue, 7 Oct 2025 10:42:15 -0400 Subject: [PATCH] Resolve typescript eslint warning (#36314) --- app/javascript/mastodon/polyfills/index.ts | 2 +- app/javascript/mastodon/reducers/modal.ts | 2 +- package.json | 2 +- yarn.lock | 156 ++++++++++++++++++++- 4 files changed, 157 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/polyfills/index.ts b/app/javascript/mastodon/polyfills/index.ts index 0ff0dd726..1abfe0a93 100644 --- a/app/javascript/mastodon/polyfills/index.ts +++ b/app/javascript/mastodon/polyfills/index.ts @@ -19,7 +19,7 @@ export function loadPolyfills() { return Promise.all([ loadIntlPolyfills(), // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- those properties might not exist in old browsers, even if they are always here in types - needsExtraPolyfills && importExtraPolyfills(), + needsExtraPolyfills ? importExtraPolyfills() : Promise.resolve(), loadEmojiPolyfills(), ]); } diff --git a/app/javascript/mastodon/reducers/modal.ts b/app/javascript/mastodon/reducers/modal.ts index e287626ff..dfdff7cf0 100644 --- a/app/javascript/mastodon/reducers/modal.ts +++ b/app/javascript/mastodon/reducers/modal.ts @@ -41,7 +41,7 @@ const popModal = ( modalType === state.get('stack').get(0)?.get('modalType') ) { return state - .set('ignoreFocus', !!ignoreFocus) + .set('ignoreFocus', ignoreFocus) .update('stack', (stack) => stack.shift()); } else { return state; diff --git a/package.json b/package.json index 0fd14de65..4596fc421 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,7 @@ "stylelint-config-prettier-scss": "^1.0.0", "stylelint-config-standard-scss": "^15.0.1", "typescript": "~5.9.0", - "typescript-eslint": "^8.29.1", + "typescript-eslint": "^8.45.0", "vitest": "^3.2.4" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index 5a773c8f3..5faccd97b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2860,7 +2860,7 @@ __metadata: tiny-queue: "npm:^0.2.1" twitter-text: "npm:3.1.0" typescript: "npm:~5.9.0" - typescript-eslint: "npm:^8.29.1" + typescript-eslint: "npm:^8.45.0" use-debounce: "npm:^10.0.0" vite: "npm:^7.1.1" vite-plugin-manifest-sri: "npm:^0.2.0" @@ -4524,6 +4524,27 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/eslint-plugin@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.45.0" + dependencies: + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:8.45.0" + "@typescript-eslint/type-utils": "npm:8.45.0" + "@typescript-eslint/utils": "npm:8.45.0" + "@typescript-eslint/visitor-keys": "npm:8.45.0" + graphemer: "npm:^1.4.0" + ignore: "npm:^7.0.0" + natural-compare: "npm:^1.4.0" + ts-api-utils: "npm:^2.1.0" + peerDependencies: + "@typescript-eslint/parser": ^8.45.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/0c60a0e5d07fa8618348db38b5a81e66143d528e1b3cdb5678bbc6c60590cd559b27c98c36f5663230fc4cf6920dff2cd604de30b58df26a37fcfcc5dc1dbd45 + languageName: node + linkType: hard + "@typescript-eslint/parser@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/parser@npm:8.38.0" @@ -4540,6 +4561,22 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/parser@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/parser@npm:8.45.0" + dependencies: + "@typescript-eslint/scope-manager": "npm:8.45.0" + "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/typescript-estree": "npm:8.45.0" + "@typescript-eslint/visitor-keys": "npm:8.45.0" + debug: "npm:^4.3.4" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/8b419bcf795b112a39fcac05dcf147835059345b6399035ffa3f76a9d8e320f3fac79cae2fe4320dcda83fa059b017ca7626a7b4e3da08a614415c8867d169b8 + languageName: node + linkType: hard + "@typescript-eslint/project-service@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/project-service@npm:8.38.0" @@ -4553,6 +4590,19 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/project-service@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/project-service@npm:8.45.0" + dependencies: + "@typescript-eslint/tsconfig-utils": "npm:^8.45.0" + "@typescript-eslint/types": "npm:^8.45.0" + debug: "npm:^4.3.4" + peerDependencies: + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/98af065a1a3ed9d3d1eb265e09d3e9c2ae676d500a8c1d764f5609fe2c1b86749516b709804eb814fae688be7809d11748b9ae691d43c28da51dac390ca81fa9 + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/scope-manager@npm:8.38.0" @@ -4563,6 +4613,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/scope-manager@npm:8.45.0" + dependencies: + "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/visitor-keys": "npm:8.45.0" + checksum: 10c0/54cd36206f6b4fc8e1e48576ed01e0d6ab20c2a9c4c7d90d5cc3a2d317dd8a13abe148ffecf471b16f1224aba5749e0905472745626bef9ae5bed771776f4abe + languageName: node + linkType: hard + "@typescript-eslint/tsconfig-utils@npm:8.38.0, @typescript-eslint/tsconfig-utils@npm:^8.38.0": version: 8.38.0 resolution: "@typescript-eslint/tsconfig-utils@npm:8.38.0" @@ -4572,6 +4632,15 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/tsconfig-utils@npm:8.45.0, @typescript-eslint/tsconfig-utils@npm:^8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/tsconfig-utils@npm:8.45.0" + peerDependencies: + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/227a9b7a5baaf35466fd369992cb933192515df1156ddf22f438deb344c2523695208e1036f5590b20603f31724de75a47fe0ee84e2fd4c8e9f3606f23f68112 + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/type-utils@npm:8.38.0" @@ -4588,6 +4657,22 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/type-utils@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/type-utils@npm:8.45.0" + dependencies: + "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/typescript-estree": "npm:8.45.0" + "@typescript-eslint/utils": "npm:8.45.0" + debug: "npm:^4.3.4" + ts-api-utils: "npm:^2.1.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/ce0f4c209c2418ebeb65e7de053499fb68bf6000bdd71068594fdb8c8ac3dbbd62935a3cea233989491f7da3ef5db87e7efd2910133c6abf6d0cbf57248f6442 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:8.38.0, @typescript-eslint/types@npm:^8.34.1, @typescript-eslint/types@npm:^8.38.0": version: 8.38.0 resolution: "@typescript-eslint/types@npm:8.38.0" @@ -4595,6 +4680,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.45.0, @typescript-eslint/types@npm:^8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/types@npm:8.45.0" + checksum: 10c0/0213a0573c671d13bc91961a2b2e814ec7f6381ff093bce6704017bd96b2fc7fee25906c815cedb32a0601cf5071ca6c7c5f940d087c3b0d3dd7d4bc03478278 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/typescript-estree@npm:8.38.0" @@ -4615,6 +4707,26 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.45.0" + dependencies: + "@typescript-eslint/project-service": "npm:8.45.0" + "@typescript-eslint/tsconfig-utils": "npm:8.45.0" + "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/visitor-keys": "npm:8.45.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^2.1.0" + peerDependencies: + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/8c2f44a00fe859a6cd4b50157c484c5b6a1c7af5d48e89ae79c5f4924947964962fc8f478ad4c2ade788907fceee9b72d4e376508ea79b51392f91082a37d239 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:8.38.0, @typescript-eslint/utils@npm:^8.27.0, @typescript-eslint/utils@npm:^8.8.1": version: 8.38.0 resolution: "@typescript-eslint/utils@npm:8.38.0" @@ -4630,6 +4742,21 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/utils@npm:8.45.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.7.0" + "@typescript-eslint/scope-manager": "npm:8.45.0" + "@typescript-eslint/types": "npm:8.45.0" + "@typescript-eslint/typescript-estree": "npm:8.45.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/b3c83a23813b15e20e303d7153789508c01e06dec355b1a80547c59aa36998d498102f45fcd13f111031fac57270608abb04d20560248d4448fd00b1cf4dc4ab + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:8.38.0": version: 8.38.0 resolution: "@typescript-eslint/visitor-keys@npm:8.38.0" @@ -4640,6 +4767,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.45.0": + version: 8.45.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.45.0" + dependencies: + "@typescript-eslint/types": "npm:8.45.0" + eslint-visitor-keys: "npm:^4.2.1" + checksum: 10c0/119adcf50c902dad7f7757bcdd88fad0a23a171d309d9b7cefe78af12e451cf84c04ae611f4c31f7e23f16c2b47665ad92e6e5648fc77d542ef306f465bf1f29 + languageName: node + linkType: hard + "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1": version: 1.11.1 resolution: "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1" @@ -13420,7 +13557,7 @@ __metadata: languageName: node linkType: hard -"typescript-eslint@npm:^8.28.0, typescript-eslint@npm:^8.29.1": +"typescript-eslint@npm:^8.28.0": version: 8.38.0 resolution: "typescript-eslint@npm:8.38.0" dependencies: @@ -13435,6 +13572,21 @@ __metadata: languageName: node linkType: hard +"typescript-eslint@npm:^8.45.0": + version: 8.45.0 + resolution: "typescript-eslint@npm:8.45.0" + dependencies: + "@typescript-eslint/eslint-plugin": "npm:8.45.0" + "@typescript-eslint/parser": "npm:8.45.0" + "@typescript-eslint/typescript-estree": "npm:8.45.0" + "@typescript-eslint/utils": "npm:8.45.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <6.0.0" + checksum: 10c0/2342b0bffe6f719711adbb42116f90cb1fe1670e2e74dde2739482c9d61c2a975ee16e2d560684613050544b543342ec1b11b46e158a48ecc605f5882d2d5da7 + languageName: node + linkType: hard + "typescript@npm:^5.6.0, typescript@npm:~5.9.0": version: 5.9.2 resolution: "typescript@npm:5.9.2"