Skip to content

Commit

Permalink
fix: eslint fixes and file formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramveeraghanta committed Mar 19, 2024
1 parent 473dfc7 commit 53ddef1
Show file tree
Hide file tree
Showing 954 changed files with 3,786 additions and 3,674 deletions.
2 changes: 1 addition & 1 deletion packages/types/src/project/projects.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EUserProjectRoles } from "constants/project";
import { EUserProjectRoles } from "@/constants/project";
import type {
IProjectViewProps,
IUser,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/workspace.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EUserWorkspaceRoles } from "constants/workspace";
import { EUserWorkspaceRoles } from "@/constants/workspace";
import type {
IProjectMember,
IUser,
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export const Tooltip: React.FC<ITooltipProps> = ({
hoverCloseDelay={closeDelay}
content={
<div
className={`relative ${isMobile ? "hidden" : "block"} z-50 max-w-xs gap-1 overflow-hidden break-words rounded-md bg-custom-background-100 p-2 text-xs text-custom-text-200 shadow-md ${className}`}
className={`relative ${
isMobile ? "hidden" : "block"
} z-50 max-w-xs gap-1 overflow-hidden break-words rounded-md bg-custom-background-100 p-2 text-xs text-custom-text-200 shadow-md ${className}`}
>
{tooltipHeading && <h5 className="font-medium text-custom-text-100">{tooltipHeading}</h5>}
{tooltipContent}
Expand Down
48 changes: 48 additions & 0 deletions space/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,52 @@
module.exports = {
root: true,
extends: ["custom"],
parser: "@typescript-eslint/parser",
settings: {
"import/resolver": {
typescript: {},
node: {
moduleDirectory: ["node_modules", "."],
},
},
},
rules: {
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling",],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "lucide-react",
group: "external",
position: "after",
},
{
pattern: "@headlessui/**",
group: "external",
position: "after",
},
{
pattern: "@plane/**",
group: "external",
position: "after",
},
{
pattern: "@/**",
group: "internal",
}
],
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
};
2 changes: 1 addition & 1 deletion space/components/accounts/github-sign-in.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState, FC } from "react";
import Link from "next/link";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
// next-themes
import { useTheme } from "next-themes";
Expand Down
12 changes: 6 additions & 6 deletions space/components/accounts/onboarding-form.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useEffect, Fragment } from "react";
import { useRouter } from "next/router";
import { observer } from "mobx-react-lite";
import { useRouter } from "next/router";
import { Controller, useForm } from "react-hook-form";
import { Listbox, Transition } from "@headlessui/react";
import { Check, ChevronDown } from "lucide-react";
import { Listbox, Transition } from "@headlessui/react";
// mobx store
import { useMobxStore } from "lib/mobx/store-provider";
import { Button, Input } from "@plane/ui";
import { USER_ROLES } from "@/constants/workspace";
import { useMobxStore } from "@/lib/mobx/store-provider";
// constants
import { USER_ROLES } from "constants/workspace";
// hooks
import { UserService } from "@/services/user.service";
import useToast from "hooks/use-toast";
// services
import { UserService } from "services/user.service";
// ui
import { Button, Input } from "@plane/ui";

const defaultValues = {
first_name: "",
Expand Down
8 changes: 4 additions & 4 deletions space/components/accounts/sign-in-forms/create-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { useEffect } from "react";
import Link from "next/link";
import { Controller, useForm } from "react-hook-form";
// services
import { AuthService } from "services/authentication.service";
import { Button, Input } from "@plane/ui";
import { ESignInSteps } from "@/components/accounts";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// constants
import { ESignInSteps } from "components/accounts";

type Props = {
email: string;
Expand Down
8 changes: 4 additions & 4 deletions space/components/accounts/sign-in-forms/email-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import React, { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { XCircle } from "lucide-react";
// services
import { AuthService } from "services/authentication.service";
import { Button, Input } from "@plane/ui";
import { ESignInSteps } from "@/components/accounts";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// types
import { IEmailCheckData } from "types/auth";
// constants
import { ESignInSteps } from "components/accounts";

type Props = {
handleStepChange: (step: ESignInSteps) => void;
Expand Down
8 changes: 4 additions & 4 deletions space/components/accounts/sign-in-forms/o-auth-options.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { observer } from "mobx-react-lite";
import useSWR from "swr";

import { observer } from "mobx-react-lite";
// services
import { AuthService } from "services/authentication.service";
import { AppConfigService } from "services/app-config.service";
import { GitHubSignInButton, GoogleSignInButton } from "@/components/accounts";
import { AppConfigService } from "@/services/app-config.service";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// components
import { GitHubSignInButton, GoogleSignInButton } from "components/accounts";

type Props = {
handleSignInRedirection: () => Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Controller, useForm } from "react-hook-form";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
import { ESignInSteps } from "@/components/accounts";
import { checkEmailValidity } from "@/helpers/string.helper";
// constants
import { ESignInSteps } from "components/accounts";

type Props = {
email: string;
Expand Down
8 changes: 4 additions & 4 deletions space/components/accounts/sign-in-forms/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import Link from "next/link";
import { Controller, useForm } from "react-hook-form";
import { XCircle } from "lucide-react";
// services
import { AuthService } from "services/authentication.service";
import { Button, Input } from "@plane/ui";
import { ESignInSteps } from "@/components/accounts";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// types
import { IPasswordSignInData } from "types/auth";
// constants
import { ESignInSteps } from "components/accounts";

type Props = {
email: string;
Expand Down
12 changes: 6 additions & 6 deletions space/components/accounts/sign-in-forms/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import React, { useState } from "react";
import { observer } from "mobx-react-lite";
import useSWR from "swr";
// hooks
import useSignInRedirection from "hooks/use-sign-in-redirection";
// services
import { AppConfigService } from "services/app-config.service";
// components
import { LatestFeatureBlock } from "components/common";
import {
EmailForm,
UniqueCodeForm,
Expand All @@ -16,7 +11,12 @@ import {
OptionalSetPasswordForm,
CreatePasswordForm,
SelfHostedSignInForm,
} from "components/accounts";
} from "@/components/accounts";
import { LatestFeatureBlock } from "@/components/common";
import { AppConfigService } from "@/services/app-config.service";
import useSignInRedirection from "hooks/use-sign-in-redirection";
// services
// components

export enum ESignInSteps {
EMAIL = "EMAIL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Link from "next/link";
import { Controller, useForm } from "react-hook-form";
import { XCircle } from "lucide-react";
// services
import { AuthService } from "services/authentication.service";
import { Button, Input } from "@plane/ui";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// types
import { IPasswordSignInData } from "types/auth";

Expand Down
6 changes: 3 additions & 3 deletions space/components/accounts/sign-in-forms/set-password-link.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { Controller, useForm } from "react-hook-form";
// services
import { AuthService } from "services/authentication.service";
import { Button, Input } from "@plane/ui";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
// hooks
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// types
import { IEmailCheckData } from "types/auth";

Expand Down
12 changes: 6 additions & 6 deletions space/components/accounts/sign-in-forms/unique-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import Link from "next/link";
import { Controller, useForm } from "react-hook-form";
import { CornerDownLeft, XCircle } from "lucide-react";
// services
import { AuthService } from "services/authentication.service";
import { UserService } from "services/user.service";
import { Button, Input } from "@plane/ui";
import { ESignInSteps } from "@/components/accounts";
import { checkEmailValidity } from "@/helpers/string.helper";
import { AuthService } from "@/services/authentication.service";
import { UserService } from "@/services/user.service";
// hooks
import useToast from "hooks/use-toast";
import useTimer from "hooks/use-timer";
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "helpers/string.helper";
// types
import { IEmailCheckData, IMagicSignInData } from "types/auth";
// constants
import { ESignInSteps } from "components/accounts";

type Props = {
email: string;
Expand Down
4 changes: 2 additions & 2 deletions space/components/accounts/user-logged-in.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Image from "next/image";

// mobx
import { useMobxStore } from "lib/mobx/store-provider";
import { useMobxStore } from "@/lib/mobx/store-provider";
// assets
import UserLoggedInImage from "public/user-logged-in.svg";
import PlaneLogo from "public/plane-logos/black-horizontal-with-blue-logo.svg";
import UserLoggedInImage from "public/user-logged-in.svg";

export const UserLoggedIn = () => {
const { user: userStore } = useMobxStore();
Expand Down
4 changes: 2 additions & 2 deletions space/components/common/project-logo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// helpers
import { cn } from "helpers/common.helper";
// types
import { TProjectLogoProps } from "@plane/types";
import { cn } from "@/helpers/common.helper";
// types

type Props = {
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion space/components/issues/board-views/block-due-date.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

// helpers
import { renderFullDate } from "helpers/date-time.helper";
import { renderFullDate } from "@/helpers/date-time.helper";

export const dueDateIconDetails = (
date: string,
Expand Down
2 changes: 1 addition & 1 deletion space/components/issues/board-views/block-priority.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

// types
import { issuePriorityFilter } from "@/constants/data";
import { TIssuePriorityKey } from "types/issue";
// constants
import { issuePriorityFilter } from "constants/data";

export const IssueBlockPriority = ({ priority }: { priority: TIssuePriorityKey | null }) => {
const priority_detail = priority != null ? issuePriorityFilter(priority) : null;
Expand Down
2 changes: 1 addition & 1 deletion space/components/issues/board-views/block-state.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ui
import { StateGroupIcon } from "@plane/ui";
// constants
import { issueGroupFilter } from "constants/data";
import { issueGroupFilter } from "@/constants/data";

export const IssueBlockState = ({ state }: any) => {
const stateGroup = issueGroupFilter(state.group);
Expand Down
12 changes: 6 additions & 6 deletions space/components/issues/board-views/kanban/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

// mobx react lite
import { observer } from "mobx-react-lite";
import { useMobxStore } from "lib/mobx/store-provider";
import { useRouter } from "next/router";
import { IssueBlockDueDate } from "@/components/issues/board-views/block-due-date";
import { IssueBlockPriority } from "@/components/issues/board-views/block-priority";
import { IssueBlockState } from "@/components/issues/board-views/block-state";
import { useMobxStore } from "@/lib/mobx/store-provider";

// components
import { IssueBlockPriority } from "components/issues/board-views/block-priority";
import { IssueBlockState } from "components/issues/board-views/block-state";
import { IssueBlockDueDate } from "components/issues/board-views/block-due-date";
// interfaces
import { RootStore } from "@/store/root";
import { IIssue } from "types/issue";
import { RootStore } from "store/root";
import { useRouter } from "next/router";

export const IssueKanBanBlock = observer(({ issue }: { issue: IIssue }) => {
const { project: projectStore, issueDetails: issueDetailStore }: RootStore = useMobxStore();
Expand Down
10 changes: 5 additions & 5 deletions space/components/issues/board-views/kanban/header.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// mobx react lite
import { observer } from "mobx-react-lite";
// interfaces
import { IIssueState } from "types/issue";
// constants
import { issueGroupFilter } from "constants/data";
// ui
import { StateGroupIcon } from "@plane/ui";
import { issueGroupFilter } from "@/constants/data";
// ui
// mobx hook
import { useMobxStore } from "lib/mobx/store-provider";
import { RootStore } from "store/root";
import { useMobxStore } from "@/lib/mobx/store-provider";
import { RootStore } from "@/store/root";
import { IIssueState } from "types/issue";

export const IssueKanBanHeader = observer(({ state }: { state: IIssueState }) => {
const store: RootStore = useMobxStore();
Expand Down
Loading

0 comments on commit 53ddef1

Please sign in to comment.