Skip to content

fix(lint): avoid URLPattern global redeclare#2627

Draft
cursor[bot] wants to merge 2 commits intomainfrom
jkt/auto/dependency-update-review-bd65
Draft

fix(lint): avoid URLPattern global redeclare#2627
cursor[bot] wants to merge 2 commits intomainfrom
jkt/auto/dependency-update-review-bd65

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Apr 13, 2026

Asana Task/Github Issue: N/A

Description

This PR contains a follow-up fix discovered while reviewing the typescript-eslint dependency bump PR (#2621).

typescript-eslint@8.58.1 causes lint to fail in CI for injected/src/config-feature.js with:

  • no-redeclare: 'URLPattern' is already defined as a built-in global variable

Changes:

  • Alias urlpattern-polyfill import to URLPatternPolyfill
  • Introduce URLPatternCtor = globalThis.URLPattern ?? URLPatternPolyfill
  • Replace new URLPattern(...) usages with new URLPatternCtor(...)

This preserves runtime behavior while eliminating the lint regression.

Testing Steps

  • npx eslint injected/src/config-feature.js

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged
Open in Web View Automation 

dependabot bot and others added 2 commits April 13, 2026 11:35
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>
@github-actions github-actions bot added the semver-patch Bug fix / internal — no release needed label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

[Beta] Generated file diff

Time updated: Mon, 13 Apr 2026 11:51:34 GMT

Android
    - android/adsjsContentScope.js
  • android/autofillImport.js
  • android/brokerProtection.js
  • android/contentScope.js
  • android/duckAiChatHistory.js
  • android/duckAiDataClearing.js

File has changed

Apple
    - apple/contentScope.js
  • apple/contentScopeIsolated.js
  • apple/duckAiChatHistory.js
  • apple/duckAiDataClearing.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

import { URLPattern } from 'urlpattern-polyfill';
import { URLPattern as URLPatternPolyfill } from 'urlpattern-polyfill';

const URLPatternCtor = globalThis.URLPattern ?? URLPatternPolyfill;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property 'URLPattern' does not exist on type 'typeof globalThis'.

@cursoragent can you investigate and fix.

Also question and review the whole patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug fix / internal — no release needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants