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

@@ -185,7 +185,7 @@ class SelfUpdater extends EventEmitter {
const frontendSrc = this._findDir(stagingDir, 'status');
if (frontendSrc) {
await this._copyDir(frontendSrc, this.config.frontendDir, [
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js'
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js',
]);
this.emit('update-progress', { step: 'frontend-updated', version: remoteInfo.version });
}
@@ -209,7 +209,7 @@ class SelfUpdater extends EventEmitter {
};
await fsp.writeFile(
path.join(this.config.updatesDir, 'trigger.json'),
JSON.stringify(trigger, null, 2)
JSON.stringify(trigger, null, 2),
);
// The host-side systemd service will handle the rest.
@@ -312,7 +312,7 @@ class SelfUpdater extends EventEmitter {
this.status = 'waiting';
await fsp.writeFile(
path.join(this.config.updatesDir, 'trigger.json'),
JSON.stringify(trigger, null, 2)
JSON.stringify(trigger, null, 2),
);
this._addToHistory({
@@ -412,12 +412,12 @@ class SelfUpdater extends EventEmitter {
try {
resolve(JSON.parse(data));
} catch (e) {
reject(new Error('Invalid JSON from ' + url));
reject(new Error(`Invalid JSON from ${ url}`));
}
});
});
req.on('error', reject);
req.on('timeout', () => { req.destroy(); reject(new Error('Timeout fetching ' + url)); });
req.on('timeout', () => { req.destroy(); reject(new Error(`Timeout fetching ${ url}`)); });
});
}
@@ -459,7 +459,7 @@ class SelfUpdater extends EventEmitter {
try {
execSync(`tar xzf "${tarballPath}" -C "${destDir}" --strip-components=1`, { stdio: 'pipe' });
} catch (e) {
throw new Error('Failed to extract tarball: ' + e.message);
throw new Error(`Failed to extract tarball: ${ e.message}`);
}
}