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: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"]
extraFileExtensions: [".svelte"],
},
env: {
browser: true,
es2017: true,
node: true
node: true,
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser"
}
}
]
parser: "@typescript-eslint/parser",
},
},
],
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@
"<h3>Resgistration Update</h3>" +
"<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>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>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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