Prettier - add trailing commas

This commit is contained in:
Fred Boniface 2024-04-30 11:18:21 +01:00
parent 1fba04b2aa
commit 0d0875f893
30 changed files with 75 additions and 75 deletions

View File

@ -6,20 +6,20 @@ module.exports = {
parserOptions: { parserOptions: {
sourceType: "module", sourceType: "module",
ecmaVersion: 2020, ecmaVersion: 2020,
extraFileExtensions: [".svelte"] extraFileExtensions: [".svelte"],
}, },
env: { env: {
browser: true, browser: true,
es2017: true, es2017: true,
node: true node: true,
}, },
overrides: [ overrides: [
{ {
files: ["*.svelte"], files: ["*.svelte"],
parser: "svelte-eslint-parser", parser: "svelte-eslint-parser",
parserOptions: { parserOptions: {
parser: "@typescript-eslint/parser" parser: "@typescript-eslint/parser",
} },
} },
] ],
}; };

View File

@ -4,7 +4,7 @@
title: "Uninitialised", title: "Uninitialised",
action: "/", action: "/",
placeholder: "Uninitialised", placeholder: "Uninitialised",
queryName: "uninitiailsed" queryName: "uninitiailsed",
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
import Island from "$lib/islands/island.svelte"; import Island from "$lib/islands/island.svelte";
import { ql } from "$lib/stores/quick-links"; import { ql } from "$lib/stores/quick-links";
export let variables = { export let variables = {
title: "Quick Links" title: "Quick Links",
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
import Island from "$lib/islands/island.svelte"; import Island from "$lib/islands/island.svelte";
import { ql } from "$lib/stores/quick-links"; import { ql } from "$lib/stores/quick-links";
export let variables = { export let variables = {
title: "Quick Links" title: "Quick Links",
}; };
let qlData: string[] = []; let qlData: string[] = [];

View File

@ -10,11 +10,11 @@
export let resultObject: resultObj = { export let resultObject: resultObj = {
results: true, results: true,
title: "", title: "",
resultLines: [] resultLines: [],
}; };
let variables = { let variables = {
title: resultObject.title title: resultObject.title,
}; };
</script> </script>

View File

@ -16,8 +16,8 @@ export async function fetchStaffLdb(station: string): Promise<ApiResponse<StaffL
const fetchOpts = { const fetchOpts = {
method: "GET", method: "GET",
headers: { headers: {
uuid: uuid_value uuid: uuid_value,
} },
}; };
const res = await fetch(url, fetchOpts); const res = await fetch(url, fetchOpts);
unsubscribe(); unsubscribe();

View File

@ -12,7 +12,7 @@
let errorDetail = { let errorDetail = {
code: "", code: "",
message: "" message: "",
}; };
let nrcc: string[] = []; let nrcc: string[] = [];

View File

@ -56,7 +56,7 @@
other: otherArr.join(" "), other: otherArr.join(" "),
arr: arrArr.join(" "), arr: arrArr.join(" "),
dep: depArr.join(" "), dep: depArr.join(" "),
plat: platArr.join(" ") plat: platArr.join(" "),
}; };
} }

View File

@ -9,7 +9,7 @@
uid: "", uid: "",
rid: "", rid: "",
headcode: "", headcode: "",
show: true show: true,
}; };
export let close; export let close;
@ -24,8 +24,8 @@
const opt = { const opt = {
method: "GET", method: "GET",
headers: { headers: {
uuid: $uuid uuid: $uuid,
} },
}; };
const data = await fetch(url, opt); const data = await fetch(url, opt);
return await data.json(); return await data.json();
@ -56,7 +56,7 @@
} }
return { return {
string: string, string: string,
state: state state: state,
}; };
} }
@ -87,7 +87,7 @@
aEst: parsedEta ? "estimate" : "", aEst: parsedEta ? "estimate" : "",
std: parsedStd || "-", std: parsedStd || "-",
eatd: parsedEtd || parsedAtd || "-", eatd: parsedEtd || parsedAtd || "-",
dEst: parsedEtd ? "estimate" : "" dEst: parsedEtd ? "estimate" : "",
}; };
if (service.isCancelled) { if (service.isCancelled) {
(parsedEta = "CANC"), (parsedEtd = "CANC"); (parsedEta = "CANC"), (parsedEtd = "CANC");

View File

@ -12,7 +12,7 @@ export function detailInit(): Detail {
show: false, show: false,
headcode: "", headcode: "",
rid: "", rid: "",
uid: "" uid: "",
}; };
return detail; return detail;
} }
@ -23,7 +23,7 @@ export function defineDetail(rid: string, uid: string, tid: string) {
rid: rid, rid: rid,
uid: uid, uid: uid,
headcode: tid, headcode: tid,
show: true show: true,
}; };
return detail; return detail;
} }

