Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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([
Expand All @@ -19,6 +20,16 @@ const eslintConfig = defineConfig([
'next-env.d.ts',
'branch-*/',
]),
{
files: ['src/**/*.{mts,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
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/AllowlistEditor.tsx
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/HealthMonitor.tsx
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/OAuthConfig.tsx
Original file line number Diff line number Diff line change
@@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/RegistrationModeControl.tsx
Original file line number Diff line number Diff line change
@@ -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' },
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/SessionRow.tsx
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/SessionViewer.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/UserManagement.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/components/UserRow.tsx
Original file line number Diff line number Diff line change
@@ -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 }

Expand Down
Loading