Skip to content
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

Document fix-type of no-relative-packages #2845

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Aug 1, 2023

Fix types aren't obvious so documenting them avoids having to find it out via trial&error or code spelunking.

@@ -1,6 +1,6 @@
# import/no-relative-packages

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) using [`--fix-type suggestion`](https://eslint.org/docs/latest/use/command-line-interface#--fix-type).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this seems great, the header of the docs are autogenerated, and npm run update:eslint-docs overwrites this.

@bmish, is this something that can be supported by eslint-doc-generator?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since ESLint has a --fix-type option, I agree it's a good idea to expose the type that needs to be passed to the option in the doc somewhere.

If we want to add this to the fixable notice, I would want to note that it's optional to specify the fix type:

🔧 This rule is automatically fixable by the --fix CLI option, optionally using --fix-type suggestion.

There's also an optional rule doc notice value of type (--rule-doc-notice type) that could be useful for this purpose. When this notice is enabled, it will show the following for a suggestion type rule, and this could be updated to specify the type string as well:

Before:

📖 This rule identifies potential improvements.

After:

📖 This rule is of type suggestion and identifies potential improvements.

https://github.com/bmish/eslint-doc-generator#column-and-notice-types

Filed an issue to track this improvement: bmish/eslint-doc-generator#469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants