From 43e2717782eef746b3ccae3eb8f25fc83e1523c7 Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Fri, 3 Jul 2026 13:50:07 -0400 Subject: [PATCH 1/5] chore: standardize on '@/' style paths enforced in vscode settings, checked in eslint --- .vscode/settings.json | 1 + eslint.config.mjs | 11 +++++++++++ package-lock.json | 8 ++++++++ package.json | 1 + 4 files changed, 21 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 048ec69..e145f41 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { // https://nextjs.org/docs/app/api-reference/config/typescript#ide-plugin + "js/ts.preferences.importModuleSpecifier": "non-relative", "js/ts.tsdk.path": "node_modules/typescript/lib", "js/ts.tsdk.promptToUseWorkspaceVersion": true, "files.associations": { diff --git a/eslint.config.mjs b/eslint.config.mjs index 28c6c11..075c30c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +1,7 @@ import nextVitals from 'eslint-config-next/core-web-vitals' import nextTs from 'eslint-config-next/typescript' import prettier from 'eslint-config-prettier/flat' +import noRelativeImportPaths from 'eslint-plugin-no-relative-import-paths' import { defineConfig, globalIgnores } from 'eslint/config' const eslintConfig = defineConfig([ @@ -19,6 +20,16 @@ const eslintConfig = defineConfig([ 'next-env.d.ts', 'branch-*/', ]), + { + files: ['src/**/*.{mtx,ts,tsx}'], + plugins: { 'no-relative-import-paths': noRelativeImportPaths }, + rules: { + 'no-relative-import-paths/no-relative-import-paths': [ + 'warn', + { allowSameFolder: true, rootDir: 'src', prefix: '@' }, + ], + }, + }, ]) export default eslintConfig diff --git a/package-lock.json b/package-lock.json index 3571ac3..784fd7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "eslint": "^9", "eslint-config-next": "16.2.3", "eslint-config-prettier": "^10.1.8", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "husky": "^9.1.7", "lint-staged": "^16.4.0", "prettier": "^3.8.2", @@ -5361,6 +5362,13 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" } }, + "node_modules/eslint-plugin-no-relative-import-paths": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.6.1.tgz", + "integrity": "sha512-YZNeOnsOrJcwhFw0X29MXjIzu2P/f5X2BZDPWw1R3VUYBRFxNIh77lyoL/XrMU9ewZNQPcEvAgL/cBOT1P330A==", + "dev": true, + "license": "ISC" + }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", diff --git a/package.json b/package.json index d6b272a..dbd0c63 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "eslint": "^9", "eslint-config-next": "16.2.3", "eslint-config-prettier": "^10.1.8", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "husky": "^9.1.7", "lint-staged": "^16.4.0", "prettier": "^3.8.2", From d3add389a58a5d0796948ca5ce4762c4b0f40b6e Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Fri, 3 Jul 2026 14:03:03 -0400 Subject: [PATCH 2/5] do the eslint action --- src/app/admin/components/AllowlistEditor.tsx | 2 +- src/app/admin/components/HealthMonitor.tsx | 2 +- src/app/admin/components/OAuthConfig.tsx | 2 +- src/app/admin/components/RegistrationModeControl.tsx | 2 +- src/app/admin/components/SessionRow.tsx | 2 +- src/app/admin/components/SessionViewer.tsx | 2 +- src/app/admin/components/UserManagement.tsx | 2 +- src/app/admin/components/UserRow.tsx | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/admin/components/AllowlistEditor.tsx b/src/app/admin/components/AllowlistEditor.tsx index 8a8c576..efdee20 100644 --- a/src/app/admin/components/AllowlistEditor.tsx +++ b/src/app/admin/components/AllowlistEditor.tsx @@ -1,9 +1,9 @@ 'use client' +import { addAllowedUser, removeAllowedUser } from '@/app/admin/actions' import { useServerAction } from '@/lib/client/util' import { useRouter } from 'next/navigation' import { startTransition, useRef } from 'react' -import { addAllowedUser, removeAllowedUser } from '../actions' export function AllowlistEditor({ users }: { users: string[] }) { const router = useRouter() diff --git a/src/app/admin/components/HealthMonitor.tsx b/src/app/admin/components/HealthMonitor.tsx index 05119e7..bbc01dc 100644 --- a/src/app/admin/components/HealthMonitor.tsx +++ b/src/app/admin/components/HealthMonitor.tsx @@ -1,9 +1,9 @@ 'use client' +import { fetchDiskUsage, fetchHealth } from '@/app/admin/actions' import { useServerAction } from '@/lib/client/util' import { startTransition, useState } from 'react' import useSWR from 'swr' -import { fetchDiskUsage, fetchHealth } from '../actions' import { formatBytes, formatUptime } from './utils' const labelStyle = { padding: '4px 12px 4px 0', color: '#666' } diff --git a/src/app/admin/components/OAuthConfig.tsx b/src/app/admin/components/OAuthConfig.tsx index e8b2e71..452afa4 100644 --- a/src/app/admin/components/OAuthConfig.tsx +++ b/src/app/admin/components/OAuthConfig.tsx @@ -1,9 +1,9 @@ 'use client' +import { fetchOAuthConfig, updateOAuthConfig } from '@/app/admin/actions' import { useServerAction } from '@/lib/client/util' import { useState } from 'react' import useSWR from 'swr' -import { fetchOAuthConfig, updateOAuthConfig } from '../actions' export function OAuthConfig() { const { data, mutate } = useSWR('adminOAuthConfig', () => fetchOAuthConfig()) diff --git a/src/app/admin/components/RegistrationModeControl.tsx b/src/app/admin/components/RegistrationModeControl.tsx index cb78c88..52423a9 100644 --- a/src/app/admin/components/RegistrationModeControl.tsx +++ b/src/app/admin/components/RegistrationModeControl.tsx @@ -1,10 +1,10 @@ 'use client' +import { setRegistrationMode } from '@/app/admin/actions' import { useServerAction } from '@/lib/client/util' import type { RegistrationMode } from '@/lib/server/config' import { useRouter } from 'next/navigation' import { startTransition, useState } from 'react' -import { setRegistrationMode } from '../actions' const MODES: { value: RegistrationMode; label: string }[] = [ { value: 'open', label: 'Open registration' }, diff --git a/src/app/admin/components/SessionRow.tsx b/src/app/admin/components/SessionRow.tsx index c049a42..e1a487b 100644 --- a/src/app/admin/components/SessionRow.tsx +++ b/src/app/admin/components/SessionRow.tsx @@ -1,11 +1,11 @@ 'use client' +import { killEditorSession } from '@/app/admin/actions' import ProjectLink from '@/app/components/ProjectLink' import { useServerAction } from '@/lib/client/util' import type { EditorSessionInfo } from '@/lib/server/editorSessions' import { useRouter } from 'next/navigation' import { startTransition } from 'react' -import { killEditorSession } from '../actions' export function SessionRow({ info }: { info: EditorSessionInfo }) { const router = useRouter() diff --git a/src/app/admin/components/SessionViewer.tsx b/src/app/admin/components/SessionViewer.tsx index f0eb44f..c7d04c0 100644 --- a/src/app/admin/components/SessionViewer.tsx +++ b/src/app/admin/components/SessionViewer.tsx @@ -1,5 +1,5 @@ +import { requireAdmin } from '@/app/admin/actions' import { getEditorSessionManager } from '@/lib/server/editorSessions' -import { requireAdmin } from '../actions' import { SessionRow } from './SessionRow' export async function SessionViewer() { diff --git a/src/app/admin/components/UserManagement.tsx b/src/app/admin/components/UserManagement.tsx index b4f6ff5..7de526e 100644 --- a/src/app/admin/components/UserManagement.tsx +++ b/src/app/admin/components/UserManagement.tsx @@ -1,5 +1,5 @@ +import { requireAdmin } from '@/app/admin/actions' import { getDb } from '@/lib/server/db' -import { requireAdmin } from '../actions' import { UserRow } from './UserRow' export async function UserManagement() { diff --git a/src/app/admin/components/UserRow.tsx b/src/app/admin/components/UserRow.tsx index 90e2316..880b7c2 100644 --- a/src/app/admin/components/UserRow.tsx +++ b/src/app/admin/components/UserRow.tsx @@ -1,9 +1,9 @@ 'use client' +import { deleteUser, toggleAdmin } from '@/app/admin/actions' import { useServerAction } from '@/lib/client/util' import { useRouter } from 'next/navigation' import { startTransition, useState } from 'react' -import { deleteUser, toggleAdmin } from '../actions' type User = { id: string; name: string; isAdmin: boolean } From 1ed5568420544e75e5607e1a59c4f6505c4fdf20 Mon Sep 17 00:00:00 2001 From: "Robert J. Simmons" <442315+robsimmons@users.noreply.github.com> Date: Fri, 3 Jul 2026 19:02:07 -0400 Subject: [PATCH 3/5] Update .vscode/settings.json Co-authored-by: Wojciech Nawrocki <13901751+Vtec234@users.noreply.github.com> --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e145f41..cd8d7d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { - // https://nextjs.org/docs/app/api-reference/config/typescript#ide-plugin "js/ts.preferences.importModuleSpecifier": "non-relative", + // https://nextjs.org/docs/app/api-reference/config/typescript#ide-plugin "js/ts.tsdk.path": "node_modules/typescript/lib", "js/ts.tsdk.promptToUseWorkspaceVersion": true, "files.associations": { From e99c9bfd892c4674a7844f4ff25bcf9867588b39 Mon Sep 17 00:00:00 2001 From: "Robert J. Simmons" <442315+robsimmons@users.noreply.github.com> Date: Fri, 3 Jul 2026 19:02:45 -0400 Subject: [PATCH 4/5] Update eslint.config.mjs --- eslint.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 075c30c..e4981f1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -21,7 +21,7 @@ const eslintConfig = defineConfig([ 'branch-*/', ]), { - files: ['src/**/*.{mtx,ts,tsx}'], + files: ['src/**/*.{mts,ts,tsx}'], plugins: { 'no-relative-import-paths': noRelativeImportPaths }, rules: { 'no-relative-import-paths/no-relative-import-paths': [ From b2886d5152e9c6692f73fb4a5ddb6779301787ce Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Fri, 3 Jul 2026 19:48:37 -0400 Subject: [PATCH 5/5] undo vscode setting change --- .vscode/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index cd8d7d9..048ec69 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "js/ts.preferences.importModuleSpecifier": "non-relative", // https://nextjs.org/docs/app/api-reference/config/typescript#ide-plugin "js/ts.tsdk.path": "node_modules/typescript/lib", "js/ts.tsdk.promptToUseWorkspaceVersion": true,