Files
height_manager/client/eslint-formatter-simple.mjs
jaystar 28c4d7b3b4 feat: 实现减脂体重管理App完整功能
- 实现拍照识别食物功能(集成大语言模型视觉能力)
- 实现智能对话功能(集成大语言模型流式输出)
- 实现食物记录和卡路里管理功能
- 实现体重记录和统计功能
- 实现健康数据管理页面
- 配置数据库表结构(用户、食物记录、体重记录)
- 实现Express后端API路由
- 配置Tab导航和前端页面
- 采用健康运动配色方案
2026-02-02 15:17:50 +08:00

49 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export default function (results) {
return results
.flatMap(file =>
file.messages.map(m => {
// split into lines
const lines = m.message.split('\n');
// 第一行(句子):直接用
const first = lines[0];
// 附加解释:过滤掉所有 codeframe/箭头/行号/重复路径
const details = lines
.slice(1)
.filter(l => {
// 移除空行
if (!l.trim()) return false;
// 移除 "58 | xxx" 这样的行
if (/^\s*\d+\s*\|/.test(l)) return false;
// 移除 "> 60 | ..." 这样的箭头行
if (/^\s*>/.test(l)) return false;
// 移除只有箭头提示的行,如 "| ^^^^^"
if (/^\s*\|/.test(l)) return false;
// 移除 "…" 省略号行
if (/^\s*…/.test(l)) return false;
// 移除重复路径行eslint message 有时夹带 file:line
if (/\.tsx:\d+:\d+/.test(l)) return false;
return true;
})
.join('\n')
.trim();
let output = `${file.filePath}:${m.line}:${m.column} ${
m.severity === 2 ? 'error' : 'warn'
} ${first}`;
if (details) output += `\n${details}\n`;
return output;
})
)
.join('\n');
};