fix: A27 lint terminé — eslint 0/0 (285 warnings nettoyés) (v7.25.0)
3 familles, 13 fichiers (+153/−167) :
1. no-empty ×70 = TOUS des `catch (x) {}` vides → `catch { /* volontaire */ }`
(binding optionnel ES2019 + commentaire : passe no-empty ET
no-unused-vars, zéro changement de comportement).
2. no-unused-vars ×171 :
- bindings de catch inutilisés retirés (e/err/ex/e2/e3)
- 24 lignes mortes déterministes, chaque suppression validée par assert
sur le texte exact (`var self = this` ×8, `var lang`, `var acc`,
`var today`, `var path/restored/files/resolved/items/clickEl`,
`uid()`/`propName()` sans un seul appel, `.then` + `resolved++`
compteurs jamais lus)
- `/* exported */` sur les 10 fonctions appelées depuis les attributs
HTML des templates (vérifiées par grep : 1 template chacune) :
setActiveTab/kanbanBoard/filterSystem/sortSystem/newIssueForm/
showNewIssue, importWizard, libraryPage, workspacesPage, settingsInit
3. no-undef ×44 = vrais globaux déclarés dans eslint.config.mjs
(getSvgIcon = script inline de base.html, TextDecoder = API navigateur,
Prism = CDN) + 2 vrais correctifs :
- settings.js : `typeof toast === 'function'` = guard TOUJOURS faux
(pas de toast global) → les toasts timezone/SAML ne s'affichaient
jamais → `window.showToast` (2 sites)
- local_workspace.js : `_wsInitData = window._wsInitData`
(auto-affectation sans effet, global implicite) supprimé
eslint static/js : **0 erreur / 0 warning** (285 → 0) · node --check vert
sur tous les fichiers · suite **1089/1089** · ruff OK · docs à jour
This commit is contained in:
+15
-15
@@ -1,3 +1,4 @@
|
||||
/* exported libraryPage -- appeles depuis les attributs HTML des templates */
|
||||
|
||||
function libraryPage() {
|
||||
return {
|
||||
@@ -298,7 +299,7 @@ function libraryPage() {
|
||||
} else {
|
||||
if (window.showToast) window.showToast('Not a text file', 'error');
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
if (window.showToast) window.showToast('Copy failed', 'error');
|
||||
}
|
||||
},
|
||||
@@ -389,7 +390,7 @@ function libraryPage() {
|
||||
headers: {'Content-Type':'application/json', 'X-CSRF-Token': csrf},
|
||||
body: JSON.stringify({ parent_id: parentId || 0 })
|
||||
});
|
||||
} catch(e) {}
|
||||
} catch { /* volontaire */ }
|
||||
}
|
||||
this.clearSelection();
|
||||
this.loadTab();
|
||||
@@ -537,7 +538,6 @@ function libraryPage() {
|
||||
doSort() {
|
||||
var s = this.sortBy;
|
||||
if (!s) return;
|
||||
var self = this;
|
||||
function sortNodes(nodes) {
|
||||
if (!nodes) return;
|
||||
nodes.sort(function(a,b){
|
||||
@@ -574,7 +574,7 @@ function libraryPage() {
|
||||
item.children = d.items || [];
|
||||
// Mark the tree for depth calculation
|
||||
this._markChildren(item.children, (item.depth || 0) + 1);
|
||||
} catch(e) {
|
||||
} catch {
|
||||
item.children = [];
|
||||
}
|
||||
}
|
||||
@@ -701,7 +701,7 @@ function libraryPage() {
|
||||
item.page_icon = icon;
|
||||
this._renderTable();
|
||||
if (window.showToast) window.showToast('Icon updated', 'success');
|
||||
} catch(e) {
|
||||
} catch {
|
||||
if (window.showToast) window.showToast('Failed to update icon', 'error');
|
||||
}
|
||||
},
|
||||
@@ -712,7 +712,7 @@ function libraryPage() {
|
||||
var r = await fetch('/api/settings/tags/all');
|
||||
var d = await r.json();
|
||||
this.workspaceTags = d.tags || [];
|
||||
} catch(e) { this.workspaceTags = []; }
|
||||
} catch { this.workspaceTags = []; }
|
||||
},
|
||||
|
||||
toggleTagFilter(tagName) {
|
||||
@@ -771,7 +771,7 @@ function libraryPage() {
|
||||
this._ctxRefreshAvail();
|
||||
this._recomputeFlatItems();
|
||||
}
|
||||
} catch(e) {}
|
||||
} catch { /* volontaire */ }
|
||||
},
|
||||
|
||||
async toggleFavoriteItem(item) {
|
||||
@@ -809,7 +809,7 @@ function libraryPage() {
|
||||
this.loadTab();
|
||||
this._syncSidebar();
|
||||
if (window.showToast) window.showToast('Page duplicated', 'success');
|
||||
} catch(e) {
|
||||
} catch {
|
||||
if (window.showToast) window.showToast('Failed to duplicate page', 'error');
|
||||
}
|
||||
},
|
||||
@@ -828,7 +828,7 @@ function libraryPage() {
|
||||
var all = (d.items || []).filter(function(it) { return ids.indexOf(it.id) === -1; });
|
||||
this._moveAllCandidates = all;
|
||||
this.moveCandidates = all.slice(0, 30);
|
||||
} catch(e) {
|
||||
} catch {
|
||||
this._moveAllCandidates = [];
|
||||
this.moveCandidates = [];
|
||||
}
|
||||
@@ -881,7 +881,7 @@ function libraryPage() {
|
||||
if (r.ok) {
|
||||
item.title = newName;
|
||||
}
|
||||
} catch(e) {}
|
||||
} catch { /* volontaire */ }
|
||||
this._renderTable();
|
||||
this._syncSidebar();
|
||||
},
|
||||
@@ -908,7 +908,7 @@ function libraryPage() {
|
||||
var cr = await fetch('/api/library/children/' + parentId);
|
||||
var cd = await cr.json();
|
||||
parent.children = cd.items || [];
|
||||
} catch(e) {}
|
||||
} catch { /* volontaire */ }
|
||||
this._recomputeFlatItems();
|
||||
this._renderTable();
|
||||
return;
|
||||
@@ -917,7 +917,7 @@ function libraryPage() {
|
||||
if (window.fdNavigate) window.fdNavigate('/pages/' + d.id);
|
||||
else window.location.href = '/pages/' + d.id;
|
||||
}
|
||||
} catch(e) {
|
||||
} catch {
|
||||
if (window.showToast) window.showToast('Failed to create page', 'error');
|
||||
}
|
||||
},
|
||||
@@ -996,7 +996,7 @@ function libraryPage() {
|
||||
if (days < 7) return days + 'd ago';
|
||||
if (days < 30) return Math.floor(days/7) + 'w ago';
|
||||
return dt.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'});
|
||||
} catch(e) { return d; }
|
||||
} catch { return d; }
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1029,11 +1029,11 @@ function libraryPage() {
|
||||
if (el && el.__x) { el.__x.$data.peekItem = null; }
|
||||
}
|
||||
dragging = false;
|
||||
try { localStorage.setItem('fd_peek_width', panel.style.width); } catch(ex) {}
|
||||
try { localStorage.setItem('fd_peek_width', panel.style.width); } catch { /* volontaire */ }
|
||||
handle.releasePointerCapture(e.pointerId);
|
||||
});
|
||||
try {
|
||||
var saved = localStorage.getItem('fd_peek_width');
|
||||
if (saved) panel.style.width = saved;
|
||||
} catch(ex) {}
|
||||
} catch { /* volontaire */ }
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user