chore: organizeImports

This commit is contained in:
DarkSky
2022-08-13 02:08:21 +08:00
parent 5cec5a363d
commit 617f9b9bfc
27 changed files with 63 additions and 77 deletions

View File

@@ -260,6 +260,12 @@
]
}
},
{
"files": ["index.tsx", "index.*.tsx"],
"rules": {
"filename-rules/match": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],

View File

@@ -2,6 +2,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": ["source.fixAll", "source.organizeImports"],
"prettier.prettierPath": "./node_modules/prettier",
"cSpell.words": [
"AUTOINCREMENT",

View File

@@ -7,8 +7,8 @@ import firebaseAuth = require('firebase-admin/auth');
import LRUCache = require('lru-cache');
import nanoid = require('nanoid');
import { handleConnection } from './utils';
import { URL } from 'url';
import { handleConnection } from './utils';
if (process.env.NODE_ENV !== 'development') {
firebaseApp.initializeApp({

View File

@@ -1,4 +1,3 @@
/* eslint-disable filename-rules/match */
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';

View File

@@ -1,7 +1,7 @@
import { Outlet } from 'react-router-dom';
import { LayoutHeader, SettingsSidebar } from '@toeverything/components/layout';
import { styled } from '@toeverything/components/ui';
import { SettingsSidebar, LayoutHeader } from '@toeverything/components/layout';
export function LigoVirgoRootContainer() {
return (

View File

@@ -1,20 +1,20 @@
import { Routes, Route, Navigate } from 'react-router-dom';
import { Navigate, Route, Routes } from 'react-router-dom';
import { Login } from './account';
import Agenda from './agenda';
import { WorkspaceContainer } from './workspace';
import { LigoVirgoRootContainer } from './AppContainer';
import Recent from './recent';
import { RoutePrivate } from './RoutePrivate';
import { RoutePublicAutoLogin } from './RoutePublicAutoLogin';
import Search from './search';
import Settings from './settings';
import Shared from './shared';
import Starred from './starred';
import { Login } from './account';
import { PageNotFound } from './status/page-not-found';
import { WorkspaceNotFound } from './status/workspace-not-found';
import { RoutePrivate } from './RoutePrivate';
import { RoutePublicAutoLogin } from './RoutePublicAutoLogin';
import { Tools } from './tools';
import { LigoVirgoRootContainer } from './AppContainer';
import { UIPage } from './ui';
import { WorkspaceContainer } from './workspace';
export function LigoVirgoRoutes() {
return (

View File

@@ -1,6 +1,6 @@
import { Navigate, useLocation } from 'react-router-dom';
import { PageLoading, Error } from '@toeverything/components/account';
import { PageLoading } from '@toeverything/components/account';
import { useUserAndSpaces } from '@toeverything/datasource/state';
export type RoutePrivateProps = {

View File

@@ -1,10 +1,10 @@
import { Routes, Route } from 'react-router-dom';
import { Route, Routes } from 'react-router-dom';
import Container from './container';
import Calendar from './calendar';
import Container from './container';
import Home from './home';
import Tasks from './tasks';
import Today from './today';
import Home from './home';
export default function AgendaContainer() {
return (

View File

@@ -1,6 +1,6 @@
import { type ComponentType, useRef } from 'react';
import * as uiIcons from '@toeverything/components/icons';
import { message, styled } from '@toeverything/components/ui';
import { useRef, type ComponentType } from 'react';
import { copy } from './copy';
const IconBooth = ({

View File

@@ -1,4 +1,4 @@
import { Routes, Route } from 'react-router-dom';
import { Route, Routes } from 'react-router-dom';
import { Container } from './container';
import { Icons } from './icons';

View File

@@ -1,5 +1,3 @@
import React from 'react';
export const UIPage = () => {
return (
<div className="">

View File

@@ -1,7 +1,7 @@
import { services, TemplateFactory } from '@toeverything/datasource/db-service';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { useEffect } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { services, TemplateFactory } from '@toeverything/datasource/db-service';
export function WorkspaceHome() {
const navigate = useNavigate();

View File

@@ -2,8 +2,8 @@ import { memo, useEffect } from 'react';
import { useParams } from 'react-router';
import { AffineBoard } from '@toeverything/components/affine-board';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { services } from '@toeverything/datasource/db-service';
import { useUserAndSpaces } from '@toeverything/datasource/state';
const MemoAffineBoard = memo(AffineBoard, (prev, next) => {
return prev.rootBlockId === next.rootBlockId;

View File

@@ -1,5 +1,4 @@
/* eslint-disable filename-rules/match */
import { Routes, Route, useParams, Navigate } from 'react-router';
import { Route, Routes, useParams } from 'react-router';
import { useUserAndSpaces } from '@toeverything/datasource/state';

View File

@@ -1,29 +1,28 @@
/* eslint-disable filename-rules/match */
import { useEffect, useRef, type UIEvent, useState } from 'react';
import { useEffect, useRef, useState, type UIEvent } from 'react';
import { useParams } from 'react-router';
import { AffineEditor } from '@toeverything/components/affine-editor';
import {
CalendarHeatmap,
PageTree,
Activities,
} from '@toeverything/components/layout';
import { CollapsibleTitle } from '@toeverything/components/common';
import {
useShowSpaceSidebar,
usePageClientWidth,
} from '@toeverything/datasource/state';
Activities,
CalendarHeatmap,
PageTree,
} from '@toeverything/components/layout';
import {
MuiBox as Box,
MuiCircularProgress as CircularProgress,
styled,
} from '@toeverything/components/ui';
import {
usePageClientWidth,
useShowSpaceSidebar,
} from '@toeverything/datasource/state';
import { WorkspaceName } from './workspace-name';
import { CollapsiblePageTree } from './collapsible-page-tree';
import { useFlag } from '@toeverything/datasource/feature-flags';
import { type BlockEditor } from '@toeverything/components/editor-core';
import { useFlag } from '@toeverything/datasource/feature-flags';
import { CollapsiblePageTree } from './collapsible-page-tree';
import { Tabs } from './components/tabs';
import { WorkspaceName } from './workspace-name';
type PageProps = {
workspace: string;
};

View File

@@ -1,8 +1,4 @@
import {
AddIcon,
ArrowDropDownIcon,
ArrowRightIcon,
} from '@toeverything/components/icons';
import { AddIcon } from '@toeverything/components/icons';
import {
useCalendarHeatmap,
usePageTree,

View File

@@ -1,6 +1,6 @@
import { useState } from 'react';
import { styled } from '@toeverything/components/ui';
import type { ValueOf } from '@toeverything/utils';
import { useState } from 'react';
const StyledTabs = styled('div')(({ theme }) => {
return {

View File

@@ -1,4 +1,3 @@
/* eslint-disable filename-rules/match */
import { render } from '@testing-library/react';
import { Page } from './index';

View File

@@ -1,17 +1,17 @@
import { styled, Input } from '@toeverything/components/ui';
import { PinIcon } from '@toeverything/components/icons';
import { Input, styled } from '@toeverything/components/ui';
import { services } from '@toeverything/datasource/db-service';
import {
useUserAndSpaces,
useShowSpaceSidebar,
useUserAndSpaces,
} from '@toeverything/datasource/state';
import React, {
import {
ChangeEvent,
KeyboardEvent,
useCallback,
useEffect,
useState,
} from 'react';
import { services } from '@toeverything/datasource/db-service';
import { Logo } from './components/logo/Logo';
const WorkspaceContainer = styled('div')({

View File

@@ -1,20 +1,19 @@
/* eslint-disable max-lines */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable filename-rules/match */
import { useEffect, useMemo, useState } from 'react';
import clsx from 'clsx';
import { useEffect, useMemo, useState } from 'react';
import { CssVarsProvider, styled } from '@mui/joy/styles';
import { Box, Button, Container, Grid, SvgIcon, Typography } from '@mui/joy';
import GitHubIcon from '@mui/icons-material/GitHub';
import RedditIcon from '@mui/icons-material/Reddit';
import TelegramIcon from '@mui/icons-material/Telegram';
import { Box, Button, Container, Grid, SvgIcon, Typography } from '@mui/joy';
import { CssVarsProvider, styled } from '@mui/joy/styles';
import { LogoIcon } from '@toeverything/components/icons';
// eslint-disable-next-line no-restricted-imports
import { useMediaQuery } from '@mui/material';
import LogoImage from './logo.png';
import CollaborationImage from './collaboration.png';
import LogoImage from './logo.png';
import PageImage from './page.png';
import ShapeImage from './shape.png';
import TaskImage from './task.png';

View File

@@ -1,4 +1,3 @@
/* eslint-disable filename-rules/match */
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';

View File

@@ -1,16 +1,12 @@
import { Guard as AuthingGuard } from '@authing/react-ui-components';
import { MuiBox as Box } from '@toeverything/components/ui';
import type { User as AuthingUser } from 'authing-js-sdk';
import { useCallback, useEffect, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import style9 from 'style9';
import { MuiBox as Box } from '@toeverything/components/ui';
import { Guard as AuthingGuard } from '@authing/react-ui-components';
import type { User as AuthingUser } from 'authing-js-sdk';
import {
AUTHING_APP_ID_US,
AUTHING_APP_ID_CN,
AUTHING_APP_HOST_US,
} from '@toeverything/utils';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { AUTHING_APP_HOST_US, AUTHING_APP_ID_US } from '@toeverything/utils';
import '@authing/react-ui-components/lib/index.min.css';

View File

@@ -1,5 +1,4 @@
/* eslint-disable filename-rules/match */
import { useEffect, useMemo } from 'react';
import { useMemo } from 'react';
import { LogoIcon } from '@toeverything/components/icons';
import { MuiButton } from '@toeverything/components/ui';

View File

@@ -1,12 +1,11 @@
/* eslint-disable filename-rules/match */
import { useCallback, useMemo } from 'react';
import { initializeApp } from 'firebase/app';
import {
GoogleAuthProvider,
getAuth,
signInWithPopup,
browserLocalPersistence,
getAuth,
GoogleAuthProvider,
signInWithPopup,
} from 'firebase/auth';
import { useCallback, useMemo } from 'react';
import { MuiButton } from '@toeverything/components/ui';

View File

@@ -1,12 +1,11 @@
/* eslint-disable filename-rules/match */
import { useCallback, useState } from 'react';
import { LogoImg } from '@toeverything/components/common';
import { MuiBox, MuiGrid, MuiSnackbar } from '@toeverything/components/ui';
import { useCallback, useState } from 'react';
// import { Authing } from './authing';
import { Firebase } from './firebase';
import { FileSystem } from './fs';
import { Error } from './../error';
// import { Authing } from './Authing';
import { FileSystem } from './FileSystem';
import { Firebase } from './Firebase';
export function Login() {
const [error, setError] = useState(false);

View File

@@ -1,11 +1,10 @@
/* eslint-disable filename-rules/match */
import { StrictMode } from 'react';
import { HookType } from '@toeverything/framework/virgo';
import { BasePlugin } from '../base-plugin';
import { Search } from './Search';
import { PluginRenderRoot } from '../utils';
import { Search } from './Search';
export class FullTextSearchPlugin extends BasePlugin {
#root?: PluginRenderRoot;
@@ -58,5 +57,5 @@ export class FullTextSearchPlugin extends BasePlugin {
}
}
export type { QueryResult } from './Search';
export { QueryBlocks } from './Search';
export type { QueryResult } from './Search';

View File

@@ -1,10 +1,9 @@
/* eslint-disable filename-rules/match */
import { useCallback, useMemo, useState } from 'react';
import { CloseIcon } from '@toeverything/components/common';
import { IconButton, MuiSnackbar, styled } from '@toeverything/components/ui';
import { services } from '@toeverything/datasource/db-service';
import { useLocalTrigger } from '@toeverything/datasource/state';
import { CloseIcon } from '@toeverything/components/common';
const cleanupWorkspace = (workspace: string) =>
new Promise((resolve, reject) => {