chore: reduce frontend lint warnings
Web Quality / verify (push) Has been cancelled

This commit is contained in:
2026-06-09 12:02:30 +08:00
parent f322679d4a
commit 4a298d205b
35 changed files with 82 additions and 158 deletions
+8 -3
View File
@@ -27,7 +27,6 @@ console.log(' 1. MODULE DEPENDENCY GRAPH ANALYSIS');
console.log('═══════════════════════════════════════════════');
const importMap = new Map(); // file -> [imports]
const importedBy = new Map(); // file -> [importers]
for (const r of results) {
const imports = [];
@@ -71,10 +70,13 @@ function findCircular(file, visited = new Set(), path = []) {
}
}
}
for (const file of importMap.keys()) {
findCircular(file);
}
// Check high-fanin files (imported by many)
const fanIn = new Map();
for (const [file, imports] of importMap) {
for (const imports of importMap.values()) {
for (const imp of imports) {
const key = imp.replace(/\[dynamic\]/, '');
fanIn.set(key, (fanIn.get(key) || 0) + 1);
@@ -101,7 +103,7 @@ for (const [file, count] of sortedFanOut) {
// Dynamic imports analysis (lazy loading effectiveness)
console.log('\n--- Lazy Loading (Dynamic Imports) ---');
let dynamicImports = 0, staticImports = 0;
for (const [file, imports] of importMap) {
for (const imports of importMap.values()) {
for (const imp of imports) {
if (imp.startsWith('[dynamic]')) dynamicImports++;
else staticImports++;
@@ -177,6 +179,9 @@ for (const r of results) {
if (noDeps > 0) {
console.log(` [RENDER-COST] ${r.file}: ${noDeps} useEffect(s) run EVERY render`);
}
if (emptyDeps > 0) {
console.log(` [MOUNT-EFFECT] ${r.file}: ${emptyDeps} useEffect(s) run on mount only`);
}
}
// ─── 4. Zustand Store Analysis ───