Skip to content

Commit 0555f6b

Browse files
committed
[Beta] Remove linter TODOs
1 parent d56aec2 commit 0555f6b

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

beta/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"eslint-plugin-import": "2.x",
6666
"eslint-plugin-jsx-a11y": "6.x",
6767
"eslint-plugin-react": "7.x",
68-
"eslint-plugin-react-hooks": "2.x",
68+
"eslint-plugin-react-hooks": "experimental",
6969
"fs-extra": "^9.0.1",
7070
"globby": "^11.0.1",
7171
"gray-matter": "^4.0.2",

beta/src/content/learn/escape-hatches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ function ChatRoom({ roomId, theme }) {
489489
});
490490
connection.connect();
491491
return () => connection.disconnect();
492-
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
492+
}, [roomId]);
493493

494494
return <h1>Welcome to the {roomId} room!</h1>
495495
}

beta/src/content/learn/removing-effect-dependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ function Welcome({ duration }) {
14141414
return () => {
14151415
animation.stop();
14161416
};
1417-
}, [onAppear]); // TODO: Linter will allow [] in the future
1417+
}, []);
14181418

14191419
return (
14201420
<h1
@@ -2209,7 +2209,7 @@ export default function ChatRoom({ roomId, isEncrypted, onMessage }) {
22092209
connection.on('message', (msg) => onReceiveMessage(msg));
22102210
connection.connect();
22112211
return () => connection.disconnect();
2212-
}, [roomId, isEncrypted, onReceiveMessage]); // TODO: Linter will allow [roomId, isEncrypted] in the future
2212+
}, [roomId, isEncrypted]);
22132213

22142214
return <h1>Welcome to the {roomId} room!</h1>;
22152215
}

beta/src/content/learn/reusing-logic-with-custom-hooks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ export function useChatRoom({ serverUrl, roomId, onReceiveMessage }) {
10021002
onMessage(msg);
10031003
});
10041004
return () => connection.disconnect();
1005-
}, [roomId, serverUrl, onMessage]); // TODO: Linter will allow [roomId, serverUrl]
1005+
}, [roomId, serverUrl]);
10061006
}
10071007
```
10081008
@@ -1673,7 +1673,7 @@ function useAnimationLoop(isRunning, drawFrame) {
16731673

16741674
tick();
16751675
return () => cancelAnimationFrame(frameId);
1676-
}, [isRunning, onFrame]); // TODO: Linter will allow [isRunning] in the future
1676+
}, [isRunning]);
16771677
}
16781678
```
16791679
@@ -2306,7 +2306,7 @@ export function useInterval(callback, delay) {
23062306
useEffect(() => {
23072307
const id = setInterval(onTick, delay);
23082308
return () => clearInterval(id);
2309-
}, [delay, onTick]); // TODO: Linter will allow [delay] in the future
2309+
}, [delay]);
23102310
}
23112311
```
23122312

beta/src/content/learn/separating-events-from-effects.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function ChatRoom({ roomId, theme }) {
482482
});
483483
connection.connect();
484484
return () => connection.disconnect();
485-
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
485+
}, [roomId]);
486486

487487
return <h1>Welcome to the {roomId} room!</h1>
488488
}
@@ -813,7 +813,7 @@ export default function App() {
813813
useEffect(() => {
814814
window.addEventListener('pointermove', onMove);
815815
return () => window.removeEventListener('pointermove', onMove);
816-
}, [onMove]); // TODO: Linter will allow [] in the future
816+
}, []);
817817

818818
return (
819819
<>
@@ -1172,7 +1172,7 @@ export default function Timer() {
11721172
return () => {
11731173
clearInterval(id);
11741174
};
1175-
}, [onTick]); // TODO: Linter will allow [] in the future
1175+
}, []);
11761176

11771177
return (
11781178
<>
@@ -1342,7 +1342,7 @@ export default function Timer() {
13421342
return () => {
13431343
clearInterval(id);
13441344
}
1345-
}, [delay, onTick]); // TODO: Linter will allow [delay] in the future
1345+
}, [delay]);
13461346

13471347
return (
13481348
<>
@@ -1441,7 +1441,7 @@ function ChatRoom({ roomId, theme }) {
14411441
});
14421442
connection.connect();
14431443
return () => connection.disconnect();
1444-
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
1444+
}, [roomId]);
14451445

14461446
return <h1>Welcome to the {roomId} room!</h1>
14471447
}
@@ -1582,7 +1582,7 @@ function ChatRoom({ roomId, theme }) {
15821582
});
15831583
connection.connect();
15841584
return () => connection.disconnect();
1585-
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
1585+
}, [roomId]);
15861586

15871587
return <h1>Welcome to the {roomId} room!</h1>
15881588
}
@@ -1725,7 +1725,7 @@ function ChatRoom({ roomId, theme }) {
17251725
clearTimeout(notificationTimeoutId);
17261726
}
17271727
};
1728-
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
1728+
}, [roomId]);
17291729

17301730
return <h1>Welcome to the {roomId} room!</h1>
17311731
}

beta/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,16 +2500,16 @@ eslint-plugin-jsx-a11y@6.x, eslint-plugin-jsx-a11y@^6.4.1:
25002500
language-tags "^1.0.5"
25012501
minimatch "^3.0.4"
25022502

2503-
eslint-plugin-react-hooks@2.x:
2504-
version "2.5.1"
2505-
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.1.tgz#4ef5930592588ce171abeb26f400c7fbcbc23cd0"
2506-
integrity sha512-Y2c4b55R+6ZzwtTppKwSmK/Kar8AdLiC2f9NADCuxbcTgPPg41Gyqa6b9GppgXSvCtkRw43ZE86CT5sejKC6/g==
2507-
25082503
eslint-plugin-react-hooks@^4.2.0:
25092504
version "4.3.0"
25102505
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172"
25112506
integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA==
25122507

2508+
eslint-plugin-react-hooks@experimental:
2509+
version "0.0.0-experimental-cb5084d1c-20220924"
2510+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-0.0.0-experimental-cb5084d1c-20220924.tgz#66847d4c458198a1a38cbf437397dd461bfa7245"
2511+
integrity sha512-qk195a0V1Fz82DUESwAt8bSxwV3MBYGUh4cWezY21gaWderOcva8SdC6HNMAwk2Ad/HvaJbjp/qLYrYBQW7pGg==
2512+
25132513
eslint-plugin-react@7.x, eslint-plugin-react@^7.23.1:
25142514
version "7.28.0"
25152515
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf"

0 commit comments

Comments
 (0)