[WEB-5134] refactor: update web ESLint configuration and refactor imports to use type imports (#7957)
* [WEB-5134] refactor: update `web` ESLint configuration and refactor imports to use type imports - Enhanced ESLint configuration by adding new rules for import consistency and type imports. - Refactored multiple files to replace regular imports with type imports for better clarity and performance. - Ensured consistent use of type imports across the application to align with TypeScript best practices. * refactor: standardize type imports across components - Updated multiple files to replace regular imports with type imports for improved clarity and consistency. - Ensured adherence to TypeScript best practices in the rich filters and issue layouts components.
This commit is contained in:
parent
4168127803
commit
9cfde896b3
1080 changed files with 2589 additions and 2082 deletions
|
|
@ -1,13 +1,15 @@
|
|||
"use client";
|
||||
|
||||
import { FC, Fragment, useMemo, useState } from "react";
|
||||
import type { FC } from "react";
|
||||
import { Fragment, useMemo, useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { AlertCircle, ChevronUp, ChevronDown } from "lucide-react";
|
||||
import { Disclosure, Transition } from "@headlessui/react";
|
||||
import { EEstimateSystem } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { EIssuesStoreType, TModulePlotType } from "@plane/types";
|
||||
import type { TModulePlotType } from "@plane/types";
|
||||
import { EIssuesStoreType } from "@plane/types";
|
||||
import { CustomSelect, Spinner } from "@plane/ui";
|
||||
// components
|
||||
// constants
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import type { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Tab } from "@headlessui/react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TWorkItemFilterCondition } from "@plane/shared-state";
|
||||
import { TModuleDistribution, TModuleEstimateDistribution, TModulePlotType } from "@plane/types";
|
||||
import type { TWorkItemFilterCondition } from "@plane/shared-state";
|
||||
import type { TModuleDistribution, TModuleEstimateDistribution, TModulePlotType } from "@plane/types";
|
||||
import { cn, toFilterArray } from "@plane/utils";
|
||||
// components
|
||||
import { AssigneeStatComponent, TAssigneeData } from "@/components/core/sidebar/progress-stats/assignee";
|
||||
import { LabelStatComponent, TLabelData } from "@/components/core/sidebar/progress-stats/label";
|
||||
import {
|
||||
createFilterUpdateHandler,
|
||||
PROGRESS_STATS,
|
||||
TSelectedFilterProgressStats,
|
||||
} from "@/components/core/sidebar/progress-stats/shared";
|
||||
import { StateGroupStatComponent, TStateGroupData } from "@/components/core/sidebar/progress-stats/state_group";
|
||||
import type { TAssigneeData } from "@/components/core/sidebar/progress-stats/assignee";
|
||||
import { AssigneeStatComponent } from "@/components/core/sidebar/progress-stats/assignee";
|
||||
import type { TLabelData } from "@/components/core/sidebar/progress-stats/label";
|
||||
import { LabelStatComponent } from "@/components/core/sidebar/progress-stats/label";
|
||||
import type { TSelectedFilterProgressStats } from "@/components/core/sidebar/progress-stats/shared";
|
||||
import { createFilterUpdateHandler, PROGRESS_STATS } from "@/components/core/sidebar/progress-stats/shared";
|
||||
import type { TStateGroupData } from "@/components/core/sidebar/progress-stats/state_group";
|
||||
import { StateGroupStatComponent } from "@/components/core/sidebar/progress-stats/state_group";
|
||||
// hooks
|
||||
import useLocalStorage from "@/hooks/use-local-storage";
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { ModuleStatusIcon, WorkItemsIcon } from "@plane/propel/icons";
|
||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||
import { ILinkDetails, IModule, ModuleLink } from "@plane/types";
|
||||
import type { ILinkDetails, IModule, ModuleLink } from "@plane/types";
|
||||
// plane ui
|
||||
import { Loader, CustomSelect, TextArea } from "@plane/ui";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { X } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TModuleDisplayFilters, TModuleFilters } from "@plane/types";
|
||||
import type { TModuleDisplayFilters, TModuleFilters } from "@plane/types";
|
||||
// components
|
||||
import { Header, EHeaderVariant, Tag } from "@plane/ui";
|
||||
import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { FC, useCallback, useRef, useState } from "react";
|
||||
import type { FC } from "react";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// icons
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useParams } from "next/navigation";
|
|||
import useSWR from "swr";
|
||||
// plane imports
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TModuleFilters } from "@plane/types";
|
||||
import type { TModuleFilters } from "@plane/types";
|
||||
// components
|
||||
import { calculateTotalFilters } from "@plane/utils";
|
||||
import { DetailedEmptyState } from "@/components/empty-state/detailed-empty-state-root";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { FC } from "react";
|
||||
import type { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import Image from "next/image";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import { useState } from "react";
|
|||
import { observer } from "mobx-react";
|
||||
import { Search, X } from "lucide-react";
|
||||
// plane imports
|
||||
import { TModuleStatus } from "@plane/propel/icons";
|
||||
import { TModuleDisplayFilters, TModuleFilters } from "@plane/types";
|
||||
import type { TModuleStatus } from "@plane/propel/icons";
|
||||
import type { TModuleDisplayFilters, TModuleFilters } from "@plane/types";
|
||||
// components
|
||||
import { FilterOption } from "@/components/issues/issue-layouts/filters";
|
||||
import { FilterLead, FilterMembers, FilterStartDate, FilterStatus, FilterTargetDate } from "@/components/modules";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { observer } from "mobx-react";
|
|||
import { MODULE_STATUS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { ModuleStatusIcon } from "@plane/propel/icons";
|
||||
import { TModuleStatus } from "@plane/types";
|
||||
import type { TModuleStatus } from "@plane/types";
|
||||
// components
|
||||
import { FilterHeader, FilterOption } from "@/components/issues/issue-layouts/filters";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { ArrowDownWideNarrow, ArrowUpWideNarrow, Check, ChevronDown } from "luci
|
|||
import { MODULE_ORDER_BY_OPTIONS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { getButtonStyling } from "@plane/propel/button";
|
||||
import { TModuleOrderByOptions } from "@plane/types";
|
||||
import type { TModuleOrderByOptions } from "@plane/types";
|
||||
// ui
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||
import { ETabIndices } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { Button } from "@plane/propel/button";
|
||||
import { IModule } from "@plane/types";
|
||||
import type { IModule } from "@plane/types";
|
||||
// ui
|
||||
import { Input, TextArea } from "@plane/ui";
|
||||
import { getDate, renderFormattedPayloadDate, getTabIndex } from "@plane/utils";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// PLane
|
||||
import { IBlockUpdateData, IBlockUpdateDependencyData, IModule } from "@plane/types";
|
||||
import type { IBlockUpdateData, IBlockUpdateDependencyData, IModule } from "@plane/types";
|
||||
// components
|
||||
import { GanttChartRoot, ModuleGanttSidebar } from "@/components/gantt-chart";
|
||||
import { ETimeLineTypeType, TimeLineTypeContext } from "@/components/gantt-chart/contexts";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useEffect } from "react";
|
||||
import type { FC } from "react";
|
||||
import { useEffect } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
// plane types
|
||||
import { Button } from "@plane/propel/button";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Copy, Pencil, Trash2 } from "lucide-react";
|
|||
import { MODULE_TRACKER_ELEMENTS } from "@plane/constants";
|
||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||
import { Tooltip } from "@plane/propel/tooltip";
|
||||
import { ILinkDetails } from "@plane/types";
|
||||
import type { ILinkDetails } from "@plane/types";
|
||||
// plane ui
|
||||
import { getIconForLink, copyTextToClipboard, calculateTimeAgo } from "@plane/utils";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { useCallback } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
// plane types
|
||||
import { ILinkDetails } from "@plane/types";
|
||||
import type { ILinkDetails } from "@plane/types";
|
||||
// components
|
||||
import { ModulesLinksListItem } from "@/components/modules";
|
||||
// hooks
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import React, { SyntheticEvent, useRef } from "react";
|
||||
import type { SyntheticEvent } from "react";
|
||||
import React, { useRef } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import Link from "next/link";
|
||||
import { useParams, usePathname, useSearchParams } from "next/navigation";
|
||||
|
|
@ -19,7 +20,7 @@ import { useLocalStorage } from "@plane/hooks";
|
|||
import { WorkItemsIcon } from "@plane/propel/icons";
|
||||
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/propel/toast";
|
||||
import { Tooltip } from "@plane/propel/tooltip";
|
||||
import { IModule } from "@plane/types";
|
||||
import type { IModule } from "@plane/types";
|
||||
import { Card, FavoriteStar, LinearProgressIndicator } from "@plane/ui";
|
||||
import { getDate, renderFormattedPayloadDate, generateQueryParams } from "@plane/utils";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from "react";
|
||||
import { GanttChartSquare, LayoutGrid, List } from "lucide-react";
|
||||
import { TModuleLayoutOptions } from "@plane/types";
|
||||
import type { TModuleLayoutOptions } from "@plane/types";
|
||||
import { cn } from "@plane/utils";
|
||||
|
||||
interface ILayoutIcon {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import React, { FC } from "react";
|
||||
import type { FC } from "react";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// icons
|
||||
|
|
@ -18,7 +19,7 @@ import { useLocalStorage } from "@plane/hooks";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/propel/toast";
|
||||
import { Tooltip } from "@plane/propel/tooltip";
|
||||
import { IModule } from "@plane/types";
|
||||
import type { IModule } from "@plane/types";
|
||||
// ui
|
||||
import { FavoriteStar } from "@plane/ui";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import React, { FC } from "react";
|
||||
import type { FC } from "react";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { MODULE_STATUS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { ModuleStatusIcon, TModuleStatus } from "@plane/propel/icons";
|
||||
import { IModule } from "@plane/types";
|
||||
import type { TModuleStatus } from "@plane/propel/icons";
|
||||
import { ModuleStatusIcon } from "@plane/propel/icons";
|
||||
import type { IModule } from "@plane/types";
|
||||
import { CustomSelect } from "@plane/ui";
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import React, { FC, useCallback, useEffect, useRef, useState } from "react";
|
||||
import type { FC } from "react";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { ListFilter, Search, X } from "lucide-react";
|
||||
|
|
@ -10,7 +11,7 @@ import { useOutsideClickDetector } from "@plane/hooks";
|
|||
// types
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { Tooltip } from "@plane/propel/tooltip";
|
||||
import { TModuleFilters } from "@plane/types";
|
||||
import type { TModuleFilters } from "@plane/types";
|
||||
// ui
|
||||
import { cn, calculateTotalFilters } from "@plane/utils";
|
||||
// plane utils
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import { useTranslation } from "@plane/i18n";
|
|||
// ui
|
||||
import { ArchiveIcon } from "@plane/propel/icons";
|
||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||
import { ContextMenu, CustomMenu, TContextMenuItem } from "@plane/ui";
|
||||
import type { TContextMenuItem } from "@plane/ui";
|
||||
import { ContextMenu, CustomMenu } from "@plane/ui";
|
||||
import { copyUrlToClipboard, cn } from "@plane/utils";
|
||||
// components
|
||||
import { ArchiveModuleModal, CreateUpdateModuleModal, DeleteModuleModal } from "@/components/modules";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
import React from "react";
|
||||
|
||||
// react hook form
|
||||
import { Controller, FieldError, Control } from "react-hook-form";
|
||||
import type { FieldError, Control } from "react-hook-form";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { MODULE_STATUS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { DoubleCircleIcon, ModuleStatusIcon } from "@plane/propel/icons";
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
// react
|
||||
import React from "react";
|
||||
// react-hook-form
|
||||
import { Control, Controller, UseFormWatch } from "react-hook-form";
|
||||
import type { Control, UseFormWatch } from "react-hook-form";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { MODULE_STATUS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { DoubleCircleIcon } from "@plane/propel/icons";
|
||||
import { IModule } from "@plane/types";
|
||||
import type { IModule } from "@plane/types";
|
||||
// ui
|
||||
import { CustomSelect } from "@plane/ui";
|
||||
// types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue