Skip to content

extension: quick fix disable rule doesn't edit existing comment and creates duplicate disable comments instead #16060

@Miodec

Description

@Miodec

Version 1.30.0

If there are multiple linting errors on one line, using VSCodes Quick fix function, adds stacked disable comments instead of editing the existing comment, which means only the last disable comment is applied:

Expected result:

  // oxlint-disable-next-line no-unsafe-assignment no-unsafe-assignment strict-boolean-expressions
  window.dataLayer = window.dataLayer || [];

Actual result, when using the 'quick fix' option to disable the erroring rule:

  // oxlint-disable-next-line no-unsafe-assignment
  // oxlint-disable-next-line strict-boolean-expressions
  // oxlint-disable-next-line no-unsafe-assignment
  // oxlint-disable-next-line strict-boolean-expressions
  // oxlint-disable-next-line no-unsafe-assignment
  // ... and so on ...
  window.dataLayer = window.dataLayer || [];

Video:

Screen.Recording.2025-11-24.at.15.04.38.mov

Fix would be to either consider all stacked disable comments for the next valid line or edit the existing disable line if present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-editorArea - Editor and Language ServerA-linterArea - Linter

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions