sindresorhus/eslint-plugin-unicorn

prevent-abbreviations: when multiple replacements are defined, suggest each through ESLint's suggest API

Chiusa

#767 aperta il 3 giu 2020

 (4 commenti) (3 reazioni) (0 assegnatari)JavaScript (468 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 1g 16h) (399 PR mergiate in 30 g)

Descrizione

Currently, the prevent-abbreviations autofixer only applies when there is only a single replacement defined. But when multiple replacements are there (if the abbreviation is ambiguous) the violation has to be fixed manually.

It would be nice if the replacements were all suggested to the user in the editor/IDE to pick from. ESLint has the suggest API for this: https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions

Guida contributor