sindresorhus/eslint-plugin-unicorn

`prevent-abbreviations` - Allow multi-part exceptions

Chiusa

#1839 aperta il 2 giu 2022

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

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 4h 30m) (26 PR mergiate in 30 g)

Descrizione

I want to allow this abbr elementRef: ElementRef as it a well known term in Angular

replacements:[
  // those don't work
   elementRef: false,
   ElementRef: false,
   Ref: false,

  // only this works
    ref: false
]

I want to allow ref inside elementRef only also, mixed-case should be respected, thus Ref should only match Ref and elementRef but not ref

elementRef in the configuration above doesn't match itself, but in docs:

Camelcase replacements will only match complete identifiers. For example errCb will only match errCb and ErrCb. It will not match fooErrCb or errCbFoo.

Guida contributor