remove most uses of as any in typescript

- replaced many uses of `as any` with another more specific cast `as T`
- filled in missing typed for items that needed to be typed
  - new runtime code was added where necessary to satisfy the new types with comments
- added missing theme variable "sidebar-active" to the Theme variables
- forms using `react-hook-form` are now typechecked
- changed some instances of `target` into `currentTarget` while removing `as any` assertions
This commit is contained in:
bree
2021-07-04 07:09:39 -04:00
parent 504f491074
commit b341f5d166
31 changed files with 161 additions and 117 deletions

View File

@@ -35,7 +35,12 @@ function Message({ attachContext, message, contrast, content: replacement, head:
const content = message.content as string;
const head = preferHead || (message.replies && message.replies.length > 0);
const userContext = attachContext ? attachContextMenu('Menu', { user: message.author, contextualChannel: message.channel }) : undefined as any; // ! FIXME: tell fatal to make this type generic
// ! FIXME: tell fatal to make this type generic
// bree: Fatal please...
const userContext = attachContext
? attachContextMenu('Menu', { user: message.author, contextualChannel: message.channel }) as any
: undefined;
const openProfile = () => openScreen({ id: 'profile', user_id: message.author });
return (