1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fix eslint

This commit is contained in:
Fedor Katurov 2023-10-30 21:49:10 +06:00
parent e4b158dada
commit a26e4168fd
80 changed files with 199 additions and 205 deletions

View file

@ -10,7 +10,6 @@ import {
COMMENT_BLOCK_TYPES,
ICommentBlock,
} from '~/constants/comment';
import { imagePresets } from '~/constants/urls';
import { IFile, ValueOf } from '~/types';
import { CONFIG } from '~/utils/config';
import {

View file

@ -1,6 +1,5 @@
import { marked } from 'marked';
import { EventMessageType } from '~/constants/events';
import { stripHTMLTags } from '~/utils/stripHTMLTags';
/**
@ -22,7 +21,7 @@ export const formatTextSanitizeTags = (text: string): string =>
* Returns clickable usernames
*/
export const formatTextClickableUsernames = (text: string): string =>
text.replace(/~([\wа-яА-Я-]+)/giu, `<span class="username">~$1</span>`);
text.replace(/~([\wа-яА-Я-]+)/giu, '<span class="username">~$1</span>');
/**
* Makes gray comments

View file

@ -1,7 +1,6 @@
import { createContext, FC, useContext } from 'react';
import { observer } from 'mobx-react-lite';
import { boolean } from 'yup';
import { EMPTY_USER } from '~/constants/auth';
import { useAuth } from '~/hooks/auth/useAuth';

View file

@ -44,10 +44,13 @@ const ThemeProvider: FC<ProvidersProps> = ({ children }) => {
useEffect(() => {
const stored = localStorage.getItem('vault__theme');
if (!stored || !keys(themeClass).includes(stored as Theme)) {
return;
}
setTheme(stored as Theme);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const value = useMemo(() => ({ theme, setTheme }), [theme, setTheme]);