-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: --fix
unexpectedly removes eslint-disable comment
#10013
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
Comments
Confirmed locally.... weird! wondering if it's to do with single run inference related things? Note that the report also shows up as unused in my editor. |
Running typescript-eslint/packages/typescript-estree/src/parser.ts Lines 168 to 196 in 2055cfb
Running eslint --fix test.ts implies: single run === false -> create watch program -> create watch compiler host -> watch compiler host created with allowJs: true since it is set as the default compiler option
In the second case (with
A very similar issue was reported in some repositories after single run inference was enabled by default: #9749 |
Uh oh!
There was an error while loading. Please reload this page.
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
typescript-eslint correctly flags a
@typescript-eslint/no-unsafe-member-access
error when accessing an untyped module.However, if I ignore this error with an
eslint-disable-next-line
comment, andreportUnusedDisableDirectives
is enabled, the comment is unexpectedly removed byeslint --fix
.With the comment removed, the error is not reported when running with
--fix
, but it is reported when running without--fix
.Reproduction Repository Link
https://gist.github.com/andersk/5bacfa857d080e6ed6627063f0700694
Repro Steps
Versions
@typescript-eslint/eslint-plugin
8.6.0
@typescript-eslint/parser
8.6.0
@typescript-eslint/scope-manager
8.6.0
@typescript-eslint/typescript-estree
8.6.0
@typescript-eslint/type-utils
8.6.0
@typescript-eslint/utils
8.6.0
TypeScript
5.5.4
ESLint
9.10.0
node
20.17.0
The text was updated successfully, but these errors were encountered: