chore: upgrade typescript-eslint to v8 and add eslint config

This commit is contained in:
fisherdaddy
2026-02-23 16:14:18 +08:00
parent 5ad07b423c
commit 63fd59ec8b
3 changed files with 48 additions and 4 deletions
+46
View File
@@ -0,0 +1,46 @@
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
plugins: [
'@typescript-eslint',
'react-refresh',
],
ignorePatterns: [
'dist/',
'dist-electron/',
'node_modules/',
'release/',
'build/',
'SKILLs/**',
'sandbox/**',
],
rules: {
'react-refresh/only-export-components': 'off',
'react-hooks/exhaustive-deps': 'off',
'no-control-regex': 'off',
'no-useless-escape': 'off',
'no-constant-condition': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
};
+2 -2
View File
@@ -78,8 +78,8 @@
"@types/react-dom": "^18.2.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/sql.js": "^1.4.9",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@typescript-eslint/eslint-plugin": "^8.56.0",
"@typescript-eslint/parser": "^8.56.0",
"@vitejs/plugin-react": "^4.2.1",
"7zip-bin": "^5.2.0",
"autoprefixer": "^10.4.17",
-2
View File
@@ -20,7 +20,6 @@ import { extractMediaFromMessage, cleanupOldMediaFiles } from './telegramMedia';
import { parseMediaMarkers } from './dingtalkMediaParser';
// Import node-fetch for HTTP requests (grammy's default)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nodeFetch = require('node-fetch');
/**
@@ -150,7 +149,6 @@ export class TelegramGateway extends EventEmitter {
this.bot = new Bot(config.botToken, {
client: {
// Use our custom fetch wrapper
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fetch: grammyFetch as any,
// Increase API timeout to 60 seconds for file uploads (default is 500s which is too long)
timeoutSeconds: 60,