Open sindresorhus opened 2 years ago
Can we add ignore: [/Ref$/]
for prevent-abbreviations
too?
Because sometimes I create multiple refs and define as the following:
function MyComponent(props) {
const someRef = useRef();
const anotherRef = useRef();
// ...
}
I am stumbling constantly over React conventions with this lint rule. params
(and param
), prevState
, props
, etc. I'm turning it off now because it's more annoying than it's worth. Great idea, and would love to have it for abbreviations that are not conventions in a library, but I'm not renaming the input values to a) every component out there, b) useReducer
, c) etc... to satisfy some linter. If there's some progress made on a preset or something I'd be happy to turn it back on.
React is a very popular package, but a couple of the rules need some configuring to make it work.
We could either improve the rules to detect React usage and apply overrides or provide a React preset. I would prefer the former if possible.
prevent-abbreviations
:filename-case
: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/203#issuecomment-794195756Any other rules?