Skip to content

chore: sort imports in our typescript code #12417

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

Merged
merged 13 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
aslilac committed Mar 4, 2024
commit 79dcc2d693a6960f20947bb3cb3c5de54ea94e3f
9 changes: 3 additions & 6 deletions site/e2e/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import axios from "axios";
import type { ChildProcess} from "child_process";
import type { ChildProcess } from "child_process";
import { exec, spawn } from "child_process";
import { randomUUID } from "crypto";
import express from "express";
Expand All @@ -22,12 +22,9 @@ import type {
PlanComplete,
ApplyComplete,
Resource,
RichParameter} from "./provisionerGenerated";
import {
Agent,
AppSharingLevel,
Response
RichParameter,
} from "./provisionerGenerated";
import { Agent, AppSharingLevel, Response } from "./provisionerGenerated";

// createWorkspace creates a workspace for a template.
// It does not wait for it to be running, but it does navigate to the page.
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/ActiveUserChart/ActiveUserChart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useTheme } from "@emotion/react";
import type {
ChartOptions} from "chart.js";
import type { ChartOptions } from "chart.js";
import {
CategoryScale,
Chart as ChartJS,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Alert/ErrorAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AlertTitle from "@mui/material/AlertTitle";
import type { FC } from "react";
import { getErrorMessage, getErrorDetail } from "api/errors";
import type { AlertProps} from "./Alert";
import type { AlertProps } from "./Alert";
import { Alert, AlertDetail } from "./Alert";

export const ErrorAlert: FC<
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Filter/UserFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getUsers } from "api/api";
import { useMe } from "contexts/auth/useMe";
import { UserAvatar } from "../UserAvatar/UserAvatar";
import { FilterSearchMenu, OptionItem } from "./filter";
import type { UseFilterMenuOptions} from "./menu";
import type { UseFilterMenuOptions } from "./menu";
import { useFilterMenu } from "./menu";
import type { BaseOption } from "./options";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/FullPageLayout/Topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
cloneElement,
forwardRef,
} from "react";
import type { AvatarProps} from "components/Avatar/Avatar";
import type { AvatarProps } from "components/Avatar/Avatar";
import { ExternalAvatar } from "components/Avatar/Avatar";

export const Topbar: FC<HTMLAttributes<HTMLElement>> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { EnterpriseSnackbar } from "./EnterpriseSnackbar";


