mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
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:
@@ -122,9 +122,11 @@ interface Props {
|
||||
}
|
||||
|
||||
function Locale({ children, locale }: Props) {
|
||||
const [defns, setDefinition] = useState(definition);
|
||||
// TODO: create and use LanguageDefinition type here
|
||||
const [defns, setDefinition] = useState<Record<string, unknown>>(definition);
|
||||
const lang = Languages[locale];
|
||||
|
||||
// TOOD: clean this up and use the built in Intl API
|
||||
function transformLanguage(obj: { [key: string]: any }) {
|
||||
const dayjs = obj.dayjs;
|
||||
const defaults = dayjs.defaults;
|
||||
@@ -158,7 +160,7 @@ function Locale({ children, locale }: Props) {
|
||||
|
||||
if (lang.i18n === "hardcore") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
setDefinition({} as any);
|
||||
setDefinition({});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user