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:
@@ -1,4 +1,4 @@
|
||||
const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=el?JSON.parse(el.textContent):null;return v===undefined?null:v}catch(e){return null}})();
|
||||
const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=el?JSON.parse(el.textContent):null;return v===undefined?null:v}catch{return null}})();
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
@@ -47,7 +47,7 @@ const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=
|
||||
var PALETTE = {gray:'#8b8b8b',brown:'#9f6b53',orange:'#d9730d',yellow:'#cb912f',green:'#448361',blue:'#337ea9',purple:'#9065b0',pink:'#c14c8a',red:'#d44c47'};
|
||||
|
||||
function escHtml(s) { return String(s==null?'':s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); }
|
||||
function parseJSON(s, d) { try { return typeof s === 'string' ? JSON.parse(s) : (s || d); } catch(e) { return d; } }
|
||||
function parseJSON(s, d) { try { return typeof s === 'string' ? JSON.parse(s) : (s || d); } catch { return d; } }
|
||||
function parseOpts(prop) {
|
||||
var o = parseJSON(prop.options_json, []);
|
||||
if (!Array.isArray(o)) o = [];
|
||||
@@ -57,7 +57,6 @@ const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=
|
||||
var found = parseOpts(prop).filter(function(o){ return o.name === name; })[0];
|
||||
return (found && PALETTE[found.color]) || '#8b8b8b';
|
||||
}
|
||||
function uid() { return 'dbx' + Math.random().toString(36).slice(2,9); }
|
||||
function getCsrf() { var m = document.cookie.match(/csrf_token=([^;]+)/); return m ? m[1] : ''; }
|
||||
function toast(msg, kind) {
|
||||
if (typeof window.showToast === 'function') window.showToast(msg, kind);
|
||||
@@ -167,7 +166,6 @@ const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=
|
||||
if (ref === undefined || ref === null || ref === '') return null;
|
||||
return state.properties.filter(function(p){ return String(p.id) === String(ref) || p.name === ref; })[0] || null;
|
||||
}
|
||||
function propName(ref) { var p = findProp(ref); return p ? p.name : ''; }
|
||||
function firstPropOfTypes(types) {
|
||||
return state.properties.filter(function(p){ return types.indexOf(p.prop_type) >= 0; })[0] || null;
|
||||
}
|
||||
@@ -321,7 +319,7 @@ const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=
|
||||
h += '<th class="db-th db-th-handle" style="width:32px;min-width:32px"></th>';
|
||||
props.forEach(function(prop){
|
||||
var w = state.colWidths[prop.id] || 200;
|
||||
var groupIdx = 0; var acc = 0;
|
||||
var groupIdx = 0;
|
||||
groups.forEach(function(g, gi){ if (g.props.indexOf(prop) >= 0) groupIdx = gi; });
|
||||
var collapsed = hasGroups && state.collapsedGroups[groupIdx];
|
||||
h += '<th class="db-th db-th-property" data-colgroup="'+groupIdx+'" style="'+(collapsed?'display:none;':'')+'min-width:'+w+'px;width:'+w+'px" data-prop-id="'+prop.id+'">';
|
||||
@@ -523,7 +521,6 @@ const DB_CONFIG=(()=>{try{const el=document.getElementById('db-config');const v=
|
||||
if (!dp) return '<div style="padding:24px;color:var(--text-dim)">Add a Date property to use the calendar view.</div>';
|
||||
var mode = calMode();
|
||||
var cur = state.calCursor;
|
||||
var today = new Date();
|
||||
var h = '<div class="db-cal-head">';
|
||||
h += '<div class="db-cal-nav"><button data-cal-prev="1">\u2039</button><button data-cal-next="1">\u203a</button></div>';
|
||||
var title;
|
||||
|
||||
Reference in New Issue
Block a user