`prevent-abbreviations`: Smarter `whitelist` option possibly deprecating `ignore` option
#930 aperta il 9 dic 2020
Metriche repository
- Star
- (5022 stelle)
- Metriche merge PR
- (Merge medio 1g 16h) (399 PR mergiate in 30 g)
Descrizione
There are now two options to exclude an identifier from linting: older whitelist and newer ignore. I think whitelist alone would suffice with the following modification.
We could make whitelist match any subsequence of the split identifier. For example (following up this https://github.com/sindresorhus/eslint-plugin-unicorn/issues/567#issuecomment-591007369):
For fooE2eBar all of these would be checked against whitelist:
fooe2barbarEe22eeBarfooE2e2e2eBarfooE2ee2eBarfooE2eBar
And if any of them is in the whitelist that subsequence is ignored.
But in my opinion it should not ignore the whole identifier if only subsequence matches whitelist.
For example, if the user had e2e in their whitelist, e2eErr should still be fixed to e2eError.
From https://github.com/sindresorhus/eslint-plugin-unicorn/pull/891#issuecomment-713729469