mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Run npm lint:fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React, { FormEvent, useState } from 'react';
|
||||
import type { FormEvent} from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
TextInput,
|
||||
PasswordInput,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user