style: run biome lint

This commit is contained in:
Aarnav Tale 2024-12-31 10:31:50 +05:30
parent aa9872a45b
commit f3c9d8b54c
No known key found for this signature in database
39 changed files with 57 additions and 57 deletions

View File

@ -1,4 +1,4 @@
import { Dispatch, SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import { Button as AriaButton } from 'react-aria-components';
import { cn } from '~/utils/cn';

View File

@ -1,4 +1,4 @@
import { HTMLProps } from 'react';
import type { HTMLProps } from 'react';
import { Heading as AriaHeading } from 'react-aria-components';
import { cn } from '~/utils/cn';

View File

@ -1,4 +1,4 @@
import { useState, HTMLProps } from 'react';
import { useState, type HTMLProps } from 'react';
import { CopyIcon, CheckIcon } from '@primer/octicons-react';
import { cn } from '~/utils/cn';
import { toast } from '~/components/Toaster';

View File

@ -1,4 +1,4 @@
import { Dispatch, ReactNode, SetStateAction } from 'react';
import type { Dispatch, ReactNode, SetStateAction } from 'react';
import {
Button as AriaButton,
Dialog as AriaDialog,

View File

@ -10,8 +10,8 @@ import {
import { Form } from 'react-router';
import { cn } from '~/utils/cn';
import { HeadplaneContext } from '~/utils/config/headplane';
import { SessionData } from '~/utils/sessions';
import type { HeadplaneContext } from '~/utils/config/headplane';
import type { SessionData } from '~/utils/sessions';
import Menu from './Menu';
import TabLink from './TabLink';

View File

@ -1,4 +1,4 @@
import { Dispatch, ReactNode, SetStateAction } from 'react';
import type { Dispatch, ReactNode, SetStateAction } from 'react';
import {
Button as AriaButton,
Menu as AriaMenu,

View File

@ -1,5 +1,5 @@
import { PlusIcon, DashIcon } from '@primer/octicons-react';
import { Dispatch, SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import {
Button,
Group,

View File

@ -1,5 +1,5 @@
import { ChevronDownIcon } from '@primer/octicons-react';
import { Dispatch, ReactNode, SetStateAction } from 'react';
import type { Dispatch, ReactNode, SetStateAction } from 'react';
import {
Button,
ListBox,

View File

@ -1,5 +1,5 @@
import clsx from 'clsx';
import { HTMLProps } from 'react';
import type { HTMLProps } from 'react';
type Props = HTMLProps<SVGElement> & {
readonly isOnline: boolean;

View File

@ -1,5 +1,5 @@
import clsx from 'clsx';
import { HTMLProps } from 'react';
import type { HTMLProps } from 'react';
function TableList(props: HTMLProps<HTMLDivElement>) {
return (

View File

@ -1,4 +1,4 @@
import { Dispatch, SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import { Input, TextField as AriaTextField } from 'react-aria-components';
import { cn } from '~/utils/cn';

View File

@ -1,7 +1,7 @@
import { XIcon } from '@primer/octicons-react';
import { AriaToastProps, useToast, useToastRegion } from '@react-aria/toast';
import { ToastQueue, ToastState, useToastQueue } from '@react-stately/toast';
import { ReactNode, useRef } from 'react';
import { type AriaToastProps, useToast, useToastRegion } from '@react-aria/toast';
import { ToastQueue, type ToastState, useToastQueue } from '@react-stately/toast';
import { type ReactNode, useRef } from 'react';
import { Button } from 'react-aria-components';
import { createPortal } from 'react-dom';
import { ClientOnly } from 'remix-utils/client-only';

View File

@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';
import {
Button as AriaButton,
Tooltip as AriaTooltip,

View File

@ -1,7 +1,7 @@
import log from '~/utils/log';
import dockerIntegration from './docker';
import { IntegrationFactory } from './integration';
import type { IntegrationFactory } from './integration';
import kubernetesIntegration from './kubernetes';
import procIntegration from './proc';

View File

@ -1,4 +1,4 @@
import { LoaderFunctionArgs, redirect } from 'react-router';
import { type LoaderFunctionArgs, redirect } from 'react-router';
import { Outlet, useLoaderData, useNavigation } from 'react-router';
import { ProgressBar } from 'react-aria-components';

View File

@ -4,7 +4,7 @@ import {
IssueDraftIcon,
PencilIcon,
} from '@primer/octicons-react';
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import { useLoaderData, useRevalidator } from 'react-router';
import { useDebounceFetcher } from 'remix-utils/use-debounce-fetcher';
import { useEffect, useState, useMemo } from 'react';

View File

@ -1,4 +1,4 @@
import { ActionFunctionArgs, LoaderFunctionArgs, redirect } from 'react-router';
import { type ActionFunctionArgs, type LoaderFunctionArgs, redirect } from 'react-router';
import { Form, useActionData, useLoaderData } from 'react-router';
import { useMemo } from 'react';
@ -6,7 +6,7 @@ import Button from '~/components/Button';
import Card from '~/components/Card';
import Code from '~/components/Code';
import TextField from '~/components/TextField';
import { Key } from '~/types';
import type { Key } from '~/types';
import { loadContext } from '~/utils/config/headplane';
import { pull } from '~/utils/headscale';
import { startOidc } from '~/utils/oidc';

View File

@ -1,4 +1,4 @@
import { ActionFunctionArgs, redirect } from 'react-router';
import { type ActionFunctionArgs, redirect } from 'react-router';
import { destroySession, getSession } from '~/utils/sessions';
export async function loader() {

View File

@ -1,4 +1,4 @@
import { LoaderFunctionArgs, data } from 'react-router';
import { type LoaderFunctionArgs, data } from 'react-router';
import { loadContext } from '~/utils/config/headplane';
import { finishOidc } from '~/utils/oidc';

View File

@ -12,7 +12,7 @@ import {
} from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { LockIcon, ThreeBarsIcon } from '@primer/octicons-react';
import { FetcherWithComponents, useFetcher } from 'react-router';
import { type FetcherWithComponents, useFetcher } from 'react-router';
import { useEffect, useState } from 'react';
import { Button, Input } from 'react-aria-components';

View File

@ -1,4 +1,4 @@
import { ActionFunctionArgs } from 'react-router';
import type { ActionFunctionArgs } from 'react-router';
import { json, useLoaderData } from 'react-router';
import Code from '~/components/Code';

View File

@ -1,4 +1,4 @@
import { ActionFunctionArgs } from 'react-router';
import type { ActionFunctionArgs } from 'react-router';
import { del, post } from '~/utils/headscale';
import { getSession } from '~/utils/sessions';
import { send } from '~/utils/res';

View File

@ -4,7 +4,7 @@ import { Link } from 'react-router';
import Menu from '~/components/Menu';
import StatusCircle from '~/components/StatusCircle';
import { toast } from '~/components/Toaster';
import { Machine, Route, User } from '~/types';
import type { Machine, Route, User } from '~/types';
import { cn } from '~/utils/cn';
import MenuOptions from './menu';
@ -30,7 +30,7 @@ export default function MachineRow({ machine, routes, magic, users }: Props) {
tags.unshift('Expired');
}
let prefix = magic?.startsWith('[user]')
const prefix = magic?.startsWith('[user]')
? magic.replace('[user]', machine.user.name)
: magic;

View File

@ -1,8 +1,8 @@
import { KebabHorizontalIcon } from '@primer/octicons-react';
import { ReactNode, useState } from 'react';
import { type ReactNode, useState } from 'react';
import MenuComponent from '~/components/Menu';
import { Machine, Route, User } from '~/types';
import type { Machine, Route, User } from '~/types';
import { cn } from '~/utils/cn';
import Delete from '../dialogs/delete';

View File

@ -1,8 +1,8 @@
import { Form, useSubmit } from 'react-router';
import { type Dispatch, type SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import Dialog from '~/components/Dialog';
import { type Machine } from '~/types';
import type { Machine } from '~/types';
import { cn } from '~/utils/cn';
interface DeleteProps {

View File

@ -1,8 +1,8 @@
import { Form, useSubmit } from 'react-router';
import { type Dispatch, type SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import Dialog from '~/components/Dialog';
import { type Machine } from '~/types';
import type { Machine } from '~/types';
import { cn } from '~/utils/cn';
interface ExpireProps {

View File

@ -4,7 +4,7 @@ import { type Dispatch, type SetStateAction, useState } from 'react';
import Code from '~/components/Code';
import Dialog from '~/components/Dialog';
import Select from '~/components/Select';
import { type Machine, User } from '~/types';
import type { Machine, User } from '~/types';
interface MoveProps {
readonly machine: Machine;

View File

@ -10,7 +10,7 @@ import Select from '~/components/Select';
import Menu from '~/components/Menu';
import Spinner from '~/components/Spinner';
import { toast } from '~/components/Toaster';
import { Machine, User } from '~/types';
import { Machine, type User } from '~/types';
export interface NewProps {
server: string;

View File

@ -4,7 +4,7 @@ import { type Dispatch, type SetStateAction, useState } from 'react';
import Code from '~/components/Code';
import Dialog from '~/components/Dialog';
import TextField from '~/components/TextField';
import { type Machine } from '~/types';
import type { Machine } from '~/types';
interface RenameProps {
readonly machine: Machine;

View File

@ -1,10 +1,10 @@
import { useFetcher } from 'react-router';
import { Dispatch, SetStateAction, useMemo } from 'react';
import { type Dispatch, type SetStateAction, useMemo } from 'react';
import Dialog from '~/components/Dialog';
import Switch from '~/components/Switch';
import Link from '~/components/Link';
import { Machine, Route } from '~/types';
import type { Machine, Route } from '~/types';
import { cn } from '~/utils/cn';
interface RoutesProps {

View File

@ -1,11 +1,11 @@
import { PlusIcon, XIcon } from '@primer/octicons-react';
import { Form, useSubmit } from 'react-router';
import { Dispatch, SetStateAction, useState } from 'react';
import { type Dispatch, type SetStateAction, useState } from 'react';
import { Button, Input } from 'react-aria-components';
import Dialog from '~/components/Dialog';
import Link from '~/components/Link';
import { Machine } from '~/types';
import type { Machine } from '~/types';
import { cn } from '~/utils/cn';
interface TagsProps {

View File

@ -1,4 +1,4 @@
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import { Link as RemixLink, useLoaderData } from 'react-router';
import {
InfoIcon,
@ -15,7 +15,7 @@ import Card from '~/components/Card';
import Menu from '~/components/Menu';
import Tooltip from '~/components/Tooltip';
import StatusCircle from '~/components/StatusCircle';
import { Machine, Route, User } from '~/types';
import type { Machine, Route, User } from '~/types';
import { cn } from '~/utils/cn';
import { loadContext } from '~/utils/config/headplane';
import { loadConfig } from '~/utils/config/headscale';

View File

@ -1,5 +1,5 @@
import { InfoIcon } from '@primer/octicons-react';
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import { useLoaderData } from 'react-router';
import { Button, Tooltip, TooltipTrigger } from 'react-aria-components';

View File

@ -1,9 +1,9 @@
import { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
import type { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
import { useLoaderData } from 'react-router';
import { useLiveData } from '~/utils/useLiveData';
import { getSession } from '~/utils/sessions';
import { Link as RemixLink } from 'react-router';
import { PreAuthKey, User } from '~/types';
import type { PreAuthKey, User } from '~/types';
import { pull, post } from '~/utils/headscale';
import { loadContext } from '~/utils/config/headplane';
import { useState } from 'react';

View File

@ -12,7 +12,7 @@ import Link from '~/components/Link';
import Spinner from '~/components/Spinner';
import { cn } from '~/utils/cn';
import { User } from '~/types';
import type { User } from '~/types';
interface Props {
users: User[];

View File

@ -2,7 +2,7 @@ import { OrganizationIcon, PasskeyFillIcon } from '@primer/octicons-react';
import Card from '~/components/Card';
import Link from '~/components/Link';
import { HeadplaneContext } from '~/utils/config/headplane';
import type { HeadplaneContext } from '~/utils/config/headplane';
import Add from '../dialogs/add';

View File

@ -1,6 +1,6 @@
import { DataRef, DndContext, useDraggable, useDroppable } from '@dnd-kit/core';
import { type DataRef, DndContext, useDraggable, useDroppable } from '@dnd-kit/core';
import { PersonIcon } from '@primer/octicons-react';
import { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import { useActionData, useLoaderData, useSubmit } from 'react-router';
import { useEffect, useState } from 'react';
import { ClientOnly } from 'remix-utils/client-only';
@ -9,7 +9,7 @@ import Attribute from '~/components/Attribute';
import Card from '~/components/Card';
import StatusCircle from '~/components/StatusCircle';
import { toast } from '~/components/Toaster';
import { Machine, User } from '~/types';
import type { Machine, User } from '~/types';
import { cn } from '~/utils/cn';
import { loadContext } from '~/utils/config/headplane';
import { loadConfig } from '~/utils/config/headscale';

View File

@ -8,8 +8,8 @@ import { resolve } from 'node:path';
import { parse } from 'yaml';
import { IntegrationFactory, loadIntegration } from '~/integration';
import { HeadscaleConfig, loadConfig } from '~/utils/config/headscale';
import { type IntegrationFactory, loadIntegration } from '~/integration';
import { type HeadscaleConfig, loadConfig } from '~/utils/config/headscale';
import { testOidc } from '~/utils/oidc';
import log from '~/utils/log';
@ -160,8 +160,8 @@ async function checkOidc(config?: HeadscaleConfig) {
let issuer = process.env.OIDC_ISSUER;
let client = process.env.OIDC_CLIENT_ID;
let secret = process.env.OIDC_CLIENT_SECRET;
let method = process.env.OIDC_CLIENT_SECRET_METHOD ?? 'client_secret_basic';
let skip = process.env.OIDC_SKIP_CONFIG_VALIDATION === 'true';
const method = process.env.OIDC_CLIENT_SECRET_METHOD ?? 'client_secret_basic';
const skip = process.env.OIDC_SKIP_CONFIG_VALIDATION === 'true';
log.debug('CTXT', 'Checking OIDC environment variables');
log.debug('CTXT', 'Issuer: %s', issuer);

View File

@ -2,7 +2,7 @@ import { redirect } from 'react-router';
import {
authorizationCodeGrantRequest,
calculatePKCECodeChallenge,
Client,
type Client,
discoveryRequest,
generateRandomCodeVerifier,
generateRandomNonce,
@ -19,7 +19,7 @@ import { post } from '~/utils/headscale';
import { commitSession, getSession } from '~/utils/sessions';
import log from '~/utils/log';
import { HeadplaneContext } from './config/headplane';
import type { HeadplaneContext } from './config/headplane';
type OidcConfig = NonNullable<HeadplaneContext['oidc']>;