Skip to content

Remove upstream eslint patch #45914

Closed
Closed

Description

@ckerr

Confirmation

Description

415fe95

patches/chromium/fix_linter_error.patch adds an eslint comment to disable this error:

/__w/electron/electron/src/out/Default/gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts
77:23 error This assertion is unnecessary since the receiver accepts the original type of the expression @typescript-eslint/no-unnecessary-type-assertion

✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the --fix option.

My first thought was to remove the assertion and try to upstream the patch. However, removing it causes typescript to fail:

gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts:77:23 - error TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'HTMLElement'.
Type 'null' is not assignable to type 'HTMLElement'.

77 items.indexOf(this.querySelector(':focus'));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm not sure what the issue is, but these two results seem to be in opposition to each other. Maybe they're running with different type declarations for Array.indexOf() ?

We should track down the source of this incongruity, fix it, and remove fix_linter_error.patch.

Activity

  1. added
    upgrade-follow-up
    on Mar 7, 2025
  2. self-assigned this
    on Mar 7, 2025
  3. electron-issue-triage commented on Jun 6, 2025

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  4. codebytere commented on Nov 26, 2025

    @codebytere
    Member

    Closed as this has been removed.

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

Metadata

Metadata

Assignees

Labels

upgrade-follow-up

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions