From 38125b42f9458344fbb901e6ff5004f91b5079d2 Mon Sep 17 00:00:00 2001 From: Alex Kern Date: Sat, 28 Dec 2024 20:09:12 -0800 Subject: [PATCH] fmt --- eslint.config.js | 37 ------------------------------- eslint.config.mjs | 33 +++++++++++++++++++++++++++ package.json | 7 +++--- pnpm-lock.yaml | 19 ++++++++++++++++ src/app/api/create/route.ts | 4 +--- src/app/layout.tsx | 20 ++++++++--------- src/channel.ts | 24 +++++++++++--------- src/components/InputLabel.tsx | 2 +- src/components/Spinner.tsx | 8 +++++-- src/components/WebRTCProvider.tsx | 9 ++------ src/zip-stream.ts | 7 +++--- 11 files changed, 94 insertions(+), 76 deletions(-) delete mode 100644 eslint.config.js create mode 100644 eslint.config.mjs diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 9e5bf71..0000000 --- a/eslint.config.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - project: './tsconfig.json', - }, - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@next/next/recommended" - ], - plugins: [ - "@typescript-eslint", - ], - rules: { - "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], - "@typescript-eslint/no-use-before-define": ["error", { "variables": false }], - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/require-await": "off", - "@typescript-eslint/no-explicit-any": "warn", - "import/no-unused-modules": "off", - "import/group-exports": "off", - "import/no-extraneous-dependencies": "off", - "new-cap": "off", - "no-inline-comments": "off", - "no-shadow": "warn", - "no-use-before-define": "off", - }, - ignores: [ - 'legacy/', - 'node_modules/', - '.next/' - ] -}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..8a29579 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,33 @@ +// @ts-check + +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config({ + extends: [ + eslint.configs.recommended, + tseslint.configs.recommended, + ], + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_' }, + ], + '@typescript-eslint/no-use-before-define': [ + 'error', + { variables: false }, + ], + '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + 'import/no-unused-modules': 'off', + 'import/group-exports': 'off', + 'import/no-extraneous-dependencies': 'off', + 'new-cap': 'off', + 'no-inline-comments': 'off', + 'no-shadow': 'warn', + 'no-use-before-define': 'off', + }, + files: ['src/**/*.ts[x]'], + ignores: ['legacy', 'node_modules', '.next'], +}); diff --git a/package.json b/package.json index f005302..086e04a 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "build": "next build", "start": "next start", "start:peerjs": "./bin/peerjs.js", - "lint:check": "eslint 'app/**/*.ts[x]'", - "lint:fix": "eslint 'app/**/*.ts[x]' --fix", + "lint:check": "eslint 'src/**/*.ts[x]'", + "lint:fix": "eslint 'src/**/*.ts[x]' --fix", "docker:build": "docker compose build", "docker:up": "docker compose up -d", "docker:down": "docker compose down", @@ -68,7 +68,8 @@ "husky": "^4.3.8", "lint-staged": "^10.5.4", "prettier": "^2.8.8", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "typescript-eslint": "^8.18.2" }, "husky": { "hooks": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5db50b..04331be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,6 +112,9 @@ devDependencies: typescript: specifier: ^4.9.5 version: 4.9.5 + typescript-eslint: + specifier: ^8.18.2 + version: 8.18.2(eslint@9.17.0)(typescript@4.9.5) packages: @@ -5804,6 +5807,22 @@ packages: reflect.getprototypeof: 1.0.6 dev: true + /typescript-eslint@8.18.2(eslint@9.17.0)(typescript@4.9.5): + resolution: {integrity: sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + dependencies: + '@typescript-eslint/eslint-plugin': 8.18.2(@typescript-eslint/parser@8.18.2)(eslint@9.17.0)(typescript@4.9.5) + '@typescript-eslint/parser': 8.18.2(eslint@9.17.0)(typescript@4.9.5) + '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@4.9.5) + eslint: 9.17.0 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} diff --git a/src/app/api/create/route.ts b/src/app/api/create/route.ts index d1bb3cf..d6794d7 100644 --- a/src/app/api/create/route.ts +++ b/src/app/api/create/route.ts @@ -11,8 +11,6 @@ export async function POST(request: Request): Promise { ) } - const channel = await getOrCreateChannelRepo().createChannel( - uploaderPeerID, - ) + const channel = await getOrCreateChannelRepo().createChannel(uploaderPeerID) return NextResponse.json(channel) } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 209fecf..62405e0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -35,16 +35,16 @@ export default function RootLayout({ - - - - - -
{children}
-