Add deprecated flags to imports-first metadata #625
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Over on eslint-find-rules, there has been some discussion about being able to detect deprecated rules in order to not report them as unused and to report when they are still being used.
In order to implement those features, there needs to be a way to detect that a rule has been deprecated. Core ESLint rules that are deprecated are marked as such in their metadata.
This PR adds the same
deprecated
flag to the metadata of the deprecated rule in this plugin.I added a very specific spec for this rule to make sure that
imports-first
is marked as deprecated, butfirst
(which is its new name) is not. There might be a better way to write a more generic test, but when there’s only a single deprecated rule, it’s hard to know what the right direction is.