-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: introduce new deprecated types for rules #19238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
It doesn't seem that this is implemented? |
|
I updated the OP with the correct issue and corrected the messages in the rules. |
I think what we're looking for is something to autogenerate the comment at the top of this page:
Right now, these are hardcoded into the docs. |
Sorry for the delay, I somehow missed a notification for this comment. My understanding of the "Update ESLint's website generator to take into account the additional information" task mentioned in the original issue and the RFC was that we'll use the new metadata to autogenerate deprecation text on rule pages instead of hardcoding it in each rule's docs source .md file, just as @nzakas said in the comment above. |
Sorry for the delay. I added the deprecated rule notice and removed the manually added ones. |
@DMartens can you please resolve merge conflicts? |
Verify Files check is failing:
Looks like we should remove checking for deprecated info in rule docs source files. Lines 752 to 757 in 17f2aae
|
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Thanks for the helpful code review, all of these should be fixed now. |
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
This implements the additional deprecated metadata RFC and closes #18061.
The checklist from the RFC:
Internal Changes:
External Changes:
I also investigated the impact for third-party plugins.
Generally there are only a few deprecated rules and most are stylistic rules.
An overview for plugins with some deprecated rules:
jsx-*
shebang
imports-first
component-tags-order
,no-invalid-model-keys
,no-ref-object-destructure
,no-setup-props-destructure
,script-setup-uses-vars
,v-on-function-call
svelte/@typescript-eslint/no-unnecessary-condition
functional-parameters
Plugins without deprecated rules:
Is there anything you'd like reviewers to focus on?
Some notes for the changes:
DeprecateInfo
as it is part of the rule but its documentation has no type anywhere and the type documentation is required forusedDeprecatedRules
in NodeJS API Documentation. I chose to use a separate page with a short intro about the deprecated format and detailing the new format. This document could also detail future tools using the deprecated information.meta.deprecated
property for the ruleindent-legacy
is not updated as it is used for a test case inlegacy-eslint
andCLIEngine
which I assume to be frozen (but I still updated it for other frozen rules)eslint-stylistic
(e.g. rules replaced bypadding-line-between-statements
)