View File

@ -32,18 +32,18 @@ async function checkUuid(): Promise<uuidCheckRes> {
uuid_value = value; uuid_value = value;
}); });
let res: uuidCheckRes = { let res: uuidCheckRes = {
uuidValue: uuid_value uuidValue: uuid_value,
}; };
console.log("uuid-value is: ", uuid_value); console.log("uuid-value is: ", uuid_value);
if (uuid_value && uuid_value != "null") { if (uuid_value && uuid_value != "null") {
res = { res = {
uuidPresent: true, uuidPresent: true,
uuidValue: uuid_value uuidValue: uuid_value,
}; };
} else { } else {
res = { res = {
uuidPresent: false, uuidPresent: false,
uuidValue: uuid_value uuidValue: uuid_value,
}; };
} }
unsubscribe(); unsubscribe();
@ -55,8 +55,8 @@ async function checkServerAuth(uuidString: string) {
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: uuidString uuid: uuidString,
} },
}; };
const res = await fetch(url, options); const res = await fetch(url, options);
let ok: boolean; let ok: boolean;
@ -67,7 +67,7 @@ async function checkServerAuth(uuidString: string) {
} }
return { return {
authOk: ok, authOk: ok,
status: res.status status: res.status,
}; };
} }

View File

@ -3,8 +3,8 @@
{ {
title: "Home", title: "Home",
path: "/", path: "/",
icon: IconHome icon: IconHome,
} },
]; ];
import { page } from "$app/stores"; import { page } from "$app/stores";
import { IconHome } from "@tabler/icons-svelte"; import { IconHome } from "@tabler/icons-svelte";

View File

@ -3,18 +3,18 @@
{ {
title: "Home", title: "Home",
path: "/", path: "/",
icon: IconHome icon: IconHome,
}, },
{ {
title: "PIS Finder", title: "PIS Finder",
path: "/pis/", path: "/pis/",
icon: IconDialpad icon: IconDialpad,
}, },
{ {
title: "Menu", title: "Menu",
path: "/more/", path: "/more/",
icon: IconMenu2 icon: IconMenu2,
} },
]; ];
import { page } from "$app/stores"; import { page } from "$app/stores";
import { IconHome, IconMenu2, IconDialpad } from "@tabler/icons-svelte"; import { IconHome, IconMenu2, IconDialpad } from "@tabler/icons-svelte";

View File

@ -27,7 +27,7 @@
"<h3>Resgistration Update</h3>" + "<h3>Resgistration Update</h3>" +
"<p>The registration issue has been fixed and registrations are now open.</p>" + "<p>The registration issue has been fixed and registrations are now open.</p>" +
"<p>Headcode and PIS Lookups will still be possible without registering but only for a limited time.</p>" + "<p>Headcode and PIS Lookups will still be possible without registering but only for a limited time.</p>" +
"<p>You will receive further warning before mandatory registration is re-enabled.</p>" "<p>You will receive further warning before mandatory registration is re-enabled.</p>",
]; ];
</script> </script>

View File

@ -22,8 +22,8 @@
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: $uuid uuid: $uuid,
} },
}; };
const res = await fetch(url, options); const res = await fetch(url, options);
return await res.json(); return await res.json();

