eslint-config-hardcore
eslint-config-hardcore copied to clipboard
Replace `etc/no-deprecated` with eslint-plugin-deprecation
https://github.com/gund/eslint-plugin-deprecation
Unless https://github.com/cartant/eslint-plugin-etc/issues/53 gets fixed.
Or with sonar/deprecation
from https://github.com/un-ts/eslint-plugin-sonar
What's the benefits over https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-deprecated.md ?
(Reference https://github.com/voxpelli/eslint-config/issues/160)
@voxpelli
Just tested the rules on a real-world codebase:
-
etc/no-deprecated
- 78 warnings -
deprecation/deprecation
- 76 warnings -
sonar/deprecation
- 76 warnings -
import/no-deprecated
- 54 warnings
So import/no-deprecated
catches less cases.
Created https://github.com/EvgenyOrekhov/eslint-config-hardcore/issues/739 to disable import/no-deprecated
for TS, since it's superseded by etc/no-deprecated
.
Right, makes sense, type resolutions can be more complex
What are the two warnings that differ between the 78 and 76 ones?
@voxpelli Seems like etc/no-deprecated
just sometimes gives duplicated warnings, like
140:45 error "pageYOffset" is deprecated: This is a legacy alias of `scrollY` etc/no-deprecated
140:45 error "pageYOffset" is deprecated: This is a legacy alias of `scrollY` etc/no-deprecated
Also tested time difference:
-
etc/no-deprecated
- 47 seconds -
deprecation/deprecation
- 57 seconds -
sonar/deprecation
- 52 seconds
Yikes, yeah, these rules can be really slow, I tried adding deprecation checks to a large monorepo at a recent job and it increased the execution time of the linting so much that I reverted on it before ever suggesting the change 😕
So which one of these is recommended to use lol?
@DeadlyMissile I considered migrating away from etc/no-deprecated
because it wasn't compatible with TypeScript v5, but now it is, so I'll stick to it for now, especially since it's a bit faster than the others.
But functionality-wise, all three are the same.
Sorry to add to an old issue @EvgenyOrekhov, but it seems to break with Typescript 5.2, see https://github.com/cartant/eslint-plugin-etc/issues/64