I have a project where lint with and without --fix interpret a line differently with respect to no-unsafe-argument #11258
Closed
ts-amz
started this conversation in
Technical Discussions
Replies: 1 comment
-
Hi @ts-amz! We don't use discussions for support, please see https://typescript-eslint.io/contributing/discussions, and also https://typescript-eslint.io/contributing/issues/#questions-and-support-requests for how to reach out with these sorts of inquiries. In this particular case, your issue sounds like a duplicate of #10013, though. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body
TL;DR: how can eslint with and without
--fix
interpret a line differently?I cannot share code because it's proprietary, and I don't have time to build a public example (if I can even repro it with a simpler project), so I'm asking in case there's some sensible way this works that I'm unaware of.
I have an nx typescript project that uses eslint. In one project, I am running these two commands:
npx eslint {projectRoot} --fix --max-warnings=0
andnpx eslint {projectRoot} --max-warnings=0
In the case of eslint without
--fix
, I am getting this warning:That is because the file in question has this on line 74:
If I run eslint with
--fix
, it passes without a warning.If I remove that eslint-disable line, and I run eslint without
--fix
, it passes without any warnings or errors.If I remove that eslint-disable line, and I run eslint with
--fix
, it fails with this error:I do not understand why eslint with and without
--fix
would interpret this line differently. One believes there's an unsafe-argument error and the other doesn't.I have been unsuccessful in finding out how it's even possible to configure the two differently. The issue is also not with allowing the disable line or how warnings are interpreted because the error is in how they interpret the line of code.
Can someone explain how this is possible? How can I figure out why these two are different?
(Note: I asked on eslint and the only response I got said they think it must be a typescript-eslint specific issue)
Thank you!
Additional Info
Any additional info...
Before you submit your discussion, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
Beta Was this translation helpful? Give feedback.
All reactions