View File

@ -27,8 +27,8 @@ export async function apiGet(path: string): Promise<any> {
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: uuidString uuid: uuidString,
} },
}; };
try { try {

View File

@ -40,5 +40,5 @@ export const tocs = new Map<string, string>([
["ln", "Grand Union Trains"], ["ln", "Grand Union Trains"],
["zz", "Freight/Charter Company"], ["zz", "Freight/Charter Company"],
["wm", "West Midlands Railway (WM)"], ["wm", "West Midlands Railway (WM)"],
["uk", "Unknown Operator"] ["uk", "Unknown Operator"],
]); ]);

View File

@ -18,8 +18,8 @@
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: $uuid uuid: $uuid,
} },
}; };
const res = await fetch(url, options); const res = await fetch(url, options);
if (res.status === 200) { if (res.status === 200) {
@ -67,9 +67,9 @@
</p> </p>
<p class="svc-detail validity"> <p class="svc-detail validity">
Valid From: {new Date(serviceDetail.scheduleStart).toLocaleDateString("en-GB", { Valid From: {new Date(serviceDetail.scheduleStart).toLocaleDateString("en-GB", {
timeZone: "UTC" timeZone: "UTC",
})} - {new Date(serviceDetail.scheduleEnd).toLocaleDateString("en-GB", { })} - {new Date(serviceDetail.scheduleEnd).toLocaleDateString("en-GB", {
timeZone: "UTC" timeZone: "UTC",
})} })}
</p> </p>
<table> <table>

View File

@ -13,14 +13,14 @@
title: "Live Departure Boards", title: "Live Departure Boards",
action: "/ldb", action: "/ldb",
placeholder: "Enter CRS/TIPLOC", placeholder: "Enter CRS/TIPLOC",
queryName: "station" queryName: "station",
}, },
{ {
title: "Train Details & PIS", title: "Train Details & PIS",
action: "/train", action: "/train",
placeholder: "Enter Headcode", placeholder: "Enter Headcode",
queryName: "headcode" queryName: "headcode",
} },
]; ];
</script> </script>

View File

@ -12,7 +12,7 @@
IconSpy, IconSpy,
IconUser, IconUser,
IconUserPlus, IconUserPlus,
IconVersions IconVersions,
} from "@tabler/icons-svelte"; } from "@tabler/icons-svelte";
const title = "More"; const title = "More";
@ -26,7 +26,7 @@
{ title: "Reason Code Lookup", path: "/more/reasons", icon: IconMessageCode }, { title: "Reason Code Lookup", path: "/more/reasons", icon: IconMessageCode },
{ title: "Privacy Policy", path: "/more/privacy", icon: IconSpy }, { title: "Privacy Policy", path: "/more/privacy", icon: IconSpy },
{ title: "Component Versions", path: "/more/versions", icon: IconVersions }, { title: "Component Versions", path: "/more/versions", icon: IconVersions },
{ title: "Statistics", path: "/more/statistics", icon: IconNumber } { title: "Statistics", path: "/more/statistics", icon: IconNumber },
]; ];
</script> </script>

View File

@ -11,7 +11,7 @@
stanox: "", stanox: "",
nlc: "", nlc: "",
name: "", name: "",
uic: "" uic: "",
}; };
let isLoading = false; let isLoading = false;
@ -35,7 +35,7 @@
stanox: data[0]["STANOX"] || "None", stanox: data[0]["STANOX"] || "None",
nlc: data[0]["NLC"] || "None", nlc: data[0]["NLC"] || "None",
name: data[0]["NLCDESC"] || "None", name: data[0]["NLCDESC"] || "None",
uic: data[0]["UIC"] || "None" uic: data[0]["UIC"] || "None",
}; };
//console.log("val",JSON.stringify(val)); //console.log("val",JSON.stringify(val));
} }
@ -64,7 +64,7 @@
stanox: "", stanox: "",
nlc: "", nlc: "",
name: "", name: "",
uic: "" uic: "",
}; };
} }
</script> </script>

