question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn on deprecated rules

See original GitHub issue

As of v3.8.1, ESLint has a number of deprecated rules:

These rules are marked as deprecated in meta.

However, there’s no easy way for users to know that these rules are deprecated without explicitly following ESLint development.

There is a capacity for warning about the use of rules that were previously removed and replaced by other rules, but this only applies to first-party rules, and only to ones that have actually been removed: https://github.com/eslint/eslint/blob/v3.8.1/lib/eslint.js#L818-L827

I believe it would be helpful to check ruleCreator.meta.deprecated at that location, then emit a warning if that rule is deprecated.

This would be helpful for third-party plugins as well; the impetus for this is my wanting to deprecate some rules in eslint-plugin-babel that now have their functionality covered by rules in ESLint proper.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:33 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, Mar 16, 2017

It looks like the resolution is to expose deprecated rules in the Node API, but not change the CLI output for now, so this isn’t a breaking change. I’ll remove it from the 4.0 project.

1reaction
ilyavolodincommented, Nov 11, 2016

@vitorbal Option “B”, proposed by @mysticatea completely bypasses warning and error mechanics of reporting. So it will not affect CIs in any way. @platinumazure We can’t really do that. Major version is not an excuse to break every dependency we have. If there is no other way around - we can break third-party formatters, but I would want to first exhaust other options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

deprecated rule - Pega Community
A deprecated rule is a rule that is no longer supported. Where possible, migrate or upgrade these items to an appropriate alternative. You...
Read more >
deprecation - Rule
Rule : deprecation. Warns when deprecated APIs are used. Any usage of an identifier with the @deprecated JSDoc annotation will trigger a warning....
Read more >
Dealing with Deprecation Warnings - Java Cookbook [Book]
As a general rule, when something has been deprecated, you should not use it in any new code and, when maintaining code, strive...
Read more >
Use of Deprecated PMD rules - apex - Stack Overflow
you will get a deprecation warning, as the ruleset will be removed in PMD 7. However, the rule is not deprecated, and is...
Read more >
How can I hide or disable the "DEPRECATED RULE" notice in ...
Generally speaking, deprecation is used to warn users what is being DEPRECATED should not be used: something better is available, too noisy, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found