fix(lint): avoid URLPattern global redeclare#2627
Draft
cursor[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.57.2 to 8.58.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.58.1/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-version: 8.58.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
Contributor
[Beta] Generated file diffTime updated: Mon, 13 Apr 2026 11:51:34 GMT Android
File has changed Apple
File has changed Chrome-mv3File has changed FirefoxFile has changed IntegrationFile has changed WindowsFile has changed |
| import { URLPattern } from 'urlpattern-polyfill'; | ||
| import { URLPattern as URLPatternPolyfill } from 'urlpattern-polyfill'; | ||
|
|
||
| const URLPatternCtor = globalThis.URLPattern ?? URLPatternPolyfill; |
Contributor
There was a problem hiding this comment.
Property 'URLPattern' does not exist on type 'typeof globalThis'.
@cursoragent can you investigate and fix.
Also question and review the whole patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asana Task/Github Issue: N/A
Description
This PR contains a follow-up fix discovered while reviewing the
typescript-eslintdependency bump PR (#2621).typescript-eslint@8.58.1causes lint to fail in CI forinjected/src/config-feature.jswith:no-redeclare:'URLPattern' is already defined as a built-in global variableChanges:
urlpattern-polyfillimport toURLPatternPolyfillURLPatternCtor = globalThis.URLPattern ?? URLPatternPolyfillnew URLPattern(...)usages withnew URLPatternCtor(...)This preserves runtime behavior while eliminating the lint regression.
Testing Steps
npx eslint injected/src/config-feature.jsChecklist
Please tick all that apply: