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
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/rules/no-relative-packages.md
@@ -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


<!-- end auto-generated rule header -->

Expand Down