Phase 1: Add ESLint/Prettier config + baseline auto-fixes

This commit is contained in:
Krystie
2026-03-22 11:00:25 +01:00
parent 41a0cdee7e
commit e2c67a8fe8
90 changed files with 4008 additions and 3066 deletions

View File

@@ -17,15 +17,15 @@ const colors = {
yellow: '\x1b[33m',
blue: '\x1b[34m',
cyan: '\x1b[36m',
magenta: '\x1b[35m'
magenta: '\x1b[35m',
};
let testResults = {
const testResults = {
passed: 0,
failed: 0,
warnings: 0,
total: 0,
details: []
details: [],
};
function log(message, color = 'reset') {
@@ -62,7 +62,7 @@ async function makeRequest(path, options = {}) {
path: url.pathname + url.search,
method: options.method || 'GET',
headers: options.headers || {},
timeout: options.timeout || 10000
timeout: options.timeout || 10000,
};
const req = http.request(requestOptions, (res) => {
@@ -74,7 +74,7 @@ async function makeRequest(path, options = {}) {
headers: res.headers,
body: data,
data: data && (data.startsWith('{') || data.startsWith('[')) ?
(() => { try { return JSON.parse(data); } catch(e) { return null; } })() : data
(() => { try { return JSON.parse(data); } catch(e) { return null; } })() : data,
});
});
});
@@ -143,7 +143,7 @@ async function testCSRFProtection() {
const response = await makeRequest('/api/test-endpoint', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: { test: 'data' }
body: { test: 'data' },
});
if (response.data?.error?.includes('CSRF') || response.data?.message?.includes('CSRF')) {
@@ -183,7 +183,7 @@ async function testRequestSizeLimits() {
const response = await makeRequest('/api/services', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(smallPayload)
body: JSON.stringify(smallPayload),
});
if (response.statusCode !== 413) {
@@ -465,7 +465,7 @@ async function runAllTests() {
.forEach(t => log(`${t.name}: ${t.message}`, 'yellow'));
}
log('\n' + '═'.repeat(60), 'cyan');
log(`\n${ '═'.repeat(60)}`, 'cyan');
if (testResults.failed === 0) {
log('\n✅ ALL AUTOMATED TESTS PASSED!', 'green');