fix: resolve all JS-001 architecture warnings

- Exclude third-party vendor libraries from JS validation
- Add noqa: js-001 to core infrastructure files (log-config, api-client, utils, icons)
- Add centralized logger to vendor JS files (marketplace, letzshop, invoices, billing)
- Replace console.log/error/warn with logger calls
- Add noqa support to JS-001 rule in architecture validator

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 07:40:35 +01:00
parent d34021cfa2
commit b147c925d9
11 changed files with 66 additions and 50 deletions

View File

@@ -3,10 +3,12 @@
* Vendor invoice management page logic
*/
console.log('[VENDOR INVOICES] Loading...');
const invoicesLog = window.LogConfig?.createLogger('INVOICES') || console;
invoicesLog.info('[VENDOR INVOICES] Loading...');
function vendorInvoices() {
console.log('[VENDOR INVOICES] vendorInvoices() called');
invoicesLog.info('[VENDOR INVOICES] vendorInvoices() called');
return {
// Inherit base layout state
@@ -122,7 +124,7 @@ function vendorInvoices() {
} catch (error) {
// 404 means not configured yet, which is fine
if (error.status !== 404) {
console.error('[VENDOR INVOICES] Failed to load settings:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to load settings:', error);
}
this.hasSettings = false;
}
@@ -143,7 +145,7 @@ function vendorInvoices() {
cancelled_count: response.cancelled_count || 0
};
} catch (error) {
console.error('[VENDOR INVOICES] Failed to load stats:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to load stats:', error);
}
},
@@ -168,7 +170,7 @@ function vendorInvoices() {
this.invoices = response.items || [];
this.totalInvoices = response.total || 0;
} catch (error) {
console.error('[VENDOR INVOICES] Failed to load invoices:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to load invoices:', error);
this.error = error.message || 'Failed to load invoices';
} finally {
this.loading = false;
@@ -228,7 +230,7 @@ function vendorInvoices() {
this.hasSettings = true;
this.successMessage = 'Settings saved successfully';
} catch (error) {
console.error('[VENDOR INVOICES] Failed to save settings:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to save settings:', error);
this.error = error.message || 'Failed to save settings';
} finally {
this.savingSettings = false;
@@ -277,7 +279,7 @@ function vendorInvoices() {
await this.loadStats();
await this.loadInvoices();
} catch (error) {
console.error('[VENDOR INVOICES] Failed to create invoice:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to create invoice:', error);
this.error = error.message || 'Failed to create invoice';
} finally {
this.creatingInvoice = false;
@@ -308,7 +310,7 @@ function vendorInvoices() {
await this.loadStats();
await this.loadInvoices();
} catch (error) {
console.error('[VENDOR INVOICES] Failed to update status:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to update status:', error);
this.error = error.message || 'Failed to update invoice status';
}
setTimeout(() => this.successMessage = '', 5000);
@@ -362,7 +364,7 @@ function vendorInvoices() {
this.successMessage = `Downloaded: ${filename}`;
} catch (error) {
console.error('[VENDOR INVOICES] Failed to download PDF:', error);
invoicesLog.error('[VENDOR INVOICES] Failed to download PDF:', error);
this.error = error.message || 'Failed to download PDF';
} finally {
this.downloadingPdf = false;