Skip to content

Commit 260fe72

Browse files
committed
Update prettier setting
1 parent 619acd3 commit 260fe72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+204
-202
lines changed

.prettierrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{}
1+
{
2+
"trailingComma": "es5"
3+
}

src/AppContext.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ interface AppContextValue
8686
// settings
8787
updateGeoPermission: (
8888
geoPermission: AppState["geoPermission"],
89-
deniedCallback?: () => void,
89+
deniedCallback?: () => void
9090
) => void;
9191
toggleRouteFilter: () => void;
9292
toggleBusSortOrder: () => void;
@@ -170,13 +170,13 @@ export const AppContextProvider = ({
170170
const searchRoute = "";
171171
const geoPermission: unknown = localStorage.getItem("geoPermission");
172172
const geoLocation: unknown = JSON.parse(
173-
localStorage.getItem("geolocation"),
173+
localStorage.getItem("geolocation")
174174
);
175175
const busSortOrder: unknown = localStorage.getItem("busSortOrder");
176176
const numPadOrder: unknown = localStorage.getItem("numPadOrder");
177177
const etaFormat: unknown = localStorage.getItem("etaFormat");
178178
const routeSearchHistory: unknown = JSON.parse(
179-
localStorage.getItem("routeSearchHistory"),
179+
localStorage.getItem("routeSearchHistory")
180180
);
181181
const hotRoute: unknown = JSON.parse(localStorage.getItem("hotRoute"));
182182

@@ -228,7 +228,7 @@ export const AppContextProvider = ({
228228
state.searchRoute = searchRoute;
229229
});
230230
},
231-
[setState],
231+
[setState]
232232
);
233233

234234
useEffect(() => {
@@ -237,7 +237,7 @@ export const AppContextProvider = ({
237237
const _geoWatcherId = navigator.geolocation.watchPosition(
238238
({ coords: { latitude, longitude } }) => {
239239
updateGeolocation({ lat: latitude, lng: longitude });
240-
},
240+
}
241241
);
242242
geoWatcherId.current = _geoWatcherId;
243243
} catch (e) {
@@ -248,7 +248,7 @@ export const AppContextProvider = ({
248248
setStateRaw(
249249
produce((state: State) => {
250250
state.isVisible = !document.hidden;
251-
}),
251+
})
252252
);
253253
};
254254
window.addEventListener("visibilitychange", onVisibilityChange);
@@ -266,7 +266,7 @@ export const AppContextProvider = ({
266266
produce((state: State) => {
267267
state.geolocation = geolocation;
268268
localStorage.setItem("geolocation", JSON.stringify(geolocation));
269-
}),
269+
})
270270
);
271271
}, []);
272272

@@ -276,7 +276,7 @@ export const AppContextProvider = ({
276276
state.geoPermission = geoPermission;
277277
});
278278
},
279-
[setState],
279+
[setState]
280280
);
281281
const geoWatcherId = useRef(null);
282282

@@ -294,7 +294,7 @@ export const AppContextProvider = ({
294294
setGeoPermission("denied");
295295
localStorage.setItem("geoPermission", "denied");
296296
if (deniedCallback) deniedCallback();
297-
},
297+
}
298298
);
299299
geoWatcherId.current = _geoWatcherId;
300300
} else if (geoWatcherId.current) {
@@ -304,7 +304,7 @@ export const AppContextProvider = ({
304304
localStorage.setItem("geoPermission", geoPermission);
305305
}
306306
},
307-
[setGeoPermission, updateGeolocation],
307+
[setGeoPermission, updateGeolocation]
308308
);
309309

310310
const toggleRouteFilter = useCallback(() => {
@@ -314,7 +314,7 @@ export const AppContextProvider = ({
314314
const isRouteFilter = prev ? false : true;
315315
localStorage.setItem("isRouteFilter", JSON.stringify(isRouteFilter));
316316
state.isRouteFilter = isRouteFilter;
317-
}),
317+
})
318318
);
319319
}, []);
320320

@@ -326,7 +326,7 @@ export const AppContextProvider = ({
326326
prevOrder === "KMB first" ? "CTB-NWFB first" : "KMB first";
327327
localStorage.setItem("busSortOrder", busSortOrder);
328328
state.busSortOrder = busSortOrder;
329-
}),
329+
})
330330
);
331331
}, []);
332332

@@ -338,7 +338,7 @@ export const AppContextProvider = ({
338338
prevOrder === "123456789c0b" ? "789456123c0b" : "123456789c0b";
339339
localStorage.setItem("numPadOrder", numPadOrder);
340340
state.numPadOrder = numPadOrder;
341-
}),
341+
})
342342
);
343343
}, []);
344344

