Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Add option to ignore deprecation inside a deprecated context #56

Open
RebeccaStevens opened this issue Feb 22, 2023 · 1 comment
Open

Comments

@RebeccaStevens
Copy link

For example, this would not cause anything to be flagged:

/**
 * @deprecated
 */
function foo() {
  call_to_deprecated_function();
}

But if @deprecated is removed from foo, then call_to_deprecated_function is flagged.

If I get some free time I might look into making a PR for this.

@gund
Copy link
Owner

gund commented Feb 22, 2023

I'm not sure it should not report deprecated usage within deprecated code as you still should be able too see every place where your code accesses deprecated things.

Also even if you would skip call_to_deprecated_function call what should happen if within that function it accesses another deprecated API, should it also skip that or report as deprecated?
If skip - it will introduce complicated logic which has to track call stacks, if not - it will become inconsistent as at some place it will be reported and at another place it will not depending on the docblocks.

I would recommend simply using eslint native rule disabling comments for cases such as you reported and not introduce extra logic to an already complicated and quite slow rule.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants