Rules
ref-name
Full Name in @eslint-react/eslint-plugin
@eslint-react/naming-convention/ref-nameFull Name in eslint-plugin-react-naming-convention
react-naming-convention/ref-namePresets
recommended
recommended-typescript
recommended-type-checked
strict
strict-typescript
strict-type-checked
Description
Enforces that variables assigned from useRef calls have names ending with Ref.
Examples
Failing
const count = useRef(0);const input = useRef<HTMLInputElement>(null);const value = useRef(null);Passing
const countRef = useRef(0);const inputRef = useRef<HTMLInputElement>(null);const valueRef = useRef(null);