diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..7d9035e7a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,50 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:@typescript-eslint/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": [ + "react", + "react-hooks", + "@typescript-eslint" + ], + "rules": { + "react-hooks/exhaustive-deps": "off", + "@typescript-eslint/no-explicit-any": "off", + "react/react-in-jsx-scope": "off", + "react/prop-types": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-namespace": "off", + "import/no-extraneous-dependencies": "off", + "@typescript-eslint/ban-types": "off", + "react/no-unescaped-entities": "off", + "no-async-promise-executor": "off", + "react/no-children-prop": "off", + "no-extra-boolean-cast": "off", + "react/display-name": "off", + "prefer-const": "off", + "no-console": "off", + "no-debugger": "off" + }, + "settings": { + "react": { + "version": "detect" + } + } +} diff --git a/src/components/animate/motion-lazy.tsx b/src/components/animate/motion-lazy.tsx index 5f2f9a367..60e8d8054 100644 --- a/src/components/animate/motion-lazy.tsx +++ b/src/components/animate/motion-lazy.tsx @@ -2,7 +2,7 @@ import { LazyMotion, m } from 'framer-motion'; // ---------------------------------------------------------------------- -// eslint-disable-next-line import/extensions +// @ts-ignore const loadFeatures = () => import('./features.js').then((res) => res.default); type Props = { diff --git a/src/components/carousel/variants/carousel-main.tsx b/src/components/carousel/variants/carousel-main.tsx index de4d73d45..8a13e60fd 100644 --- a/src/components/carousel/variants/carousel-main.tsx +++ b/src/components/carousel/variants/carousel-main.tsx @@ -15,9 +15,7 @@ import { varFade } from '@src/components/animate'; import Carousel, { CarouselDots, useCarousel } from '@src/components/carousel/index'; import { IconFlagFilled, IconPlayerPlay } from '@tabler/icons-react'; import Stack from '@mui/material/Stack'; - // @ts-ignore -// eslint-disable-next-line import/no-extraneous-dependencies import { type Post } from '@lens-protocol/api-bindings/dist/declarations/src/lens/graphql/generated'; import { paths } from '@src/routes/paths.ts'; import { useRouter } from '@src/routes/hooks'; diff --git a/src/components/watchit-loader/index.tsx b/src/components/watchit-loader/index.tsx index 989c62022..0eb9004a8 100644 --- a/src/components/watchit-loader/index.tsx +++ b/src/components/watchit-loader/index.tsx @@ -1,6 +1,5 @@ import { FC, useEffect, useRef } from 'react'; import Box from '@mui/material/Box'; -// eslint-disable-next-line import/no-extraneous-dependencies import Lottie, { LottieRefCurrentProps } from 'lottie-react'; import watchitLogo from '@src/assets/animations/watchit-spinner.json'; diff --git a/src/sections/governance/view/governance-details-view.tsx b/src/sections/governance/view/governance-details-view.tsx index 4ef3263fb..5922e5cd8 100644 --- a/src/sections/governance/view/governance-details-view.tsx +++ b/src/sections/governance/view/governance-details-view.tsx @@ -32,14 +32,11 @@ import { useRouter } from '@src/routes/hooks'; import { ProposalsMockList, proposalVotes as initialProposalVotes } from '../governance-mock'; import AvatarProfile from "@src/components/avatar/avatar.tsx"; import {dicebear} from "@src/utils/dicebear.ts"; +import Avatar from '@src/components/avatar/avatar.tsx'; // ---------------------------------------------------------------------- -type Props = { - title: string; -}; - -export default function GovernanceDetailsView({ title }: Props) { +export default function GovernanceDetailsView() { const post = ProposalsMockList[0]; const mdUp = useResponsive('up', 'md'); const router = useRouter(); diff --git a/src/sections/publication/view/publication-play-view.tsx b/src/sections/publication/view/publication-play-view.tsx index 6e67e7845..8b65bf5e3 100644 --- a/src/sections/publication/view/publication-play-view.tsx +++ b/src/sections/publication/view/publication-play-view.tsx @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies import { LoadingScreen } from '../../../components/loading-screen'; import VideoPlayer from '../../../components/video-player'; import Box from '@mui/material/Box'; diff --git a/src/workers/backgroundTaskWorker.ts b/src/workers/backgroundTaskWorker.ts index bd2ea58c3..255011225 100644 --- a/src/workers/backgroundTaskWorker.ts +++ b/src/workers/backgroundTaskWorker.ts @@ -5,6 +5,7 @@ export type CommentPayload = { pendingCommentId: string; }; +// eslint-disable-next-line no-restricted-globals self.onmessage = async (event: MessageEvent<{ type: string; payload: CommentPayload }>) => { const { type, payload } = event.data; @@ -16,9 +17,11 @@ self.onmessage = async (event: MessageEvent<{ type: string; payload: CommentPayl await verifyIpfsData(uri); // Send a success message to main thread + // eslint-disable-next-line no-restricted-globals self.postMessage({ success: true, pendingCommentId }); } catch (error) { // Send a error message to main thread + // eslint-disable-next-line no-restricted-globals self.postMessage({ success: false, error: (error as Error).message, pendingCommentId }); } }