Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Beta] Remove linter TODOs #5102

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "2.x",
"eslint-plugin-react-hooks": "experimental",
"fs-extra": "^9.0.1",
"globby": "^11.0.1",
"gray-matter": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion beta/src/content/learn/escape-hatches.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function ChatRoom({ roomId, theme }) {
});
connection.connect();
return () => connection.disconnect();
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
}, [roomId]);

return <h1>Welcome to the {roomId} room!</h1>
}
Expand Down
4 changes: 2 additions & 2 deletions beta/src/content/learn/removing-effect-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ function Welcome({ duration }) {
return () => {
animation.stop();
};
}, [onAppear]); // TODO: Linter will allow [] in the future
}, []);

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

return <h1>Welcome to the {roomId} room!</h1>;
}
Expand Down
6 changes: 3 additions & 3 deletions beta/src/content/learn/reusing-logic-with-custom-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ export function useChatRoom({ serverUrl, roomId, onReceiveMessage }) {
onMessage(msg);
});
return () => connection.disconnect();
}, [roomId, serverUrl, onMessage]); // TODO: Linter will allow [roomId, serverUrl]
}, [roomId, serverUrl]);
}
```

Expand Down Expand Up @@ -1673,7 +1673,7 @@ function useAnimationLoop(isRunning, drawFrame) {

tick();
return () => cancelAnimationFrame(frameId);
}, [isRunning, onFrame]); // TODO: Linter will allow [isRunning] in the future
}, [isRunning]);
}
```

Expand Down Expand Up @@ -2306,7 +2306,7 @@ export function useInterval(callback, delay) {
useEffect(() => {
const id = setInterval(onTick, delay);
return () => clearInterval(id);
}, [delay, onTick]); // TODO: Linter will allow [delay] in the future
}, [delay]);
}
```

Expand Down
14 changes: 7 additions & 7 deletions beta/src/content/learn/separating-events-from-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ function ChatRoom({ roomId, theme }) {
});
connection.connect();
return () => connection.disconnect();
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
}, [roomId]);

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

return (
<>
Expand Down Expand Up @@ -1172,7 +1172,7 @@ export default function Timer() {
return () => {
clearInterval(id);
};
}, [onTick]); // TODO: Linter will allow [] in the future
}, []);

return (
<>
Expand Down Expand Up @@ -1342,7 +1342,7 @@ export default function Timer() {
return () => {
clearInterval(id);
}
}, [delay, onTick]); // TODO: Linter will allow [delay] in the future
}, [delay]);

return (
<>
Expand Down Expand Up @@ -1441,7 +1441,7 @@ function ChatRoom({ roomId, theme }) {
});
connection.connect();
return () => connection.disconnect();
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
}, [roomId]);

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

return <h1>Welcome to the {roomId} room!</h1>
}
Expand Down Expand Up @@ -1725,7 +1725,7 @@ function ChatRoom({ roomId, theme }) {
clearTimeout(notificationTimeoutId);
}
};
}, [roomId, onConnected]); // TODO: Linter will allow [roomId] in the future
}, [roomId]);

return <h1>Welcome to the {roomId} room!</h1>
}
Expand Down
10 changes: 5 additions & 5 deletions beta/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2500,16 +2500,16 @@ eslint-plugin-jsx-a11y@6.x, eslint-plugin-jsx-a11y@^6.4.1:
language-tags "^1.0.5"
minimatch "^3.0.4"

eslint-plugin-react-hooks@2.x:
version "2.5.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.1.tgz#4ef5930592588ce171abeb26f400c7fbcbc23cd0"
integrity sha512-Y2c4b55R+6ZzwtTppKwSmK/Kar8AdLiC2f9NADCuxbcTgPPg41Gyqa6b9GppgXSvCtkRw43ZE86CT5sejKC6/g==

eslint-plugin-react-hooks@^4.2.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172"
integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA==

eslint-plugin-react-hooks@experimental:
version "0.0.0-experimental-cb5084d1c-20220924"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-0.0.0-experimental-cb5084d1c-20220924.tgz#66847d4c458198a1a38cbf437397dd461bfa7245"
integrity sha512-qk195a0V1Fz82DUESwAt8bSxwV3MBYGUh4cWezY21gaWderOcva8SdC6HNMAwk2Ad/HvaJbjp/qLYrYBQW7pGg==

eslint-plugin-react@7.x, eslint-plugin-react@^7.23.1:
version "7.28.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf"
Expand Down