Skip to content

Commit babdb60

Browse files
committed
fix: resolve lint errors in webhook and tools-data
- Replaced 'any' types with proper Record types - Removed unused error variable - Added eslint-disable comment for require import - All lint checks passing
1 parent ed37413 commit babdb60

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/api/telegram-webhook/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function POST(request: NextRequest) {
4040

4141
function parseToolFromMessage(text: string) {
4242
const lines = text.split('\n')
43-
const data: any = {}
43+
const data: Record<string, string> = {}
4444

4545
lines.forEach(line => {
4646
if (line.includes('*İsim:*')) data.name = line.split('*İsim:*')[1].trim()
@@ -61,14 +61,14 @@ function parseToolFromMessage(text: string) {
6161
return data
6262
}
6363

64-
async function addPendingTool(toolData: any) {
64+
async function addPendingTool(toolData: Record<string, string | boolean>) {
6565
const filePath = path.join(process.cwd(), 'lib', 'pending-tools.json')
6666
let pendingTools = []
6767

6868
try {
6969
const fileContent = fs.readFileSync(filePath, 'utf-8')
7070
pendingTools = JSON.parse(fileContent)
71-
} catch (error) {
71+
} catch {
7272
// File doesn't exist or is empty
7373
}
7474

lib/tools-data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface Tool {
1515
// Pending tools'u yükle
1616
let pendingTools: Tool[] = []
1717
try {
18+
// eslint-disable-next-line @typescript-eslint/no-require-imports
1819
pendingTools = require('./pending-tools.json')
1920
} catch {
2021
// Dosya yoksa boş array

0 commit comments

Comments
 (0)