refactor: Convert project from JavaScript to TypeScript

- Converted all .js files to .ts
- Added TypeScript configuration (tsconfig.json)
- Added ESLint and Prettier configuration
- Updated package.json dependencies
- Modified Docker and application configurations
This commit is contained in:
2025-04-24 13:48:10 +08:00
parent 75185a59c3
commit 3c4dc51855
32 changed files with 1212 additions and 1004 deletions

27
.eslintrc.json Normal file
View File

@@ -0,0 +1,27 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json" // Point ESLint to your TS config
},
"plugins": [
"@typescript-eslint",
"prettier" // Integrates Prettier rules into ESLint
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended", // Recommended TS rules
"plugin:@typescript-eslint/recommended-requiring-type-checking", // Rules requiring type info
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier
],
"rules": {
// Add or override specific rules here if needed
"prettier/prettier": "warn", // Show Prettier issues as warnings
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], // Warn about unused vars, allow underscores
"@typescript-eslint/explicit-module-boundary-types": "off", // Allow inferred return types for now
"@typescript-eslint/no-explicit-any": "warn" // Warn about using 'any'
},
"ignorePatterns": ["node_modules/", "dist/", "data/", "*.db", "*.db-journal", "*.db-wal"]
}