Skip to content

Commit 11d7d5c

Browse files
committed
took care of all the eslint errors o.o
1 parent 95c2fe0 commit 11d7d5c

36 files changed

+167
-168
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "quasar build",
1010
"dev": "quasar dev",
1111
"format": "prettier --write \"**/*.{js,ts,vue,,html,md,json}\" --ignore-path .gitignore",
12-
"lint": "eslint -c ./eslint.config.js './src*/**/*.{ts,js,cjs,mjs,vue}'"
12+
"lint": "tsc --noEmit && eslint -c ./eslint.config.js './src*/**/*.{ts,js,cjs,mjs,vue}'"
1313
},
1414
"browserslist": [
1515
"last 10 Chrome versions",

postcss.config.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module.exports = {
44
plugins: [
55
// to edit target browsers: use "browserslist" field in package.json
6+
// eslint-disable-next-line @typescript-eslint/no-require-imports
67
require('autoprefixer')
78
]
89
}

quasar.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default defineConfig((ctx) => {
163163
typescript: {
164164
strict: true, // (recommended) enables strict settings for TypeScript
165165
vueShim: true, // required when using ESLint with type-checked rules, will generate a shim file for `*.vue` files
166-
extendTsConfig(tsConfig) {
166+
extendTsConfig(/*tsConfig*/) {
167167
// You can use this hook to extend tsConfig dynamically
168168
// For basic use cases, you can still update the usual tsconfig.json file to override some settings
169169
},
@@ -197,6 +197,7 @@ export default defineConfig((ctx) => {
197197
},
198198
extendWebpack(
199199
cfg,
200+
// eslint-disable-next-line no-empty-pattern
200201
{
201202
/*isServer, isClient*/
202203
},

src-ssr/middlewares/gdriveProxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineSsrMiddleware } from '#q-app/wrappers'
22
import type { Request, Response } from 'express'
3-
import type { AxiosError } from 'axios';
3+
import type { AxiosError } from 'axios'
44
import axios from 'axios'
55

66
const { GOOGLE_API_KEY } = process.env
@@ -49,7 +49,7 @@ const handleProxyRequest = async (req: Request, res: Response) => {
4949
await fetchGoogleDriveFile(fileId, res)
5050
}
5151

52-
export default defineSsrMiddleware(async ({ app }) => {
52+
export default defineSsrMiddleware(({ app }) => {
5353
console.log('prepare gdrive proxy')
5454
app.get('/proxy/gdrive/:fileId', handleProxyRequest)
5555
})

src/components/taskyon/ChatSidebar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ async function updateName(id: string) {
135135

136136
watch(
137137
[() => state.llmSettings.selectedTaskId, () => state.chatHistory],
138-
async ([newTaskId, newChatHistory]) => {
138+
([newTaskId, newChatHistory]) => {
139139
console.log('updating sidebar chat list')
140140
if (newTaskId) {
141141
conversationIDs.value = newChatHistory.slice(0, 10)
142-
conversationIDs.value.forEach((id) => updateName(id))
142+
conversationIDs.value.forEach((id) => void updateName(id))
143143
}
144144
},
145145
{

src/components/taskyon/FileBrowser.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const loadAllPreviews = async () => {
7878
watch(
7979
() => props.fileMappings,
8080
() => {
81-
loadAllPreviews()
81+
void loadAllPreviews()
8282
},
8383
{
8484
immediate: true,

src/components/taskyon/SyncTaskyon.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async function onUpdateAppConfiguration() {
251251
}
252252
253253
async function onSyncGdrive() {
254-
saveObjToGdrive(
254+
await saveObjToGdrive(
255255
{
256256
llmSettings: state.llmSettings,
257257
appConfiguration: state.appConfiguration,

src/components/taskyon/TableOfChatContent.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ async function updateToc(newTaskId: string) {
5353
}
5454

5555
if (state.llmSettings.selectedTaskId) {
56-
updateToc(state.llmSettings.selectedTaskId)
56+
void updateToc(state.llmSettings.selectedTaskId)
5757
}
5858

5959
watch(
6060
() => state.llmSettings.selectedTaskId,
61-
async (newTaskId) => {
61+
(newTaskId) => {
6262
if (newTaskId) {
63-
updateToc(newTaskId)
63+
void updateToc(newTaskId)
6464
}
6565
},
6666
)

src/components/taskyon/TaskChainMenu.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function onDeleteThread(conversationId: string) {
3838
console.log('deleting thread!!', conversationId)
3939
const tm = await tystate.getTaskManager()
4040
state.llmSettings.selectedTaskId = undefined
41-
tm.deleteTaskThread(conversationId)
41+
await tm.deleteTaskThread(conversationId)
4242
state.chatHistory = state.chatHistory.filter((id) => id != conversationId)
4343
}
4444

src/components/taskyon/TaskChainPublishDialog.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ async function onExportPublicGdrive(conversationId: string) {
170170
}
171171
}
172172
173-
async function onExportIpfs(conversationId: string) {
173+
function onExportIpfs(conversationId: string) {
174174
console.log('export to ipfs', conversationId)
175175
}
176176
@@ -184,7 +184,7 @@ async function onExportChatMD(conversationId: string, clipBoard = false) {
184184
const mimeType = 'text/markdown; charset=UTF-8'
185185
186186
if (clipBoard) {
187-
copyToClipboard(taskThreadMd)
187+
void copyToClipboard(taskThreadMd)
188188
} else {
189189
// Use Quasar's exportFile function for download
190190
exportFile(fileName, taskThreadMd, mimeType)

src/components/taskyon/TaskyonHeader.vue

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ const environmentInfo = () => ({
250250
supportsServiceWorker: typeof navigator !== 'undefined' && 'serviceWorker' in navigator,
251251
supportsES6: (() => {
252252
try {
253+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
253254
new Function('(a = 0) => a')
254255
return true
255256
} catch {

src/modules/gdrive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export const useGdrive = () => {
148148
const jsonString = JSON.stringify(obj)
149149
const fileBlob = new Blob([jsonString], { type: 'application/json' })
150150

151-
saveFileToGdrive(fileBlob, directory, filename)
151+
await saveFileToGdrive(fileBlob, directory, filename)
152152
}
153153

154154
async function loadFileFromGdrive(directory: string, fileName: string) {

src/modules/pyodide.ts

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function convertRes2Js(result: unknown) {
105105
} else if ('toString' in result) {
106106
// Fallback to using toString() for other types of objects
107107
try {
108+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
108109
convres = result.toString()
109110
} catch (error) {
110111
console.error('Error converting Python object to string', error)

src/modules/pyodide.worker.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { PyProxy} from 'pyodide';
1+
import type { PyProxy } from 'pyodide'
22
import { loadPyodide, type PyodideInterface } from 'pyodide'
3-
import type { PythonScriptResult} from './pyodide';
3+
import type { PythonScriptResult } from './pyodide'
44
import { executeScript } from './pyodide'
55
import { expose } from 'comlink'
66

@@ -36,7 +36,7 @@ async function getPyodide() {
3636
}
3737

3838
const pythonWorker = {
39-
async runPythonScript(script: string, params?: unknown[]) {
39+
async runPythonScript(this: void, script: string, params?: unknown[]) {
4040
const pyodide = await getPyodide()
4141
let result: PythonScriptResult
4242

src/modules/taskyon/chat.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ export async function callLLM(
172172
// Check for non-OK status codes and throw error
173173
if (!response.ok) {
174174
const errorData = await response.json()
175-
throw {
176-
message: `Fetching answer from AI Api failed at attempt ${attempt}/${maxRetries}
175+
throw new TaskProcessingError(
176+
`Fetching answer from AI Api failed at attempt ${attempt}/${maxRetries}
177177
with status ${response.status}: ${response.statusText}`,
178-
details: { errorData },
179-
}
178+
{ errorData },
179+
)
180180
}
181181

182182
if (stream && response.body) {
@@ -224,10 +224,7 @@ export async function callLLM(
224224
// Call the callback function to process the chunk
225225
contentCallBack(jsonChunk)
226226
} catch (err) {
227-
throw {
228-
message: `Failed to parse chunk; ${jsonString}`,
229-
details: { err },
230-
}
227+
throw new TaskProcessingError(`Failed to parse chunk; ${jsonString}`, { err })
231228
}
232229
}
233230
}

src/modules/taskyon/ipfs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const getIpfsNode = (() => {
5555
}
5656
})()
5757

58-
const getConnectedPeers = async (node: IpfsNode) => {
58+
const getConnectedPeers = (node: IpfsNode) => {
5959
const peers = node.libp2p.getPeers()
6060
/*for (const peer of peers) {
6161
const peerEl = document.createElement('li');
@@ -83,7 +83,7 @@ export async function exportToIpfs(node: IpfsNode, txt: string) {
8383
const s = strings(node)
8484

8585
const myImmutableAddress = await s.add(txt)
86-
node.routing.provide(myImmutableAddress)
86+
void node.routing.provide(myImmutableAddress)
8787

8888
console.log('exported string to IPFS using CID:', myImmutableAddress.toString())
8989
//console.log(await s.get(myImmutableAddress));
@@ -122,7 +122,7 @@ export const fetchNodeStatus = async (
122122
) => {
123123
try {
124124
const metrics = node.metrics
125-
const connectedPeers = await getConnectedPeers(node)
125+
const connectedPeers = getConnectedPeers(node)
126126

127127
const info: Record<string, unknown> = {
128128
peerId: node.libp2p.peerId.toString(),

src/modules/taskyon/nlp.worker.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,22 @@ export async function countToolTokens(functionList: ToolBase[]) {
6262

6363
const nlpWorker = {
6464
// TODO: make sure, we don't reload models & tokenizers all the time!!
65-
async vectorizeText(text: string, modelName: string) {
65+
async vectorizeText(this: void, text: string, modelName: string) {
6666
return await getVector(text, modelName)
6767
},
6868

69-
async loadVecTokenizer(modelName: string) {
69+
async loadVecTokenizer(this: void, modelName: string) {
7070
await loadTokenizer(modelName)
7171
console.log('tokenizer loaded:', modelName)
7272
},
7373

74-
async loadVecModel(modelName: string) {
74+
async loadVecModel(this: void, modelName: string) {
7575
await loadModel(modelName)
7676
console.log('model loaded:', modelName)
7777
},
7878

7979
async estimateChatTokens(
80+
this: void,
8081
task: TaskNode,
8182
chat: OpenAI.Chat.Completions.ChatCompletionMessageParam[],
8283
tools: Record<string, ToolBase>,

src/modules/taskyon/rxdb.ts

+19-17
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,25 @@ export async function createTaskyonDatabase(): Promise<TaskyonDatabase> {
249249
await db.addCollections(collections)
250250

251251
//here we do te migration from or old storage
252-
import('rxdb-old/plugins/storage-dexie').then(({ getRxStorageDexie: getRxStorageDexieOld }) => {
253-
migrateStorage({
254-
database: db as unknown as RxDatabase,
255-
/**
256-
* Name of the old database,
257-
* using the storage migration requires that the
258-
* new database has a different name.
259-
*/
260-
oldDatabaseName: 'taskyondb',
261-
oldStorage: getRxStorageDexieOld(), // RxStorage of the old database
262-
batchSize: 500, // batch size
263-
parallel: false, // <- true if it should migrate all collections in parallel. False (default) if should migrate in serial
264-
afterMigrateBatch: (/*input: AfterMigrateBatchHandlerInput*/) => {
265-
console.log('storage migration: batch processed')
266-
},
267-
})
268-
})
252+
await import('rxdb-old/plugins/storage-dexie').then(
253+
({ getRxStorageDexie: getRxStorageDexieOld }) => {
254+
void migrateStorage({
255+
database: db as unknown as RxDatabase,
256+
/**
257+
* Name of the old database,
258+
* using the storage migration requires that the
259+
* new database has a different name.
260+
*/
261+
oldDatabaseName: 'taskyondb',
262+
oldStorage: getRxStorageDexieOld(), // RxStorage of the old database
263+
batchSize: 500, // batch size
264+
parallel: false, // <- true if it should migrate all collections in parallel. False (default) if should migrate in serial
265+
afterMigrateBatch: (/*input: AfterMigrateBatchHandlerInput*/) => {
266+
console.log('storage migration: batch processed')
267+
},
268+
})
269+
},
270+
)
269271

270272
return db
271273
}

src/modules/taskyon/taskManager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const initAddTask2Tree =
126126
selector: { name: task.name },
127127
})
128128
if (tasks.length > 0) {
129-
throw `The task ${task.name} already exists!`
129+
throw new Error(`The task ${task.name} already exists!`)
130130
}
131131
}
132132

@@ -757,7 +757,7 @@ export function useTyTaskManager(
757757
}
758758

759759
// Delete the current task
760-
deleteTask(currentTaskId)
760+
void deleteTask(currentTaskId)
761761

762762
if (currentTask.priorID) {
763763
// Move to the parent task

0 commit comments

Comments
 (0)