eslint-config-hardcore icon indicating copy to clipboard operation
eslint-config-hardcore copied to clipboard

Replace `etc/no-deprecated` with eslint-plugin-deprecation

Open EvgenyOrekhov opened this issue 1 year ago • 9 comments

https://github.com/gund/eslint-plugin-deprecation

Unless https://github.com/cartant/eslint-plugin-etc/issues/53 gets fixed.

EvgenyOrekhov avatar Apr 30 '23 23:04 EvgenyOrekhov

Or with sonar/deprecation from https://github.com/un-ts/eslint-plugin-sonar

EvgenyOrekhov avatar May 08 '23 17:05 EvgenyOrekhov

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 avatar May 12 '23 09:05 voxpelli

@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.

EvgenyOrekhov avatar May 12 '23 20:05 EvgenyOrekhov

Right, makes sense, type resolutions can be more complex

What are the two warnings that differ between the 78 and 76 ones?

voxpelli avatar May 12 '23 20:05 voxpelli

@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

EvgenyOrekhov avatar May 12 '23 21:05 EvgenyOrekhov

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 😕

voxpelli avatar May 12 '23 21:05 voxpelli

So which one of these is recommended to use lol?

DeadlyMissile avatar Jul 09 '23 23:07 DeadlyMissile

@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.

EvgenyOrekhov avatar Jul 10 '23 22:07 EvgenyOrekhov

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

CHE1RON avatar Mar 04 '24 13:03 CHE1RON