gund / eslint-plugin-deprecation

ESLint rule that reports usage of deprecated code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False positive on deprecated interface, enum, and type definitions

ecraig12345 opened this issue ยท comments

The plugin currently is reporting errors at the spot where deprecated interfaces and enums (but not variables or classes) are defined, which seems wrong.

These cases incorrectly show errors at the line where the thing is defined:

/** @deprecated */
interface Thing {}
/** @deprecated */
enum Color {}
/** @deprecated */
type OtherString = string;

These cases behave correctly (no error at definition):

/** @deprecated */
const a = 1;
/** @deprecated */
let b = 2;
/** @deprecated */
var c = 3;
/** @deprecated */
class Thing2 {}
/** @deprecated */
function foo() {}

Hi, thanks for reporting this issue.

As I already pointed out in another issue - I'm not the author of this plugin's code and neither spent any significant time to understand it yet.

So I would not be able to fix this issue any time soon.

However you are more then welcome to try to fix is if you have time and open a PR =)

Got it, thanks for clarifying. It's unfortunate that this doesn't have feature parity and isn't officially supported since typescript-eslint seems to have considered it "good enough" that they don't need to invest in properly supporting a deprecation rule like TSLint had. I'm trying to work on fixes for this and the other issue, but there's a pretty significant learning curve to understanding the ESTree API well enough to fix anything.

๐ŸŽ‰ This issue has been resolved in version 1.1.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€