@@ -349,7 +349,7 @@ export const AppContextProvider = ({
349349
const etaFormat = ETA_FORMAT_NEXT_TYPES[prev];
350350
localStorage.setItem("etaFormat", etaFormat);
351351
state.etaFormat = etaFormat;
352-
}),
352+
})
353353
);
354354
}, []);
355355

@@ -360,7 +360,7 @@ export const AppContextProvider = ({
360360
const colorMode = prevColorMode === "dark" ? "light" : "dark";
361361
localStorage.setItem("colorMode", colorMode);
362362
state.colorMode = colorMode;
363-
}),
363+
})
364364
);
365365
}, []);
366366

@@ -371,7 +371,7 @@ export const AppContextProvider = ({
371371
const energyMode = !prevEnergyMode;
372372
localStorage.setItem("energyMode", JSON.stringify(energyMode));
373373
state.energyMode = energyMode;
374-
}),
374+
})
375375
);
376376
}, []);
377377

@@ -382,7 +382,7 @@ export const AppContextProvider = ({
382382
const analytics = !prev;
383383
localStorage.setItem("analytics", JSON.stringify(analytics));
384384
state.analytics = analytics;
385-
}),
385+
})
386386
);
387387
}, []);
388388

@@ -391,10 +391,10 @@ export const AppContextProvider = ({
391391
produce((state: State) => {
392392
localStorage.setItem(
393393
"refreshInterval",
394-
JSON.stringify(refreshInterval),
394+
JSON.stringify(refreshInterval)
395395
);
396396
state.refreshInterval = refreshInterval;
397-
}),
397+
})
398398
);
399399
}, []);
400400

@@ -405,10 +405,10 @@ export const AppContextProvider = ({
405405
const vibrateDuration = prevVibrateDuration ? 0 : 1;
406406
localStorage.setItem(
407407
"vibrateDuration",
408-
JSON.stringify(vibrateDuration),
408+
JSON.stringify(vibrateDuration)
409409
);
410410
state.vibrateDuration = vibrateDuration;
411-
}),
411+
})
412412
);
413413
}, []);
414414

@@ -431,11 +431,11 @@ export const AppContextProvider = ({
431431
ret = prevSearchRoute + buttonValue;
432432
}
433433
state.searchRoute = ret;
434-
}),
434+
})
435435
);
436436
}, 0);
437437
},
438-
[state.vibrateDuration],
438+
[state.vibrateDuration]
439439
);
440440

441441
const updateSelectedRoute = useCallback((route: string, seq: string = "") => {
@@ -451,10 +451,10 @@ export const AppContextProvider = ({
451451
}
452452
localStorage.setItem(
453453
"hotRoute",
454-
JSON.stringify(current(state.hotRoute)),
454+
JSON.stringify(current(state.hotRoute))
455455
);
456456
}
457-
}),
457+
})
458458
);
459459
}, []);
460460

@@ -466,25 +466,25 @@ export const AppContextProvider = ({
466466
.slice(0, 20);
467467
localStorage.setItem(
468468
"routeSearchHistory",
469-
JSON.stringify(newSearchHistory),
469+
JSON.stringify(newSearchHistory)
470470
);
471471
state.routeSearchHistory = newSearchHistory;
472-
}),
472+
})
473473
);
474474
}, []);
475475

476476
const removeSearchHistoryByRouteId = useCallback((routeId) => {
477477
setStateRaw(
478478
produce((state: State) => {
479479
const newSearchHistory = state.routeSearchHistory.filter(
480-
(item) => item !== routeId,
480+
(item) => item !== routeId
481481
);
482482
localStorage.setItem(
483483
"routeSearchHistory",
484-
JSON.stringify(newSearchHistory),
484+
JSON.stringify(newSearchHistory)
485485
);
486486
state.routeSearchHistory = newSearchHistory;
487-
}),
487+
})
488488
);
489489
}, []);
490490

@@ -494,7 +494,7 @@ export const AppContextProvider = ({
494494
produce((state: State) => {
495495
state.hotRoute = {};
496496
state.geolocation = defaultGeolocation;
497-
}),
497+
})
498498
);
499499
}, []);
500500

@@ -503,7 +503,7 @@ export const AppContextProvider = ({
503503
i18n.changeLanguage(lang);
504504
localStorage.setItem("lang", lang);
505505
},
506-
[i18n],
506+
[i18n]
507507
);
508508

509509
const contextValue = useMemo(() => {

0 commit comments

Comments
 (0)