Skip to content

Bug: eslint-disable is automatically removed #11031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
nvmnghia opened this issue Apr 4, 2025 · 1 comment
Closed
4 tasks done

Bug: eslint-disable is automatically removed #11031

nvmnghia opened this issue Apr 4, 2025 · 1 comment
Labels
bug Something isn't working locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. triage Waiting for team members to take a look

Comments

@nvmnghia
Copy link

nvmnghia commented Apr 4, 2025

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
@nvmnghia nvmnghia added bug Something isn't working triage Waiting for team members to take a look labels Apr 4, 2025
@nghianvm
Copy link

nghianvm commented Apr 4, 2025

Ok after some tweaking, it seems

    "eslint.codeActionsOnSave.rules": [
        "import"
    ],

is the culprit. Dunno why I set it.

It seems I can't close this. Please close it for me, or keep it if you see fit to discuss the on save actions.

@bradzacher bradzacher closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2025
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Apr 12, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

3 participants