const meta: Meta<typeof EnterpriseSnackbar> = {
title: "components/EnterpriseSnackbar",
component: EnterpriseSnackbar,
Expand Down
4 changes: 1 addition & 3 deletions site/src/components/GlobalSnackbar/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type {
NotificationMsg,
NotificationTextPrefixed} from "./utils";
import type { NotificationMsg, NotificationTextPrefixed } from "./utils";
import {
displayError,
displaySuccess,
Expand Down
7 changes: 2 additions & 5 deletions site/src/components/MoreMenu/MoreMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import type { MenuProps } from "@mui/material/Menu";
import Menu from "@mui/material/Menu";
import type { MenuItemProps } from "@mui/material/MenuItem";
import MenuItem from "@mui/material/MenuItem";
import type {
ReactNode,
HTMLProps,
ReactElement} from "react";
import type { ReactNode, HTMLProps, ReactElement } from "react";
import {
useRef,
useState,
createContext,
useContext,
cloneElement,
forwardRef
forwardRef,
} from "react";

type MoreMenuContextValue = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { renderWithAuth } from "testHelpers/renderHelpers";
import type {
PaginationWidgetBaseProps} from "./PaginationWidgetBase";
import {
PaginationWidgetBase
} from "./PaginationWidgetBase";
import type { PaginationWidgetBaseProps } from "./PaginationWidgetBase";
import { PaginationWidgetBase } from "./PaginationWidgetBase";

type SampleProps = Omit<PaginationWidgetBaseProps, "onPageChange">;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import { ExternalImage } from "components/ExternalImage/ExternalImage";
import { MemoizedMarkdown } from "components/Markdown/Markdown";
import { Pill } from "components/Pill/Pill";
import { Stack } from "components/Stack/Stack";
import type { AutofillBuildParameter, AutofillSource } from "utils/richParameters";
import type {
AutofillBuildParameter,
AutofillSource,
} from "utils/richParameters";
import { MultiTextField } from "./MultiTextField";

const isBoolean = (parameter: TemplateVersionParameter) => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/contexts/ProxyContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useQuery } from "react-query";
import { getWorkspaceProxies, getWorkspaceProxyRegions } from "api/api";
import type { Region, WorkspaceProxy } from "api/typesGenerated";
import { usePermissions } from "contexts/auth/usePermissions";
import type { ProxyLatencyReport} from "./useProxyLatency";
import type { ProxyLatencyReport } from "./useProxyLatency";
import { useProxyLatency } from "./useProxyLatency";

export interface ProxyContextValue {
Expand Down
1 change: 0 additions & 1 deletion site/src/hooks/useClickable.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import {
Expand Down
10 changes: 2 additions & 8 deletions site/src/modules/resources/AgentLogs.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import type { Interpolation, Theme } from "@emotion/react";
import Tooltip from "@mui/material/Tooltip";
import type {
ComponentProps} from "react";
import {
forwardRef,
useEffect,
useMemo,
useState,
} from "react";
import type { ComponentProps } from "react";
import { forwardRef, useEffect, useMemo, useState } from "react";
import { FixedSizeList as List } from "react-window";
import * as API from "api/api";
import type { WorkspaceAgentLogSource } from "api/typesGenerated";
Expand Down
7 changes: 2 additions & 5 deletions site/src/modules/resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ import type {
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import { Stack } from "components/Stack/Stack";
import { useProxy } from "contexts/ProxyContext";
import type {
Line} from "modules/workspaces/WorkspaceBuildLogs/Logs";
import {
logLineHeight,
} from "modules/workspaces/WorkspaceBuildLogs/Logs";
import type { Line } from "modules/workspaces/WorkspaceBuildLogs/Logs";
import { logLineHeight } from "modules/workspaces/WorkspaceBuildLogs/Logs";
import { AgentLatency } from "./AgentLatency";
import { AgentLogs, useAgentLogs } from "./AgentLogs";
import { AgentMetadata } from "./AgentMetadata";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Interpolation, Theme} from "@emotion/react";
import type { Interpolation, Theme } from "@emotion/react";
import { useTheme } from "@emotion/react";
import Skeleton from "@mui/material/Skeleton";
import type { WorkspaceBuild } from "api/typesGenerated";
Expand Down
9 changes: 4 additions & 5 deletions site/src/pages/AuditPage/AuditFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import capitalize from "lodash/capitalize";
import { type FC } from "react";
import { AuditActions, ResourceTypes } from "api/typesGenerated";
import type {
useFilter} from "components/Filter/filter";
import type { useFilter } from "components/Filter/filter";
import {
Filter,
FilterMenu,
MenuSkeleton,
OptionItem,
SearchFieldSkeleton
SearchFieldSkeleton,
} from "components/Filter/filter";
import type { UseFilterMenuOptions} from "components/Filter/menu";
import type { UseFilterMenuOptions } from "components/Filter/menu";
import { useFilterMenu } from "components/Filter/menu";
import type { BaseOption } from "components/Filter/options";
import type { UserFilterMenu} from "components/Filter/UserFilter";
import type { UserFilterMenu } from "components/Filter/UserFilter";
import { UserMenu } from "components/Filter/UserFilter";
import { docs } from "utils/docs";

Expand Down
1 change: 0 additions & 1 deletion site/src/pages/AuditPage/AuditPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { chromaticWithTablet } from "testHelpers/chromatic";
import { MockAuditLog, MockAuditLog2, MockUser } from "testHelpers/entities";
import { AuditPageView } from "./AuditPageView";


type FilterProps = ComponentProps<typeof AuditPageView>["filterProps"];

const defaultFilterProps = getDefaultFilterProps<FilterProps>({
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from "@mui/material/Button";
import Drawer from "@mui/material/Drawer";
import IconButton from "@mui/material/IconButton";
import { visuallyHidden } from "@mui/utils";
import type { FC} from "react";
import type { FC } from "react";
import { useLayoutEffect, useRef } from "react";
import { JobError } from "api/queries/templates";
import type { TemplateVersion } from "api/typesGenerated";
Expand Down
3 changes: 1 addition & 2 deletions site/src/pages/CreateTokenPage/utils.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {
LifetimeDay} from "./utils";
import type { LifetimeDay } from "./utils";
import {
filterByMaxTokenLifetime,
determineDefaultLtValue,
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateUserPage/CreateUserForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from "@mui/material/Link";
import MenuItem from "@mui/material/MenuItem";
import TextField from "@mui/material/TextField";
import type { FormikContextType} from "formik";
import type { FormikContextType } from "formik";
import { useFormik } from "formik";
import type { FC } from "react";
import * as Yup from "yup";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { pageTitle } from "utils/page";
import type { AutofillBuildParameter } from "utils/richParameters";
import { paramsUsedToCreateWorkspace } from "utils/workspace";
import { CreateWorkspacePageView } from "./CreateWorkspacePageView";
import type { CreateWSPermissions} from "./permissions";
import type { CreateWSPermissions } from "./permissions";
import { createWorkspaceChecks } from "./permissions";

export const createWorkspaceModes = ["form", "auto", "duplicate"] as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Interpolation, type Theme } from "@emotion/react";
import Button from "@mui/material/Button";
import FormHelperText from "@mui/material/FormHelperText";
import TextField from "@mui/material/TextField";
import type { FormikContextType} from "formik";
import type { FormikContextType } from "formik";
import { useFormik } from "formik";
import { type FC, useEffect, useState, useMemo, useCallback } from "react";
import { useSearchParams } from "react-router-dom";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FC} from "react";
import type { FC } from "react";
import { useEffect } from "react";
import { Helmet } from "react-helmet-async";
import { useMutation, useQuery, useQueryClient } from "react-query";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FC} from "react";
import type { FC } from "react";
import { useState } from "react";
import { Helmet } from "react-helmet-async";
import { useMutation, useQuery, useQueryClient } from "react-query";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { Meta, StoryFn } from "@storybook/react";
import type {
ExternalAuthPageViewProps,
} from "./ExternalAuthPageView";
import type { ExternalAuthPageViewProps } from "./ExternalAuthPageView";
import ExternalAuthPageView from "./ExternalAuthPageView";

export default {
Expand Down
10 changes: 2 additions & 8 deletions site/src/pages/HealthPage/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ import CheckCircleOutlined from "@mui/icons-material/CheckCircleOutlined";
import DoNotDisturbOnOutlined from "@mui/icons-material/DoNotDisturbOnOutlined";
import ErrorOutline from "@mui/icons-material/ErrorOutline";
import Link from "@mui/material/Link";
import type {
ComponentProps,
HTMLAttributes,
ReactElement} from "react";
import {
cloneElement,
forwardRef,
} from "react";
import type { ComponentProps, HTMLAttributes, ReactElement } from "react";
import { cloneElement, forwardRef } from "react";
import type { HealthMessage, HealthSeverity } from "api/typesGenerated";
import { docs } from "utils/docs";
import { healthyColor } from "./healthyColor";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/HealthPage/DERPRegionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Interpolation, Theme} from "@emotion/react";
import type { Interpolation, Theme } from "@emotion/react";
import { useTheme } from "@emotion/react";
import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined";
import CodeOutlined from "@mui/icons-material/CodeOutlined";
Expand Down
5 changes: 2 additions & 3 deletions site/src/pages/HealthPage/storybook.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Meta } from "@storybook/react";
import type {
RouteDefinition} from "storybook-addon-react-router-v6";
import type { RouteDefinition } from "storybook-addon-react-router-v6";
import {
reactRouterParameters,
reactRouterOutlet
reactRouterOutlet,
} from "storybook-addon-react-router-v6";
import { HEALTH_QUERY_KEY, HEALTH_QUERY_SETTINGS_KEY } from "api/queries/debug";
import { chromatic } from "testHelpers/chromatic";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { chromatic } from "testHelpers/chromatic";
import { mockApiError, MockTemplateExample } from "testHelpers/entities";
import { StarterTemplatePageView } from "./StarterTemplatePageView";


const meta: Meta<typeof StarterTemplatePageView> = {
title: "pages/StarterTemplatePage",
parameters: { chromatic },
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/TemplatePage/TemplatePageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import AddIcon from "@mui/icons-material/AddOutlined";
import DeleteIcon from "@mui/icons-material/DeleteOutlined";
import EditIcon from "@mui/icons-material/EditOutlined";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ import { PageHeader, PageHeaderTitle } from "components/PageHeader/PageHeader";
import { Stack } from "components/Stack/Stack";
import { TableLoader } from "components/TableLoader/TableLoader";
import { getGroupSubtitle } from "utils/groups";
import type {
UserOrGroupAutocompleteValue} from "./UserOrGroupAutocomplete";
import {
UserOrGroupAutocomplete
} from "./UserOrGroupAutocomplete";
import type { UserOrGroupAutocompleteValue } from "./UserOrGroupAutocomplete";
import { UserOrGroupAutocomplete } from "./UserOrGroupAutocomplete";

type AddTemplateUserOrGroupProps = {
organizationId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
renderWithTemplateSettingsLayout,
waitForLoaderToBeRemoved,
} from "testHelpers/renderHelpers";
import type { TemplateScheduleFormValues} from "./formHelpers";
import type { TemplateScheduleFormValues } from "./formHelpers";
import { getValidationSchema } from "./formHelpers";
import TemplateSchedulePage from "./TemplateSchedulePage";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import FormControlLabel from "@mui/material/FormControlLabel";
import Radio from "@mui/material/Radio";
import RadioGroup from "@mui/material/RadioGroup";
import TextField from "@mui/material/TextField";
import type { FC} from "react";
import type { FC } from "react";
import { useState } from "react";
import type { TemplateVersionVariable } from "api/typesGenerated";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FormikContextType, FormikTouched} from "formik";
import type { FormikContextType, FormikTouched } from "formik";
import { useFormik } from "formik";
import type { FC } from "react";
import * as Yup from "yup";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ import { TemplateResourcesTable } from "modules/templates/TemplateResourcesTable
import { WorkspaceBuildLogs } from "modules/workspaces/WorkspaceBuildLogs/WorkspaceBuildLogs";
import type { PublishVersionData } from "pages/TemplateVersionEditorPage/types";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
import type {
FileTree} from "utils/filetree";
import type { FileTree } from "utils/filetree";
import {
createFile,
existsFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { displayError } from "components/GlobalSnackbar/utils";
import { FullScreenLoader } from "components/Loader/FullScreenLoader";
import { useOrganizationId } from "contexts/auth/useOrganizationId";
import { useWatchVersionLogs } from "modules/templates/useWatchVersionLogs";
import type { FileTree} from "utils/filetree";
import type { FileTree } from "utils/filetree";
import { traverse } from "utils/filetree";
import { pageTitle } from "utils/page";
import { TarReader, TarWriter } from "utils/tar";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import {
MockTemplateVersion,
MockTemplateVersionWithMarkdownMessage,
} from "testHelpers/entities";
import type {
TemplateVersionPageViewProps} from "./TemplateVersionPageView";
import {
TemplateVersionPageView
TemplateVersionPageView,
type TemplateVersionPageViewProps,
} from "./TemplateVersionPageView";

const readmeContent = `---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import LoadingButton from "@mui/lab/LoadingButton";
import TextField from "@mui/material/TextField";
import type { FormikTouched} from "formik";
import type { FormikTouched } from "formik";
import { useFormik } from "formik";
import type { FC } from "react";
import * as Yup from "yup";
Expand Down
Loading