Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LM-10764] Resolved Linting Errors #46

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_LM_FEED_API_KEY = ''
REACT_LM_FEED_VERSION_CODE = 2
REACT_LM_FEED_PLATFORM_CODE = 'rt'
REACT_APP_LM_FEED_API_KEY = ''
REACT_APP_LM_FEED_VERSION_CODE = 2
REACT_APP_LM_FEED_PLATFORM_CODE = 'rt'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "likeminds-javascript-feed-sx",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"dependencies": {
"@emotion/react": "11.11.1",
Expand Down
60 changes: 30 additions & 30 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended'
],
overrides: [
{
env: {
env: {
browser: true,
es2021: true,
node: true
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script'
}
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended'
],
overrides: [
{
env: {
node: true
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script'
}
}
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'@typescript-eslint/indent': ['off', 2],
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'@typescript-eslint/indent': ['off', 2],
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
};
1 change: 1 addition & 0 deletions src/components/AllMembers.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { IMember } from '@likeminds.community/feed-js';
import React, { useEffect, useState } from 'react';
import { lmFeedClient } from '../client';
Expand Down
13 changes: 5 additions & 8 deletions src/components/CreatePost.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import userImg from '../assets/images/user.png';
/* eslint-disable @typescript-eslint/no-explicit-any */

import React, { useContext, useEffect, useRef, useState } from 'react';
import PostOptions from './PostOptions';
import DialogBox from './dialog/DialogBox';
import CreatePostDialog from './dialog/createPost/CreatePostDialog';
import { lmFeedClient } from '../client';
import { Dialog } from '@mui/material';
import { IPost } from '@likeminds.community/feed-js';
import React, { useEffect, useRef, useState } from 'react';
import { useSelector } from 'react-redux';
import { RootState } from '../store/store';
import PostOptions from './PostOptions';
import CreatePostDialog from './dialog/createPost/CreatePostDialog';
interface CreateFeedProps {
feedModerationHandler: any;
}
Expand All @@ -34,7 +31,7 @@ const CreatePost: React.FC<CreateFeedProps> = ({ feedModerationHandler }) => {
ref.current.blur();
}
}, [openCreatePostDialog]);
const [open, setOpen] = useState(false);
// const [open, setOpen] = useState(false);

function setUserImage() {
const imageLink = currentUser?.imageUrl;
Expand Down
25 changes: 9 additions & 16 deletions src/components/DeleteDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import React from 'react';

function DeleteDialog({ onClose, deleteComment, deletePost, type }: any) {
Expand All @@ -22,24 +23,21 @@ function DeleteDialog({ onClose, deleteComment, deletePost, type }: any) {
height: '288px',
width: '400px',
borderRadius: '16px'
}}
>
}}>
<span
style={{
position: 'absolute',
top: '1.5rem',
right: '1.5rem',
cursor: 'pointer'
}}
onClick={onClose}
>
onClick={onClose}>
<svg
width="26"
height="26"
viewBox="0 0 26 26"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
xmlns="http://www.w3.org/2000/svg">
<circle cx="13" cy="13" r="12" fill="white" stroke="#484F67" />
<path
fillRule="evenodd"
Expand All @@ -57,32 +55,28 @@ function DeleteDialog({ onClose, deleteComment, deletePost, type }: any) {
style={{
padding: '20px 0px 36px 0px',
height: '80px'
}}
>
}}>
<p
style={{
lineHeight: '24px',
fontWeight: 500,
fontSize: '20px',
textAlign: 'center'
}}
>
}}>
{type === 1 ? 'Delete Post' : 'Delete Comment'}
</p>
</div>
<div
style={{
padding: '0px 36px 36px 36px',
height: '168px'
}}
>
}}>
<p
style={{
fontSize: '16px',
lineHeight: '20px',
marginBottom: '24px'
}}
>
}}>
{type === 1
? 'Are you sure you want to delete this post permanently. Once confirmed, this action can’t be reversed.'
: 'Are you sure you want to delete this comment permanently. Once confirmed, this action can’t be reversed.'}
Expand All @@ -100,8 +94,7 @@ function DeleteDialog({ onClose, deleteComment, deletePost, type }: any) {
border: 'none',
cursor: 'pointer'
}}
onClick={handleConfirm}
>
onClick={handleConfirm}>
Confirm
</button>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/EditComment.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
import '../assets/css/input-area.css';
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import React, { useEffect, useRef, useState } from 'react';
import '../assets/css/createPostDialog.css';
import '../assets/css/input-area.css';
import {
convertTextToHTML,
extractTextFromNode,
Expand Down
17 changes: 9 additions & 8 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
// src/Header/Header.tsx

import React, { useEffect, useState } from 'react';
import './../assets/css/header.css';
import { Badge, CircularProgress, IconButton, Menu, MenuItem } from '@mui/material';
import NotificationsIcon from '@mui/icons-material/Notifications';
import { lmFeedClient } from '../client';
import { IActivity, IUser } from '@likeminds.community/feed-js';
import InfiniteScroll from 'react-infinite-scroll-component';
import noNotification from '../assets/images/default.svg';
import NotificationsIcon from '@mui/icons-material/Notifications';
import { Badge, CircularProgress, IconButton, Menu } from '@mui/material';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import React, { useEffect, useState } from 'react';
import InfiniteScroll from 'react-infinite-scroll-component';
import { lmFeedClient } from '../client';
import noNotification from '../assets/images/default.svg';
import './../assets/css/header.css';
dayjs.extend(relativeTime);
interface HeaderProps {
// user: any;
Expand Down
26 changes: 9 additions & 17 deletions src/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import userImg from '../assets/images/user.png';
import liked from '../assets/images/liked.svg';
import comment from '../assets/images/comment.svg';
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import bookmark from '../assets/images/bookmark.svg';
import comment from '../assets/images/comment.svg';
import liked from '../assets/images/liked.svg';
import share from '../assets/images/share.svg';
import userImg from '../assets/images/user.png';

import React, { useContext, useEffect, useState } from 'react';
import PostHeader from './PostHeader';
import { PostContext } from '../contexts/postContext';
import { Topic } from '../models/topics';
import PostBody from './PostBody';
import PostFooter from './PostFooter';
import { IPost, IUser, LMFeedTopics } from '@likeminds.community/feed-js';
import PostHeader from './PostHeader';
import PostTopicBlock from './topic-feed/post-topic-block';
import { FeedPost } from '../models/feedPost';
import { User } from '../models/User';
import { PostContext } from '../contexts/postContext';
import { Topic } from '../models/topics';

interface PostProps {
rightSidebarHandler: (action: string, value: any) => void;
Expand All @@ -37,14 +36,7 @@ const Post: React.FC<PostProps> = ({ rightSidebarHandler }) => {
if (!post) {
return null;
}
// useEffect(() => {
// console.log('The topics are', topics);
// if (topics) {
// for (let [key, val] of Object.entries(topics)) {
// console.log(val);
// }
// }
// }, [topics]);

return (
<div>
{/* Post */}
Expand Down
2 changes: 2 additions & 0 deletions src/components/PostBody.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import post from '../assets/images/post.jpg';
import 'react-responsive-carousel/lib/styles/carousel.min.css'; // requires a loader
import { Carousel } from 'react-responsive-carousel';
Expand Down
Loading
Loading