!["no-restricted-syntax": [ "error", // Require naming the function passed to `useEffect`. { selector: ":matches(CallExpression[callee.object.name='React'][callee.property.name='useEffect'], CallExpression[callee.name='useEffect']) > :matches(ArrowFunctionExpression, FunctionExpression:not([id]))", message: "Functions passed to `useEffect` must be named to document intent. More info: https://x.com/housecor/status/1750980809874436431.", }, ],](https://pbs.twimg.com/media/GFap_ciXQAAnC1N.jpg?name=small&format=webp)
ALT "no-restricted-syntax": [ "error", // Require naming the function passed to `useEffect`. { selector: ":matches(CallExpression[callee.object.name='React'][callee.property.name='useEffect'], CallExpression[callee.name='useEffect']) > :matches(ArrowFunctionExpression, FunctionExpression:not([id]))", message: "Functions passed to `useEffect` must be named to document intent. More info: https://x.com/housecor/status/1750980809874436431.", }, ],

ALT io.ns("/", |s: SocketRef| { s.on("new message", |s: SocketRef, Data::<String>(msg)| { let username = s.extensions.get::<Username>().unwrap().clone(); let msg = Res::Message { username, message: msg, }; s.broadcast().emit("new message", msg).ok(); }); s.on("add user", |s: SocketRef, Data::<String>(username)| { if s.extensions.get::<Username>().is_some() { return; } let i = NUM_USERS.fetch_add(1, std::sync::atomic::Ordering::SeqCst); s.extensions.insert(Username(username.clone())); s.emit("login", Res::Login { num_users: i }).ok(); }); });



















