-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'roact_dangling_connection' of https://github.com/chrisc…
…erie/selene into react-unreleased
- Loading branch information
Showing
5 changed files
with
65 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 25 additions & 43 deletions
68
...-lib/tests/lints/roblox_roact_dangling_connection/roblox_roact_dangling_connection.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,42 @@ | ||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:7:5 | ||
│ | ||
7 │ a:Connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:8:5 | ||
│ | ||
8 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:9:5 | ||
│ | ||
9 │ a:ConnectParallel() | ||
│ ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:10:5 | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:14:9 | ||
│ | ||
10 │ a:Once() | ||
│ ^^^^^^^^ | ||
14 │ a:Connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:12:5 | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:15:9 | ||
│ | ||
12 │ a.Connect() | ||
│ ^^^^^^^^^^^ | ||
15 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:13:5 | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:17:9 | ||
│ | ||
13 │ a.connect() | ||
│ ^^^^^^^^^^^ | ||
17 │ a.b:Connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:14:5 | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:18:9 | ||
│ | ||
14 │ a.ConnectParallel() | ||
│ ^^^^^^^^^^^^^^^^^^^ | ||
18 │ a.b:connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ roblox_roact_dangling_connection.lua:15:5 | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:20:9 | ||
│ | ||
15 │ a.Once() | ||
│ ^^^^^^^^ | ||
20 │ a.b.c:Connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:22:9 | ||
┌─ roblox_roact_dangling_connection.lua:21:9 | ||
│ | ||
22 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
21 │ a.b.c:connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ roblox_roact_dangling_connection.lua:28:9 | ||
┌─ roblox_roact_dangling_connection.lua:37:9 | ||
│ | ||
28 │ a:connect() | ||
37 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
|
79 changes: 5 additions & 74 deletions
79
selene-lib/tests/lints/roblox_roact_dangling_connection/with_roact.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,7 @@ | ||
local Roact = a | ||
local Roact | ||
|
||
a:Connect() | ||
a.Connect() | ||
a:connect() | ||
a.connect() | ||
|
||
a.b:Connect() | ||
a.b.Connect() | ||
a.b:connect() | ||
a.b.connect() | ||
|
||
a.b.c:Connect() | ||
a.b.c.Connect() | ||
a.b.c:connect() | ||
a.b.c.connect() | ||
|
||
local foo = a:Connect() | ||
local foo = a.Connect() | ||
local foo = a:connect() | ||
local foo = a.connect() | ||
|
||
foo = a:Connect() | ||
foo = a.Connect() | ||
foo = a:connect() | ||
foo = a.connect() | ||
|
||
foo = a.b:Connect() | ||
foo = a.b.Connect() | ||
foo = a.b:connect() | ||
foo = a.b.connect() | ||
|
||
foo = a.b.c:Connect() | ||
foo = a.b.c.Connect() | ||
foo = a.b.c:connect() | ||
foo = a.b.c.connect() | ||
|
||
local function c() | ||
a:Connect() | ||
a:connect() | ||
|
||
a.b:Connect() | ||
a.b:connect() | ||
|
||
a.b.c:Connect() | ||
a.b.c:connect() | ||
|
||
foo = a:Connect() | ||
foo = a:connect() | ||
|
||
foo = a.b:Connect() | ||
foo = a.b:connect() | ||
|
||
foo = a.b.c:Connect() | ||
foo = a.b.c:connect() | ||
end | ||
|
||
function d:e() | ||
a:Connect() | ||
a:connect() | ||
|
||
a.b:Connect() | ||
a.b:connect() | ||
|
||
a.b.c:Connect() | ||
a.b.c:connect() | ||
|
||
foo = a:Connect() | ||
foo = a:connect() | ||
|
||
foo = a.b:Connect() | ||
foo = a.b:connect() | ||
|
||
foo = a.b.c:Connect() | ||
foo = a.b.c:connect() | ||
local function Component() | ||
Roact.useEffect(function() | ||
a:Connect() | ||
end) | ||
end |
76 changes: 5 additions & 71 deletions
76
selene-lib/tests/lints/roblox_roact_dangling_connection/with_roact.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,6 @@ | ||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:39:5 | ||
│ | ||
39 │ a:Connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:40:5 | ||
│ | ||
40 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:42:5 | ||
│ | ||
42 │ a.b:Connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:43:5 | ||
│ | ||
43 │ a.b:connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:45:5 | ||
│ | ||
45 │ a.b.c:Connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:46:5 | ||
│ | ||
46 │ a.b.c:connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:59:5 | ||
│ | ||
59 │ a:Connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:60:5 | ||
│ | ||
60 │ a:connect() | ||
│ ^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:62:5 | ||
│ | ||
62 │ a.b:Connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:63:5 | ||
│ | ||
63 │ a.b:connect() | ||
│ ^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:65:5 | ||
│ | ||
65 │ a.b.c:Connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
|
||
error[roblox_roact_dangling_connection]: disconnect the connection where appropriate | ||
┌─ with_roact.lua:66:5 | ||
│ | ||
66 │ a.b.c:connect() | ||
│ ^^^^^^^^^^^^^^^ | ||
error[roblox_roact_dangling_connection]: disconnect the connection in the useEffect cleanup function | ||
┌─ with_roact.lua:5:9 | ||
│ | ||
5 │ a:Connect() | ||
│ ^^^^^^^^^^^ | ||
|