Skip to content

Commit 54dc80a

Browse files
committed
lint: shorten max line width
1 parent 98fe6d9 commit 54dc80a

File tree

12 files changed

+64
-13
lines changed

12 files changed

+64
-13
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default [
1919
endOfLine: 'auto',
2020
singleQuote: true,
2121
trailingComma: 'all',
22-
printWidth: 180,
22+
printWidth: 170,
2323
semi: false,
2424
},
2525
],

src/client/components/Admin/ChatInstances/useChatInstances.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const useChatInstances = ({ limit = 100, offset = 0, search = '', order = '', or
1515
chatInstances: ChatInstanceWithTokens[]
1616
count: number
1717
}> => {
18-
const res = await apiClient.get(`/chatinstances?limit=${limit}&offset=${offset}&search=${search}&orderBy=${orderBy}&order=${order}&showActiveCourses=${showActiveCourses}`)
18+
const res = await apiClient.get(
19+
`/chatinstances?limit=${limit}&offset=${offset}&search=${search}&orderBy=${orderBy}&order=${order}&showActiveCourses=${showActiveCourses}`,
20+
)
1921

2022
const { data } = res
2123

src/client/components/Admin/Usage/UserAccordion.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ import { grey } from '@mui/material/colors'
44
import { useTranslation } from 'react-i18next'
55
import { User } from '../../../types'
66

7-
const UserAccordion = ({ user, isFocused, handleLoginAs, decoration }: { user: User; isFocused: boolean; handleLoginAs: (user: User) => () => void; decoration?: JSX.Element }) => {
7+
const UserAccordion = ({
8+
user,
9+
isFocused,
10+
handleLoginAs,
11+
decoration,
12+
}: {
13+
user: User
14+
isFocused: boolean
15+
handleLoginAs: (user: User) => () => void
16+
decoration?: JSX.Element
17+
}) => {
818
const { t } = useTranslation()
919

1020
return (

src/client/components/Chat/Conversation.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,17 @@ export const Response = ({ role, content, setMessage, id }: { role: Role; conten
5252
)
5353
}
5454

55-
const Conversation = ({ messages, completion, handleStop = () => {}, setMessage }: { messages: Message[]; completion: string; handleStop?: () => void; setMessage?: any }) => {
55+
const Conversation = ({
56+
messages,
57+
completion,
58+
handleStop = () => {},
59+
setMessage,
60+
}: {
61+
messages: Message[]
62+
completion: string
63+
handleStop?: () => void
64+
setMessage?: any
65+
}) => {
5666
const { t } = useTranslation()
5767

5868
if (messages.length === 0 && !completion) return null

src/client/components/Chat/CopyToClipboardButton.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps> = ({ copied, i
3232
<IconButton onClick={handleClick} color="primary">
3333
<ContentCopy />
3434
</IconButton>
35-
<Snackbar message="Copied to clipboard" anchorOrigin={{ vertical: 'top', horizontal: 'center' }} autoHideDuration={2000} onClose={() => setOpen(false)} open={open} />
35+
<Snackbar
36+
message="Copied to clipboard"
37+
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
38+
autoHideDuration={2000}
39+
onClose={() => setOpen(false)}
40+
open={open}
41+
/>
3642
</Box>
3743
)
3844
}

src/client/components/Chat/SendMessage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ const SendMessage = ({
9191
<Button onClick={() => handleReset()} disabled={resetDisabled}>
9292
{t('reset')}
9393
</Button>
94-
{!notOptoutSaving && saveChat && <FormControlLabel control={<Switch onChange={() => setSaveConsent(!saveConsent)} checked={saveConsent} />} label={t('chat:allowSave')} />}
94+
{!notOptoutSaving && saveChat && (
95+
<FormControlLabel control={<Switch onChange={() => setSaveConsent(!saveConsent)} checked={saveConsent} />} label={t('chat:allowSave')} />
96+
)}
9597
{notOptoutSaving && saveChat && (
9698
<Alert severity="warning" style={{ marginLeft: 20 }}>
9799
<Typography>{t('chat:toBeSaved')}</Typography>

src/client/components/Courses/Course/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ const Course = () => {
293293

294294
<Box sx={{ paddingBottom: 2 }}>
295295
{!mandatoryPromptId ? (
296-
<FormControlLabel control={<Checkbox checked={mandatory} onChange={() => setMandatory((prev) => !prev)} />} label={t('course:editMandatoryPrompt')} sx={{ mr: 5 }} />
296+
<FormControlLabel
297+
control={<Checkbox checked={mandatory} onChange={() => setMandatory((prev) => !prev)} />}
298+
label={t('course:editMandatoryPrompt')}
299+
sx={{ mr: 5 }}
300+
/>
297301
) : (
298302
<Tooltip title={t('course:oneMandatoryPrompt')}>
299303
<FormControlLabel control={<Checkbox checked={mandatory} disabled />} label={t('course:editMandatoryPrompt')} sx={{ mr: 5 }} />

src/client/components/Courses/CourseList.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ import { formatDate, getCurTypeLabel } from './util'
1212
import { Course as CourseType } from '../../types'
1313
import { DEFAULT_MODEL_ON_ENABLE, DEFAULT_TOKEN_LIMIT, PUBLIC_URL } from '../../../config'
1414

15-
const Course = ({ course, onEnable, onDisable }: { course: CoursesViewCourse; onEnable: (course: CoursesViewCourse) => void; onDisable: (course: CoursesViewCourse) => void }) => {
15+
const Course = ({
16+
course,
17+
onEnable,
18+
onDisable,
19+
}: {
20+
course: CoursesViewCourse
21+
onEnable: (course: CoursesViewCourse) => void
22+
onDisable: (course: CoursesViewCourse) => void
23+
}) => {
1624
const { t, i18n } = useTranslation()
1725

1826
if (!course) return null

src/server/routes/admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ adminRouter.get('/statistics', async (req, res) => {
9393
}
9494

9595
const getTermsOf = ({ courseActivityPeriod }) => {
96-
const checkDateOverlap = (term, course) => new Date(term.startDate) <= new Date(course.endDate || '2112-12-21') && new Date(term.endDate) >= new Date(course.startDate)
96+
const checkDateOverlap = (term, course) =>
97+
new Date(term.startDate) <= new Date(course.endDate || '2112-12-21') && new Date(term.endDate) >= new Date(course.startDate)
9798

9899
if (!courseActivityPeriod) return []
99100

src/server/routes/openai.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ openaiRouter.post('/stream/v2', upload.single('file'), async (r, res) => {
183183

184184
const latestMessage = options.messages[options.messages.length - 1]
185185

186-
const events = await responsesClient.createResponse({ input: [latestMessage], prevResponseId: options.prevResponseId, include: ragIndexId ? ['file_search_call.results'] : [] })
186+
const events = await responsesClient.createResponse({
187+
input: [latestMessage],
188+
prevResponseId: options.prevResponseId,
189+
include: ragIndexId ? ['file_search_call.results'] : [],
190+
})
187191

188192
if (isError(events)) {
189193
res.status(424)

0 commit comments

Comments
 (0)