azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

use auto fix without any warnings or errors #99

Closed issam-seghir closed 4 months ago

issam-seghir commented 4 months ago

Describe the bug

Can the auto-fix (sort) feature be enabled when I hit Ctrl+S, but disable the warning messages? Currently, when I disable the warning messages like this:

rules: { "perfectionist/sort-object-types": "off", }

it also disables the auto-fix feature. In summary, I want the code to be sorted automatically when I hit save, without any errors or warning messages because they are not necessary.

image

Code example

...

ESLint version

8.55.0

ESLint Plugin Perfectionist version

2.5.0

Additional comments

No response

Validations

azat-io commented 4 months ago

This seems to be a limitation of ESLint, you can only use autofix if you have an error. Have you seen something similar in other ESLint rules?

issam-seghir commented 4 months ago

have you seen something similar in other ESLint rules?

Unfortunately no, i used to change "error" to "warning" for plugins such as sort-import , but this plugin is annoying because it throws errors in every place

azat-io commented 4 months ago

Unfortunately, there doesn't seem to be anything I can do to help here. This is the ESLint API.