Add Roact dangling connection lint
Closes #383. This only errors when the file has Roact or React defined and when the connection is made within useEffect. In the future if we can reliably detect components vs regular functions we can also warn about dangling connections during render.
a:Connect()
local function a()
b:Connect()
useEffect(function()
local b = c:Connect()
d(b:Connect())
e(function() end, f:Connect())
c:Connect() -- Errors
end, {})
end
Looks mostly good. Out of curiosity, and it doesn't have to, does this magically work with ReactHooks' useEffect? The one being passed through?
Yes, it will show the useEffect-specific error with useEffect(..., function() end, ...) and anything.useEffect(..., function() end, ...)
To display the useEffect specific error it'll now look for the react/roact/hooks prefix per @matthargett's suggestion for a similar lint