sindresorhus/eslint-plugin-unicorn

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

Fermée

#767 ouverte le 3 juin 2020

 (4 commentaires) (3 réactions) (0 personne assignée)JavaScript (468 forks)user submission
enhancementhelp wanted

Métriques du dépôt

Stars
 (5 022 étoiles)
Métriques de merge PR
 (Merge moyen 4h 30m) (26 PRs mergées en 30 j)

Description

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

Guide contributeur