v3: shared/ is documented like api/ — deno doc --lint over api/ and shared/ goes from 385 errors to none — every module of shared/ opens with a /** … @module */ block; every export and every field of an exported interface has JSDoc, each request body naming the endpoint that takes it and each response its endpoint; the // comments that described declarations (the mention pattern, the permission union and table, four socket messages, the error message's optimistic-action context) are /** */ now, and the socket protocol's heading comment, which sat on no declaration, is its module doc. The lint wanted explicit types on MENTION_RE and DUMP_MAX_FILE_SIZE_BYTES. Along the way: the chat edit is allowed to moderators too, which the new ChatEditMessage doc says; UpdateUserRequest says that PATCH /api/users/me takes only its description and email; playlist-service's reorderPlaylist @throws is rewrapped. mod.ts and the README no longer call shared/ undocumented. No behaviour changes; 205 backend tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
// Matches @username not already inside a markdown link ([...] or (...)) and
|
||||
// not mid-word, so an email address doesn't mention its domain. The server
|
||||
// notifies whoever it matches; the chat highlights the same names.
|
||||
export const MENTION_RE = /(?<![[(\w])@(\w+)/g;
|
||||
/**
|
||||
* The @mention pattern, one for the server and the chat.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
|
||||
/**
|
||||
* Matches @username not already inside a markdown link ([...] or (...)) and
|
||||
* not mid-word, so an email address doesn't mention its domain; the name is
|
||||
* the first group. The server notifies whoever it matches; the chat highlights
|
||||
* the same names.
|
||||
*/
|
||||
export const MENTION_RE: RegExp = /(?<![[(\w])@(\w+)/g;
|
||||
|
||||
Reference in New Issue
Block a user