diff --git a/src/components/ConditionNav/ConditionNav.styles.ts b/src/components/ConditionNav/ConditionNav.styles.ts index 8f60905d4..0293f2ca8 100644 --- a/src/components/ConditionNav/ConditionNav.styles.ts +++ b/src/components/ConditionNav/ConditionNav.styles.ts @@ -1,7 +1,7 @@ -import { makeStyles, Theme } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; export const useStyles = makeStyles( - (theme: Theme) => ({ + { root: { display: 'flex', marginBottom: '80px', @@ -22,6 +22,6 @@ export const useStyles = makeStyles( fontWeight: 700, textDecoration: 'none', }, - }), + }, { name: 'ConditionsNav' }, ); diff --git a/src/components/Editor/CustomModules/ImageFromFileHandler.ts b/src/components/Editor/CustomModules/ImageFromFileHandler.ts index 1483d3d08..943ec9dc4 100644 --- a/src/components/Editor/CustomModules/ImageFromFileHandler.ts +++ b/src/components/Editor/CustomModules/ImageFromFileHandler.ts @@ -24,11 +24,12 @@ class InsertFromFile { this.range = null; this.fileHolder = document.createElement('input'); - if (typeof this.options.upload !== 'function') + if (typeof this.options.upload !== 'function') { + // eslint-disable-next-line no-console console.warn( '[Missing config] upload function that returns a promise is required', ); - + } const toolbar = this.quill.getModule('toolbar'); toolbar.addHandler('image', this.selectLocalImage.bind(this)); @@ -96,6 +97,7 @@ class InsertFromFile { insertFromUrl(imageUrl, this.quill); }, (error) => { + // eslint-disable-next-line no-console console.warn(error); }, ); diff --git a/src/components/Editor/utilities.ts b/src/components/Editor/utilities.ts index a85b4d70a..f3f19a372 100644 --- a/src/components/Editor/utilities.ts +++ b/src/components/Editor/utilities.ts @@ -31,21 +31,24 @@ export const modules: StringMap = { }, insertFromFile: { upload: (file: string | Blob): Promise => { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.readAsDataURL(file as Blob); - reader.onload = () => { - const image = reader.result as string; - const result = image.slice(image.search(/[^,]*$/)); - resolve(result); - reject(new Error('Failed image onload')); - }; - }) - .then((str) => uploadImageToImgur(str as string)) - .then((res) => { - return res.data.data.link; + return ( + new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file as Blob); + reader.onload = () => { + const image = reader.result as string; + const result = image.slice(image.search(/[^,]*$/)); + resolve(result); + reject(new Error('Failed image onload')); + }; }) - .catch((err) => console.log(err)); + .then((str) => uploadImageToImgur(str as string)) + .then((res) => { + return res.data.data.link; + }) + // eslint-disable-next-line no-console + .catch((err) => console.error(err)) + ); }, }, history: { diff --git a/src/models/properties/reducers.ts b/src/models/properties/reducers.ts index 2511d4d9e..93017ebbc 100644 --- a/src/models/properties/reducers.ts +++ b/src/models/properties/reducers.ts @@ -27,6 +27,7 @@ const propertiesSlice = createSlice({ ...getAsyncActionsReducer(fetchPostsTypes, 'postTypes'), ...getAsyncActionsReducer(fetchDirections, 'directions'), ...getAsyncActionsReducer(fetchOrigins, 'origins'), + // eslint-disable-next-line @typescript-eslint/no-explicit-any ...getAsyncActionsReducer(fetchPostsTags as any, 'postTags'), }, }); diff --git a/src/old/lib/components/Service/Oath2Redirect.tsx b/src/old/lib/components/Service/Oath2Redirect.tsx index 5a851967f..991407817 100644 --- a/src/old/lib/components/Service/Oath2Redirect.tsx +++ b/src/old/lib/components/Service/Oath2Redirect.tsx @@ -21,6 +21,7 @@ const Oath2Redirect: React.FC = () => { if (token) { setAuthorization(token); } else { + // eslint-disable-next-line no-console console.error('NO TOKEN'); } }, [token]); diff --git a/src/old/modules/posts/components/PostViewWrapper.tsx b/src/old/modules/posts/components/PostViewWrapper.tsx index fd3b6c362..d796b9668 100644 --- a/src/old/modules/posts/components/PostViewWrapper.tsx +++ b/src/old/modules/posts/components/PostViewWrapper.tsx @@ -82,7 +82,8 @@ const PostViewWrapper: React.FC = () => { }); }) .catch((err) => { - console.log(err); + // eslint-disable-next-line no-console + console.error(err); }); }, []); diff --git a/src/views/Conditions/Conditions.styles.ts b/src/views/Conditions/Conditions.styles.ts deleted file mode 100644 index 66a1fb9b0..000000000 --- a/src/views/Conditions/Conditions.styles.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { makeStyles, Theme } from '@material-ui/core'; - -export const useStyles = makeStyles( - (theme: Theme) => ({ - root: {}, - }), - { name: 'ConditionsView' }, -); diff --git a/src/views/Conditions/Conditions.tsx b/src/views/Conditions/Conditions.tsx index aa44af9f2..b2719ff0b 100644 --- a/src/views/Conditions/Conditions.tsx +++ b/src/views/Conditions/Conditions.tsx @@ -3,11 +3,8 @@ import React from 'react'; import { Container, Box } from '@material-ui/core'; import ConditionNav from '../../components/ConditionNav'; import ContentSection from '../../components/ContentSection'; -import { useStyles } from './Conditions.styles'; export default function Conditions(): JSX.Element { - const classes = useStyles(); - return ( diff --git a/src/views/postCreation/TextPostCreation.tsx b/src/views/postCreation/TextPostCreation.tsx index 3d66d15c0..a5adf462f 100644 --- a/src/views/postCreation/TextPostCreation.tsx +++ b/src/views/postCreation/TextPostCreation.tsx @@ -90,7 +90,7 @@ export const TextPostCreation: React.FC = ({ const [typing, setTyping] = useState({ content: false, preview: false }); const [previewing, setPreviewing] = useState(false); const [authors, setAuthors] = useState([]); - const [author, setAuthor] = useState(null); + const [, setAuthor] = useState(null); const [searchValue, setSearchValue] = useState(''); const [ diff --git a/src/views/postCreation/VideoCreation/VideoPostCreation.tsx b/src/views/postCreation/VideoCreation/VideoPostCreation.tsx index 0504ff221..13bef4d43 100644 --- a/src/views/postCreation/VideoCreation/VideoPostCreation.tsx +++ b/src/views/postCreation/VideoCreation/VideoPostCreation.tsx @@ -91,7 +91,7 @@ export const VideoPostCreation: React.FC = ({ const [typing, setTyping] = useState({ content: false, preview: false }); const [previewing, setPreviewing] = useState(false); const [authors, setAuthors] = useState([]); - const [author, setAuthor] = useState(null); + const [, setAuthor] = useState(null); const [searchValue, setSearchValue] = useState(''); const videoUrl = useSelector(selectVideoUrl);