refactor: standardize code formatting and linting configuration

- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
千羽
2025-08-07 18:19:31 +09:00
parent 4a0eba117c
commit 8a74bf5afe
124 changed files with 20878 additions and 18757 deletions

View File

@@ -2,51 +2,52 @@
* 检查 Redis 中的所有键
*/
const redis = require('../src/models/redis');
const redis = require('../src/models/redis')
async function checkRedisKeys() {
console.log('🔍 检查 Redis 中的所有键...\n');
console.log('🔍 检查 Redis 中的所有键...\n')
try {
// 确保 Redis 已连接
await redis.connect();
await redis.connect()
// 获取所有键
const allKeys = await redis.client.keys('*');
console.log(`找到 ${allKeys.length} 个键\n`);
const allKeys = await redis.client.keys('*')
console.log(`找到 ${allKeys.length} 个键\n`)
// 按类型分组
const keysByType = {};
allKeys.forEach(key => {
const prefix = key.split(':')[0];
const keysByType = {}
allKeys.forEach((key) => {
const prefix = key.split(':')[0]
if (!keysByType[prefix]) {
keysByType[prefix] = [];
keysByType[prefix] = []
}
keysByType[prefix].push(key);
});
keysByType[prefix].push(key)
})
// 显示各类型的键
Object.keys(keysByType).sort().forEach(type => {
console.log(`\n📁 ${type}: ${keysByType[type].length}`);
// 显示前 5 个键作为示例
const keysToShow = keysByType[type].slice(0, 5);
keysToShow.forEach(key => {
console.log(` - ${key}`);
});
if (keysByType[type].length > 5) {
console.log(` ... 还有 ${keysByType[type].length - 5}`);
}
});
Object.keys(keysByType)
.sort()
.forEach((type) => {
console.log(`\n📁 ${type}: ${keysByType[type].length}`)
// 显示前 5 个键作为示例
const keysToShow = keysByType[type].slice(0, 5)
keysToShow.forEach((key) => {
console.log(` - ${key}`)
})
if (keysByType[type].length > 5) {
console.log(` ... 还有 ${keysByType[type].length - 5}`)
}
})
} catch (error) {
console.error('❌ 错误:', error);
console.error(error.stack);
console.error('❌ 错误:', error)
console.error(error.stack)
} finally {
process.exit(0);
process.exit(0)
}
}
checkRedisKeys();
checkRedisKeys()