Skip to content

Bug: eslint-disable is automatically removed #11031

Closed as not planned
Closed as not planned
@nvmnghia

Description

@nvmnghia

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

I have to integrate some new API that are not yet typed. Somehow when I use disable, whether whole file or next line, the disable comments are removed completely.

No edit is made to eslint & ts config.

After some reading, I think codeActionsOnSave could be related. Here's my setup:

    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": "explicit",
        "source.organizeImports": "explicit"
    },
    "eslint.codeActionsOnSave.rules": [
        "import"
    ],

Reproduction Repository Link

https://github.com/nvmnghia/test-tslint

Repro Steps

  1. clone the repo
  2. yarn install
  3. Go to getDataPoolBC()
  4. Add disable comment for the return in map(), or any line
  5. The comment disappear on save

My VS Code is configured with format on save, but I don't think formatting is the problem.

Versions

package version
@typescript-eslint/eslint-plugin 8.29.0
@typescript-eslint/parser 8.29.0
@typescript-eslint/scope-manager 8.29.0
@typescript-eslint/typescript-estree 8.29.0
@typescript-eslint/type-utils 8.29.0
@typescript-eslint/utils 8.29.0
TypeScript 5.8.2
ESLint 9.23.0
node 22.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.triageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions