1
0
Fork 0
forked from Mirrors/gomuks

web/eslint: add import sorting

This commit is contained in:
Tulir Asokan 2024-10-07 01:26:13 +03:00
parent 40b66f3057
commit 0cb2fb88cb
8 changed files with 1364 additions and 6 deletions

View file

@ -2,6 +2,7 @@ import js from "@eslint/js"
import globals from "globals"
import reactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"
import pluginImport from "eslint-plugin-import"
import tseslint from "typescript-eslint"
export default tseslint.config(
@ -16,6 +17,7 @@ export default tseslint.config(
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"import": pluginImport,
},
rules: {
...reactHooks.configs.recommended.rules,
@ -23,6 +25,7 @@ export default tseslint.config(
"warn",
{allowConstantExport: true},
],
"import/order": "error",
"indent": ["error", "tab", {
"FunctionDeclaration": {"parameters": "first"},
"FunctionExpression": {"parameters": "first"},

1354
web/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@
"@eslint/js": "^9.11.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.11.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",

View file

@ -14,12 +14,12 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { useEffect, useMemo, useState } from "react"
import { ScaleLoader } from "react-spinners"
import Client from "./api/client.ts"
import WSClient from "./api/wsclient.ts"
import { ClientState } from "./api/types/hievents.ts"
import { ConnectionEvent } from "./api/rpc.ts"
import { LoginScreen, VerificationScreen } from "./ui/login"
import { ScaleLoader } from "react-spinners"
import MainScreen from "./ui/MainScreen.tsx"
function App() {

View file

@ -13,12 +13,12 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { CachedEventDispatcher } from "../util/eventdispatcher.ts"
import type {
ClientWellKnown, DBEvent, EventID, EventRowID, EventType, RoomID, TimelineRowID, UserID,
} from "./types/hitypes.ts"
import { ClientState, RPCEvent } from "./types/hievents.ts"
import { RPCClient } from "./rpc.ts"
import { CachedEventDispatcher } from "../util/eventdispatcher.ts"
import { StateStore } from "./statestore.ts"
export default class Client {

View file

@ -13,9 +13,9 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { RPCEvent } from "./types/hievents.ts"
import { EventDispatcher } from "../util/eventdispatcher.ts"
import { CancellablePromise } from "../util/promise.ts"
import { RPCEvent } from "./types/hievents.ts"
export interface RPCClient {
connect: EventDispatcher<ConnectionEvent>

View file

@ -13,6 +13,7 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { NonNullCachedEventDispatcher } from "../util/eventdispatcher.ts"
import type {
ContentURI,
DBEvent,
@ -24,7 +25,6 @@ import type {
TimelineRowTuple,
} from "./types/hitypes.ts"
import type { EventsDecryptedData, SyncCompleteData, SyncRoom } from "./types/hievents.ts"
import { NonNullCachedEventDispatcher } from "../util/eventdispatcher.ts"
function arraysAreEqual<T>(arr1?: T[], arr2?: T[]): boolean {
if (!arr1 || !arr2) {

View file

@ -13,10 +13,10 @@
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import { RPCCommand, RPCEvent } from "./types/hievents.ts"
import { CachedEventDispatcher, EventDispatcher } from "../util/eventdispatcher.ts"
import { ConnectionEvent, RPCClient } from "./rpc.ts"
import { CancellablePromise } from "../util/promise.ts"
import { RPCCommand, RPCEvent } from "./types/hievents.ts"
import { ConnectionEvent, RPCClient } from "./rpc.ts"
export class ErrorResponse extends Error {
constructor(public data: unknown) {