eslint-plugin-reanimated
eslint-plugin-reanimated copied to clipboard
Rule idea: flag template literal interpolation of shared value
I just ran into this not being a type error:
useAnimatedStyle(() => ({
width: `${someSharedValue}%`
}))
But clearly I meant someSharedValue.value
So seems like a type-aware ESLint rule could catch this?
yes, I have a very similar issue where I do: foo ? 1 : 0 where I meant foo.value ? 1 : 0. It would be nice indeed to flag these
Ah makes sense. So I guess anywhere where it's implicitly treated as a string or boolean? I can also think of:
if (foo) ...
foo && ...
foo || ...