🚨 Make ts linter less depressed

This commit is contained in:
2023-01-28 16:27:40 +01:00
parent 29ba26e80b
commit 43cbfc17b6
6 changed files with 113 additions and 50 deletions

View File

@@ -1,15 +1,13 @@
import { batch, Component, createEffect, createResource, createSignal, onMount, Show, useContext } from 'solid-js';
import { Component, createEffect, createResource, createSignal, onMount, Show, useContext } from 'solid-js';
import {
Box, Button, Input, InputLeftAddon, InputGroup, HStack, List, ListItem, Progress,
ProgressIndicator, VStack
} from "@hope-ui/solid";
import { Box, Button, Input, InputLeftAddon, InputGroup, HStack, List, ListItem, Progress, ProgressIndicator, VStack } from "@hope-ui/solid";
import 'leaflet/dist/leaflet.css';
import L from 'leaflet';
import { BusinessDataContext } from './businessData';
import { SearchContext } from './search';
import { Stop } from './types';
import { renderLineTransportMode, renderLinePicto, TransportModeWeights } from './utils';
import styles from './stopManager.module.css';
@@ -21,7 +19,7 @@ const StopRepr: Component = (props) => {
const [lineReprs] = createResource(props.stop.lines, fetchLinesRepr);
async function fetchLinesRepr(lineIds) {
const fetchLinesRepr = async (lineIds: Array<string>) => {
const reprs = [];
for (const lineId of lineIds) {
const line = await getLine(lineId);
@@ -100,7 +98,7 @@ const Map: Component = (props) => {
let map = null;
const stopsLayerGroup = L.featureGroup();
function buildMap(div: HTMLDivElement) {
const buildMap = (div: HTMLDivElement) => {
map = L.map(div).setView(mapCenter, 11);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
@@ -108,7 +106,7 @@ const Map: Component = (props) => {
stopsLayerGroup.addTo(map);
}
function setMarker(stop) {
const setMarker = (stop: Stop): Array<L.Marker> => {
const markers = [];
if (stop.lat !== undefined && stop.lon !== undefined) {
/* TODO: Add stop lines representation to popup. */
@@ -124,7 +122,7 @@ const Map: Component = (props) => {
onMount(() => buildMap(mapDiv));
const onStopUpdate = createEffect(() => {
createEffect(() => {
/* TODO: Avoid to clear all layers... */
stopsLayerGroup.clearLayers();