Run npm lint:fix

This commit is contained in:
2025-05-18 16:57:48 +02:00
parent 16fbbec992
commit 2f181d0f7f
34 changed files with 85 additions and 68 deletions

View File

@@ -1,4 +1,5 @@
import React, { FormEvent, useState } from 'react';
import type { FormEvent} from 'react';
import React, { useState } from 'react';
import {
TextInput,
PasswordInput,

View File

@@ -1,4 +1,5 @@
import React, { useState, useEffect, useMemo, ReactNode } from 'react';
import type { ReactNode } from 'react';
import React, { useState, useEffect, useMemo } from 'react';
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkMath from 'remark-math';

View File

@@ -1,9 +1,10 @@
import React, { useRef, useState, useLayoutEffect } from 'react';
import { Tree, NodeApi } from 'react-arborist';
import type { NodeApi } from 'react-arborist';
import { Tree } from 'react-arborist';
import { IconFile, IconFolder, IconFolderOpen } from '@tabler/icons-react';
import { Tooltip } from '@mantine/core';
import useResizeObserver from '@react-hook/resize-observer';
import { FileNode } from '../../types/fileApi';
import type { FileNode } from '../../types/fileApi';
interface Size {
width: number;
@@ -48,7 +49,7 @@ function Node(props: any) {
if (node.isInternal) {
node.toggle();
} else {
const treeProps = node.tree.props as any;
const treeProps = node.tree.props;
if (typeof treeProps.onNodeClick === 'function') {
treeProps.onNodeClick(node);
}
@@ -124,7 +125,7 @@ const FileTree: React.FC<FileTreeProps> = ({
{...({
// Use a spread with type assertion to add onNodeClick
onNodeClick: (node: NodeApi<FileNode>) => {
const fileNode = node.data as FileNode;
const fileNode = node.data;
if (!node.isInternal) {
handleFileSelect(fileNode.path);
}

View File

@@ -42,7 +42,7 @@ const MainContent: React.FC<MainContentProps> = ({
const handleSaveFile = useCallback(
async (filePath: string, fileContent: string): Promise<boolean> => {
let success = await handleSave(filePath, fileContent);
const success = await handleSave(filePath, fileContent);
if (success) {
setHasUnsavedChanges(false);
}

View File

@@ -4,7 +4,7 @@ import FileActions from '../files/FileActions';
import FileTree from '../files/FileTree';
import { useGitOperations } from '../../hooks/useGitOperations';
import { useWorkspace } from '../../contexts/WorkspaceContext';
import { FileNode } from '@/types/fileApi';
import type { FileNode } from '@/types/fileApi';
interface SidebarProps {
selectedFile: string | null;

View File

@@ -8,7 +8,7 @@ import {
Button,
Group,
} from '@mantine/core';
import { CreateUserRequest } from '@/types/adminApi';
import type { CreateUserRequest } from '@/types/adminApi';
import { UserRole } from '@/types/authApi';
interface CreateUserModalProps {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Modal, Text, Button, Group, Stack } from '@mantine/core';
import { User } from '@/types/authApi';
import type { User } from '@/types/authApi';
interface DeleteUserModalProps {
opened: boolean;

View File

@@ -9,8 +9,9 @@ import {
PasswordInput,
Text,
} from '@mantine/core';
import { UpdateUserRequest } from '@/types/adminApi';
import { User, UserRole } from '@/types/authApi';
import type { UpdateUserRequest } from '@/types/adminApi';
import type { User} from '@/types/authApi';
import { UserRole } from '@/types/authApi';
interface EditUserModalProps {
opened: boolean;

View File

@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { Modal, TextInput, Button, Group, Box } from '@mantine/core';
import { useModalContext } from '../../../contexts/ModalContext';
import { notifications } from '@mantine/notifications';
import { Workspace } from '@/types/workspace';
import type { Workspace } from '@/types/workspace';
import { createWorkspace } from '@/api/workspace';
interface CreateWorkspaceModalProps {

View File

@@ -19,7 +19,7 @@ import { useWorkspace } from '../../contexts/WorkspaceContext';
import { useModalContext } from '../../contexts/ModalContext';
import { listWorkspaces } from '../../api/workspace';
import CreateWorkspaceModal from '../modals/workspace/CreateWorkspaceModal';
import { Workspace } from '../../types/workspace';
import type { Workspace } from '../../types/workspace';
const WorkspaceSwitcher: React.FC = () => {
const { currentWorkspace, switchWorkspace } = useWorkspace();

View File

@@ -16,11 +16,12 @@ import SecuritySettings from './SecuritySettings';
import ProfileSettings from './ProfileSettings';
import DangerZoneSettings from './DangerZoneSettings';
import AccordionControl from '../AccordionControl';
import {
SettingsActionType,
import type {
UserProfileSettings,
ProfileSettingsState,
SettingsAction,
SettingsAction} from '../../../types/settings';
import {
SettingsActionType
} from '../../../types/settings';
interface AccountSettingsProps {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Box, Stack, TextInput } from '@mantine/core';
import { UserProfileSettings } from '../../../types/settings';
import type { UserProfileSettings } from '../../../types/settings';
interface ProfileSettingsProps {
settings: UserProfileSettings;

View File

@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Box, PasswordInput, Stack, Text } from '@mantine/core';
import { UserProfileSettings } from '@/types/settings';
import type { UserProfileSettings } from '@/types/settings';
interface SecuritySettingsProps {
settings: UserProfileSettings;

View File

@@ -20,8 +20,8 @@ import { useUserAdmin } from '../../../hooks/useUserAdmin';
import CreateUserModal from '../../modals/user/CreateUserModal';
import EditUserModal from '../../modals/user/EditUserModal';
import DeleteUserModal from '../../modals/user/DeleteUserModal';
import { User } from '../../../types/authApi';
import { CreateUserRequest, UpdateUserRequest } from '../../../types/adminApi';
import type { User } from '../../../types/authApi';
import type { CreateUserRequest, UpdateUserRequest } from '../../../types/adminApi';
interface AdminUsersTabProps {
currentUser: User;

View File

@@ -3,7 +3,7 @@ import { Table, Group, Text, Box, LoadingOverlay, Alert } from '@mantine/core';
import { IconAlertCircle } from '@tabler/icons-react';
import { useAdminData } from '../../../hooks/useAdminData';
import { formatBytes } from '../../../utils/formatBytes';
import { FileCountStats, WorkspaceStats } from '../../../types/adminApi';
import type { FileCountStats, WorkspaceStats } from '../../../types/adminApi';
const AdminWorkspacesTab: React.FC = () => {
const {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Box, TextInput, Text, Grid } from '@mantine/core';
import { Workspace } from '@/types/workspace';
import type { Workspace } from '@/types/workspace';
interface GeneralSettingsProps {
name: string;

View File

@@ -8,7 +8,7 @@ import {
Group,
Grid,
} from '@mantine/core';
import { Workspace } from '@/types/workspace';
import type { Workspace } from '@/types/workspace';
interface GitSettingsProps {
gitEnabled: boolean;

View File

@@ -17,8 +17,9 @@ import GeneralSettings from './GeneralSettings';
import { useModalContext } from '../../../contexts/ModalContext';
import DangerZoneSettings from './DangerZoneSettings';
import AccordionControl from '../AccordionControl';
import { SettingsActionType, SettingsAction } from '../../../types/settings';
import { Workspace } from '../../../types/workspace';
import type { SettingsAction } from '../../../types/settings';
import { SettingsActionType } from '../../../types/settings';
import type { Workspace } from '../../../types/workspace';
// State and reducer for workspace settings
interface WorkspaceSettingsState {