View File

@ -11,8 +11,8 @@
let data = [ let data = [
{ {
domain: "User not Found", domain: "User not Found",
atime: "User not Found" atime: "User not Found",
} },
]; ];
let isLoading = false; let isLoading = false;

View File

@ -12,7 +12,7 @@
let resultObject = { let resultObject = {
results: false, results: false,
title: "", title: "",
resultLines: [] resultLines: [],
}; };
function load() { function load() {
@ -43,7 +43,7 @@
resultObject = { resultObject = {
results: false, results: false,
title: "Not Found", title: "Not Found",
resultLines: [] resultLines: [],
}; };
} }
resultObject.resultLines = resultLines; resultObject.resultLines = resultLines;

View File

@ -23,11 +23,11 @@
const request = { const request = {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json",
}, },
body: JSON.stringify({ body: JSON.stringify({
email: inputValue email: inputValue,
}) }),
}; };
const res = await fetch(url, request); const res = await fetch(url, request);
if (res.status == 400 || res.status == 403) { if (res.status == 400 || res.status == 403) {

View File

@ -14,7 +14,7 @@
{ id: "3", value: "" }, { id: "3", value: "" },
{ id: "4", value: "" }, { id: "4", value: "" },
{ id: "5", value: "" }, { id: "5", value: "" },
{ id: "6", value: "" } { id: "6", value: "" },
]; ];
function handleInput(index: number, event: KeyboardEvent): void { function handleInput(index: number, event: KeyboardEvent): void {
@ -54,11 +54,11 @@
const request = { const request = {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json",
}, },
body: JSON.stringify({ body: JSON.stringify({
uuid: id uuid: id,
}) }),
}; };
const res = await fetch(url, request); const res = await fetch(url, request);
const body = await res.json(); const body = await res.json();

View File

@ -22,7 +22,7 @@
browser: navigator.appName, browser: navigator.appName,
version: navigator.appVersion, version: navigator.appVersion,
platform: navigator.platform, platform: navigator.platform,
viewport: `${window.innerWidth} x ${window.innerHeight}` viewport: `${window.innerWidth} x ${window.innerHeight}`,
}; };
}); });
@ -46,15 +46,15 @@
`Platform: ${reportCollected.platform}\n` + `Platform: ${reportCollected.platform}\n` +
`Viewport: ${reportCollected.viewport}\n\n\n` + `Viewport: ${reportCollected.viewport}\n\n\n` +
`User Message:\n` + `User Message:\n` +
`${reportMsg}` `${reportMsg}`,
}); });
const url = `${getApiUrl()}/misc/issue`; const url = `${getApiUrl()}/misc/issue`;
const options = { const options = {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json",
}, },
body: formData body: formData,
}; };
const res = await fetch(url, options); const res = await fetch(url, options);
if (res.status == 200) { if (res.status == 200) {

View File

@ -35,8 +35,8 @@
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: $uuid uuid: $uuid,
} },
}; };
const res = await fetch(url, options); // Enable Auth const res = await fetch(url, options); // Enable Auth
if (res.status == 401) { if (res.status == 401) {

View File

@ -48,8 +48,8 @@
const options = { const options = {
method: "GET", method: "GET",
headers: { headers: {
uuid: $uuid uuid: $uuid,
} },
}; };
const url = `${getApiUrl()}/api/v2/timetable/train/${date}/${searchType}/${id}`; const url = `${getApiUrl()}/api/v2/timetable/train/${date}/${searchType}/${id}`;
try { try {

View File

@ -8,9 +8,9 @@ const config = {
pages: "build", pages: "build",
assets: "build", assets: "build",
precompress: true, precompress: true,
strict: true strict: true,
}) }),
} },
}; };
export default config; export default config;

View File

@ -2,5 +2,5 @@ import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
export default defineConfig({ export default defineConfig({
plugins: [sveltekit()] plugins: [sveltekit()],
}); });