Skip to content

Commit

Permalink
fix: eslint config and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramveeraghanta committed Jun 13, 2024
1 parent a72d095 commit b8ee986
Show file tree
Hide file tree
Showing 72 changed files with 152 additions and 180 deletions.
2 changes: 2 additions & 0 deletions packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
},
},
rules: {
"no-useless-escape": "off",
"prefer-const": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
Expand All @@ -36,6 +37,7 @@ module.exports = {
{
selector: ["function", "variable"],
format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
leadingUnderscore: "allow",
},
],
},
Expand Down
3 changes: 3 additions & 0 deletions web/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.next/*
out/*
public/*
2 changes: 0 additions & 2 deletions web/core/components/gantt-chart/sidebar/cycles/block.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { MutableRefObject } from "react";
import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// hooks
import { CycleGanttSidebarBlock } from "@/components/cycles";
import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants";
Expand Down
8 changes: 1 addition & 7 deletions web/core/components/gantt-chart/sidebar/cycles/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { MutableRefObject } from "react";
// ui
import { Loader } from "@plane/ui";
// components
Expand Down Expand Up @@ -43,12 +42,7 @@ export const CycleGanttSidebar: React.FC<Props> = (props) => {
isDragEnabled={enableReorder}
onDrop={handleOnDrop}
>
{(isDragging: boolean) => (
<CyclesSidebarBlock
block={block}
isDragging={isDragging}
/>
)}
{(isDragging: boolean) => <CyclesSidebarBlock block={block} isDragging={isDragging} />}
</GanttDnDHOC>
);
})
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/gantt-chart/sidebar/gantt-dnd-HOC.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { MutableRefObject, useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
Expand Down
2 changes: 0 additions & 2 deletions web/core/components/gantt-chart/sidebar/issues/block.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { MutableRefObject } from "react";
import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// components
import { MultipleSelectEntityAction } from "@/components/core";
import { useGanttChart } from "@/components/gantt-chart/hooks";
Expand Down
4 changes: 2 additions & 2 deletions web/core/components/gantt-chart/sidebar/issues/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { RefObject, MutableRefObject, useState } from "react";
import { RefObject, useState } from "react";
import { observer } from "mobx-react";
// ui
import { Loader } from "@plane/ui";
Expand Down Expand Up @@ -38,7 +38,7 @@ export const IssueGanttSidebar: React.FC<Props> = observer((props) => {
canLoadMoreBlocks,
ganttContainerRef,
showAllBlocks = false,
selectionHelpers
selectionHelpers,
} = props;

const [intersectionElement, setIntersectionElement] = useState<HTMLDivElement | null>(null);
Expand Down
2 changes: 0 additions & 2 deletions web/core/components/gantt-chart/sidebar/modules/block.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { MutableRefObject } from "react";
import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// hooks
import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants";
import { useGanttChart } from "@/components/gantt-chart/hooks";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { MutableRefObject } from "react";
// ui
import { Loader } from "@plane/ui";
// components
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/instance/not-ready-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { Button } from "@plane/ui";
// helpers
import { GOD_MODE_URL } from "@/helpers/common.helper";
// images
import PlaneTakeOffImage from "@/public/plane-takeoff.png";
// assets
import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg";
import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg";
import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png";
import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png";
import PlaneTakeOffImage from "@/public/plane-takeoff.png";

export const InstanceNotReady: FC = () => {
const { resolvedTheme } = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/integration/github/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {
// icons
// images
import { APP_INTEGRATIONS, IMPORTER_SERVICES_LIST, WORKSPACE_INTEGRATIONS } from "@/constants/fetch-keys";
import { IntegrationService, GithubIntegrationService } from "@/services/integrations";
import GithubLogo from "@/public/services/github.png";
import { IntegrationService, GithubIntegrationService } from "@/services/integrations";
// hooks
// components
// icons
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/integration/jira/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { IJiraImporterForm } from "@plane/types";
import { Button } from "@plane/ui";
import { IMPORTER_SERVICES_LIST } from "@/constants/fetch-keys";
// assets
import { JiraImporterService } from "@/services/integrations";
import JiraLogo from "@/public/services/jira.svg";
import { JiraImporterService } from "@/services/integrations";
// types
import {
JiraGetImportDetail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { useUser, useInstance } from "@/hooks/store";
import useIntegrationPopup from "@/hooks/use-integration-popup";
import { usePlatformOS } from "@/hooks/use-platform-os";
// services
import { IntegrationService } from "@/services/integrations";
// icons
import GithubLogo from "@/public/services/github.png";
import SlackLogo from "@/public/services/slack.png";
import { IntegrationService } from "@/services/integrations";

type Props = {
integration: IAppIntegration;
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/onboarding/invite-members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import { getUserRole } from "@/helpers/user.helper";
import { useEventTracker } from "@/hooks/store";
import useDynamicDropdownPosition from "@/hooks/use-dynamic-dropdown";
// services
import { WorkspaceService } from "@/services/workspace.service";
// assets
import InviteMembersDark from "@/public/onboarding/invite-members-dark.svg";
import InviteMembersLight from "@/public/onboarding/invite-members-light.svg";
import { WorkspaceService } from "@/services/workspace.service";
// components
import { OnboardingHeader } from "./header";
import { SwitchAccountDropdown } from "./switch-account-dropdown";
Expand Down
4 changes: 2 additions & 2 deletions web/core/components/onboarding/profile-setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import { getPasswordStrength } from "@/helpers/password.helper";
// hooks
import { useEventTracker, useUser, useUserProfile } from "@/hooks/store";
// services
import { AuthService } from "@/services/auth.service";
import { FileService } from "@/services/file.service";
// assets
import ProfileSetupDark from "@/public/onboarding/profile-setup-dark.svg";
import ProfileSetupLight from "@/public/onboarding/profile-setup-light.svg";
import UserPersonalizationDark from "@/public/onboarding/user-personalization-dark.svg";
import UserPersonalizationLight from "@/public/onboarding/user-personalization-light.svg";
import { AuthService } from "@/services/auth.service";
import { FileService } from "@/services/file.service";

type TProfileSetupFormValues = {
first_name: string;
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/profile/overview/activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { calculateTimeAgo } from "@/helpers/date-time.helper";
//hooks
// services
import { useUser } from "@/hooks/store";
import recentActivityEmptyState from "@/public/empty-state/recent_activity.svg";
import { UserService } from "@/services/user.service";
// assets
import recentActivityEmptyState from "@/public/empty-state/recent_activity.svg";

const userService = new UserService();

Expand Down
2 changes: 1 addition & 1 deletion web/core/components/project/integration-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { SelectRepository, SelectChannel } from "@/components/integration";
// constants
import { PROJECT_GITHUB_REPOSITORY } from "@/constants/fetch-keys";
// icons
import { ProjectService } from "@/services/project";
import GithubLogo from "@/public/logos/github-square.png";
import SlackLogo from "@/public/services/slack.png";
import { ProjectService } from "@/services/project";
// types

type Props = {
Expand Down
4 changes: 2 additions & 2 deletions web/core/components/workspace/settings/members-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CustomSelect, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
// components
import { ConfirmWorkspaceMemberRemove } from "@/components/workspace";
// constants
import { WORKSPACE_MEMBER_lEAVE } from "@/constants/event-tracker";
import { WORKSPACE_MEMBER_LEAVE } from "@/constants/event-tracker";
import { EUserWorkspaceRoles, ROLE } from "@/constants/workspace";
// hooks
import { useEventTracker, useMember, useUser } from "@/hooks/store";
Expand Down Expand Up @@ -48,7 +48,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {

await leaveWorkspace(workspaceSlug.toString())
.then(() => {
captureEvent(WORKSPACE_MEMBER_lEAVE, {
captureEvent(WORKSPACE_MEMBER_LEAVE, {
state: "SUCCESS",
element: "Workspace settings members page",
});
Expand Down
2 changes: 1 addition & 1 deletion web/core/constants/event-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const MEMBER_INVITED = "Member invited";
export const MEMBER_ACCEPTED = "Member accepted";
export const PROJECT_MEMBER_ADDED = "Project member added";
export const PROJECT_MEMBER_LEAVE = "Project member leave";
export const WORKSPACE_MEMBER_lEAVE = "Workspace member leave";
export const WORKSPACE_MEMBER_LEAVE = "Workspace member leave";
// Sign-in & Sign-up Events
export const NAVIGATE_TO_SIGNUP = "Navigate to sign-up page";
export const NAVIGATE_TO_SIGNIN = "Navigate to sign-in page";
Expand Down
2 changes: 1 addition & 1 deletion web/core/hooks/store/use-issues.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useContext } from "react";
import merge from "lodash/merge";
// mobx store
import { TIssueMap } from "@plane/types";
import { EIssuesStoreType } from "@/constants/issue";
import { StoreContext } from "@/lib/store-context";
// types
Expand All @@ -12,7 +13,6 @@ import { IProfileIssues, IProfileIssuesFilter } from "@/store/issue/profile";
import { IProjectIssues, IProjectIssuesFilter } from "@/store/issue/project";
import { IProjectViewIssues, IProjectViewIssuesFilter } from "@/store/issue/project-views";
import { IWorkspaceIssues, IWorkspaceIssuesFilter } from "@/store/issue/workspace";
import { TIssueMap } from "@plane/types";
// constants

type defaultIssueStore = {
Expand Down
2 changes: 1 addition & 1 deletion web/core/hooks/use-issue-layout-store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EIssuesStoreType } from "@/constants/issue";
import { createContext, useContext } from "react";
import { EIssuesStoreType } from "@/constants/issue";
import { useIssues } from "./store";

export const IssuesStoreContext = createContext<EIssuesStoreType>(EIssuesStoreType.PROJECT);
Expand Down
1 change: 1 addition & 0 deletions web/core/hooks/use-reload-confirmation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useCallback, useEffect, useState } from "react";
import { useRouter } from "next/navigation";

Expand Down
2 changes: 1 addition & 1 deletion web/core/hooks/use-user-notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const useUserNotification = (): any => {
}, false);
};

const mutateNotification = (notificationId: string, value: Object) => {
const mutateNotification = (notificationId: string, value: object) => {
notificationMutate((previousNotifications: any) => {
if (!previousNotifications) return previousNotifications;

Expand Down
6 changes: 3 additions & 3 deletions web/core/services/analytics.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// services
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import {
IAnalyticsParams,
IAnalyticsResponse,
IDefaultAnalyticsResponse,
IExportAnalyticsFormData,
ISaveAnalyticsFormData,
} from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
// helpers

export class AnalyticsService extends APIService {
Expand Down
6 changes: 3 additions & 3 deletions web/core/services/api_token.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { API_BASE_URL } from "@/helpers/common.helper";
import { IApiToken } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "./api.service";

export class APITokenService extends APIService {
Expand All @@ -15,7 +15,7 @@ export class APITokenService extends APIService {
});
}

async retrieveApiToken(workspaceSlug: string, tokenId: String): Promise<IApiToken> {
async retrieveApiToken(workspaceSlug: string, tokenId: string): Promise<IApiToken> {
return this.get(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`)
.then((response) => response?.data)
.catch((error) => {
Expand All @@ -31,7 +31,7 @@ export class APITokenService extends APIService {
});
}

async deleteApiToken(workspaceSlug: string, tokenId: String): Promise<IApiToken> {
async deleteApiToken(workspaceSlug: string, tokenId: string): Promise<IApiToken> {
return this.delete(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`)
.then((response) => response?.data)
.catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/cycle.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// services
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
// helpers

export class CycleService extends APIService {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/dashboard.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { THomeDashboardResponse, TWidget, TWidgetStatsResponse, TWidgetStatsRequestParams } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
import { THomeDashboardResponse, TWidget, TWidgetStatsResponse, TWidgetStatsRequestParams } from "@plane/types";

export class DashboardService extends APIService {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/integrations/github.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";

const integrationServiceType: string = "github";

Expand Down
2 changes: 1 addition & 1 deletion web/core/services/integrations/integration.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IAppIntegration, IImporterService, IWorkspaceIntegration, IExportServiceResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { IAppIntegration, IImporterService, IWorkspaceIntegration, IExportServiceResponse } from "@plane/types";
// helper

export class IntegrationService extends APIService {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/integrations/jira.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IJiraMetadata, IJiraResponse, IJiraImporterForm } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { IJiraMetadata, IJiraResponse, IJiraImporterForm } from "@plane/types";

export class JiraImporterService extends APIService {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions web/core/services/issue/issue_activity.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TIssueActivity } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { TIssueActivity } from "@plane/types";
// helper

export class IssueActivityService extends APIService {
Expand All @@ -17,7 +17,7 @@ export class IssueActivityService extends APIService {
| {
created_at__gt: string;
}
| {} = {}
| object = {}
): Promise<TIssueActivity[]> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, {
params: {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/issue/issue_archive.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TIssue } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { TIssue } from "@plane/types";
// constants

export class IssueArchiveService extends APIService {
Expand Down
4 changes: 2 additions & 2 deletions web/core/services/issue/issue_comment.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TIssueComment } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { TIssueComment } from "@plane/types";
// helper

export class IssueCommentService extends APIService {
Expand All @@ -17,7 +17,7 @@ export class IssueCommentService extends APIService {
| {
created_at__gt: string;
}
| {} = {}
| object = {}
): Promise<TIssueComment[]> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, {
params: {
Expand Down
2 changes: 1 addition & 1 deletion web/core/services/issue/issue_draft.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TIssue, TIssuesResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
import { TIssue, TIssuesResponse } from "@plane/types";

export class IssueDraftService extends APIService {
constructor() {
Expand Down
Loading

0 comments on commit b8ee986

Please sign in to comment.