Add Prettier and ESLint tooling (Refs #77)

This commit is contained in:
2026-10-09 15:56:13 -04:00
parent 8ed059b8d3
commit 16469e2d43
711 changed files with 99737 additions and 28286 deletions
+8 -3
View File
@@ -4,7 +4,8 @@ import SettingsEditor from '../../src/lib/ui/components/SettingsEditor.svelte';
import { defaultFleetSettings } from '../../src/lib/fleet-settings.js';
vi.mock('$app/navigation', () => ({ beforeNavigate: vi.fn(), goto: vi.fn() }));
const html = (initial = defaultFleetSettings) => render(SettingsEditor, { props: { initial } }).body.replaceAll(/<!--.*?-->/g, '');
const html = (initial = defaultFleetSettings) =>
render(SettingsEditor, { props: { initial } }).body.replaceAll(/<!--.*?-->/g, '');
describe('grouped Settings editor', () => {
it('shows one section with meaningful defaults, and keeps every category reachable from the rail and mobile selector', () => {
@@ -27,7 +28,9 @@ describe('grouped Settings editor', () => {
expect(body).not.toContain('class="changed-marker"');
expect(body).toMatch(/<input[^>]*id="setting-preparationConcurrency"[^>]*value="7"/);
expect(body).toMatch(/<button[^>]*disabled[^>]*>[\s\S]*?<span[^>]*>Discard<\/span>/);
expect(body).toMatch(/<button[^>]*type="submit"[^>]*form="[^"]+"[^>]*disabled[^>]*>Save changes<\/button>/);
expect(body).toMatch(
/<button[^>]*type="submit"[^>]*form="[^"]+"[^>]*disabled[^>]*>Save changes<\/button>/
);
});
it('keeps zero-mode controls labelled and cleanup tools outside the one settings form', () => {
@@ -35,7 +38,9 @@ describe('grouped Settings editor', () => {
expect(body).toMatch(/<label[^>]*for="setting-restartConcurrencyPerHost-zero"/);
expect(body).toMatch(/<input[^>]*id="setting-restartConcurrencyPerHost-zero"[^>]*checked/);
expect(body.match(/<form\b/g)).toHaveLength(1);
expect(body.indexOf('</form>')).toBeLessThan(body.indexOf('Cleanup preview and protected records'));
expect(body.indexOf('</form>')).toBeLessThan(
body.indexOf('Cleanup preview and protected records')
);
expect(body).toContain('Expired data cannot be restored by increasing retention.');
expect(body).toContain('Player safety checks still apply.');
});