sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules
MIT License
4.18k stars 360 forks source link

Support the ESLint Suggestions API #441

Open sindresorhus opened 4 years ago

sindresorhus commented 4 years ago

There have been many cases where we could not provide auto-fixers because it was either not safe or there were multiple possible fixes. The Suggestions API enables us to provide multiple fixes that can be manually chosen by a user in an editor.

We should go through existing rules with no auto-fixers or with incomplete auto-fixers and make them support the Suggestions API.


This will be especially useful for https://github.com/sindresorhus/eslint-plugin-unicorn/issues/460#issuecomment-560090551

fisker commented 4 years ago

we need eslint-ava-rule-tester support, right?

sindresorhus commented 4 years ago

Maybe. Could simply be that we need to add a condition for it here: https://github.com/jfmengels/eslint-ava-rule-tester/blob/67878c62376c0f45e534eef00202be49d3c37fc5/index.js#L30-L32

fisker commented 3 years ago

We already using this API, we'll try to use it if other rules need it, let's close this.

sindresorhus commented 3 years ago

I think we should still keep it open until we have reviewed each rule to see if we could add suggestion API to any. Before the suggestion API existed, we chose to leave out autofixing on many rules, and they could now get a suggestion instead. We could then open an issue for each rule where we could add it.

Help welcome with gathering a list of rules that could have suggestions.

fisker commented 3 years ago

Sure

fisker commented 1 year ago

I may accidentally unpinned a pinned issue when scrolling issue list on mobile, and it's not showing in recent updated. Not sure what is it.