style: add eslint and prettier
Some checks failed
TrafficCue CI / check (push) Successful in 26s
TrafficCue CI / build (push) Has been cancelled

This commit is contained in:
Cfp
2025-06-22 17:53:32 +02:00
parent 16c0f0c399
commit f2348873fd
100 changed files with 5110 additions and 7344 deletions

View File

@ -1,10 +1,10 @@
import { OVERPASS_SERVER } from "./hosts";
export type OverpassResult = {
export interface OverpassResult {
elements: OverpassElement[];
};
}
export type OverpassElement = {
export interface OverpassElement {
type: "node" | "way" | "relation";
id: number;
tags: Record<string, string>;
@ -15,7 +15,7 @@ export type OverpassElement = {
lat: number; // Only for relations
lon: number; // Only for relations
};
};
}
/**
[out:json];
@ -40,11 +40,7 @@ out geom;
out geom;
*/
export async function fetchPOI(
lat: number,
lon: number,
radius: number,
) {
export async function fetchPOI(lat: number, lon: number, radius: number) {
return await fetch(OVERPASS_SERVER, {
method: "POST",
body: `[out:json];
@ -60,6 +56,6 @@ export async function fetchPOI(
node(around:${radius}, ${lat}, ${lon})["amenity"="parking"];
way(around:${radius}, ${lat}, ${lon})["amenity"="parking"];
);
out center tags;`
}).then(res => res.json() as Promise<OverpassResult>);
}
out center tags;`,
}).then((res) => res.json() as Promise<OverpassResult>);
}