fix(atlas): clear the knip findings of the globe Atlas

- The globe's geometry code types against geojson and
  topojson-specification; both are listed as client dev dependencies now
  (already installed through @types/topojson-client).
- Constants, helpers and types used only inside their own module lose
  their export.
- The GeoJSON types only the classic Atlas map read are removed; the knip
  baseline follows the lower counts in types.ts and offlineDb.ts.
This commit is contained in:
Maurice
2026-11-29 01:59:04 +01:00
parent a3db6e93bf
commit cac5b5c501
13 changed files with 17 additions and 30 deletions
+2
View File
@@ -143,11 +143,13 @@
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.13",
"@trivago/prettier-plugin-sort-imports": "^6.0.3",
"@types/geojson": "^7946.0.16",
"@types/leaflet": "^1.9.23",
"@types/node": "^26.6.11",
"@types/react": "^19.3.2",
"@types/react-dom": "^19.3.0",
"@types/topojson-client": "^3.1.5",
"@types/topojson-specification": "^1.0.5",
"@vitejs/plugin-react": "^6.2.1",
"@vitest/coverage-v8": "^5.1.2",
"autoprefixer": "^10.7.0",
@@ -7,7 +7,7 @@ export interface AtlasGlobeHandle {
engine: GlobeEngine | null;
}
export interface AtlasGlobeProps {
interface AtlasGlobeProps {
fetchJson: (path: string) => Promise<unknown>;
dark: boolean;
/** Country name for a label, by ISO A2 (localised by the caller). */
@@ -74,8 +74,8 @@ export type GlobeHit =
| { kind: 'region'; a2: string; code: string | null; name: string | null };
/** Zoom from which regions crossfade in, and from which the finer region files load. */
export const REGION_FADE_START = 5;
export const REGION_FADE_END = 6;
const REGION_FADE_START = 5;
const REGION_FADE_END = 6;
/**
* From here on the regions in view are fetched ahead, while the zoom is still
* on its way, so they are drawn by the time they fade in instead of a beat later.
@@ -10,8 +10,8 @@ import type { FrameParams } from './globeMath';
import type { BuiltLayer, FillMesh, LineMesh } from './globeMesh';
import { FILL_FS, FILL_VS, LINE_FS, LINE_VS, PICK_FS, RIM_FS, SKY_FS, SKY_VS } from './globeShaders';
export const STATUS_TEX_W = 256;
export const STATUS_TEX_H = 64;
const STATUS_TEX_W = 256;
const STATUS_TEX_H = 64;
export const MAX_FEATURES = STATUS_TEX_W * STATUS_TEX_H;
export type Rgb = [number, number, number];
@@ -14,7 +14,7 @@ export type DawarichAtlasTab = 'wishes' | 'countries';
* not an error the server reported (nothing was sent), and "something went
* wrong" for a plane journey sends somebody looking for a bug in Dawarich.
*/
export function dawarichFailureText(err: unknown, t: (key: string) => string): string {
function dawarichFailureText(err: unknown, t: (key: string) => string): string {
if (err instanceof DawarichOfflineError) return t('dawarich.error.offline');
const data = (err as { response?: { data?: { error?: unknown } } })?.response?.data;
return typeof data?.error === 'string' ? data.error : t('dawarich.error.unknown');
+1 -1
View File
@@ -16,7 +16,7 @@ import { A2_TO_A3, type AtlasData, type BucketItem } from './atlasModel';
* tabs and the phone sheet render this, each in its own markup.
*/
export const CONTINENTS: Array<[string, string]> = [
const CONTINENTS: Array<[string, string]> = [
['Europe', 'atlas.europe'],
['Asia', 'atlas.asia'],
['North America', 'atlas.northAmerica'],
+1 -1
View File
@@ -18,7 +18,7 @@ export interface AtlasCountry {
status?: VisitStatus
}
export interface AtlasStats {
interface AtlasStats {
totalTrips: number
totalPlaces: number
totalCountries: number
+1 -1
View File
@@ -35,7 +35,7 @@ export interface AtlasRegionRow {
manuallyMarked?: boolean;
}
export interface AtlasFlightAirport {
interface AtlasFlightAirport {
code: string | null;
name: string;
lat: number;
+1 -1
View File
@@ -39,7 +39,7 @@ type Outcome = 'done' | 'parked' | 'stop';
let lastCreatedAt = 0;
/** Fill `{name}` placeholders of a path from `ids`. */
export function fillPath(url: string, ids: Record<string, number>): string {
function fillPath(url: string, ids: Record<string, number>): string {
return Object.entries(ids).reduce((path, [name, id]) => path.replace(`{${name}}`, String(id)), url);
}
-16
View File
@@ -409,22 +409,6 @@ export interface AtlasPlace {
trip_id?: number
}
// GeoJSON types (simplified for atlas map)
export interface GeoJsonFeature {
type: 'Feature'
properties: Record<string, string | number | null | undefined>
geometry: {
type: string
coordinates: unknown
}
id?: string
}
export interface GeoJsonFeatureCollection {
type: 'FeatureCollection'
features: GeoJsonFeature[]
}
// App config from /auth/app-config
export interface AppConfig {
has_users: boolean
+2
View File
@@ -122,11 +122,13 @@
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.13",
"@trivago/prettier-plugin-sort-imports": "^6.0.3",
"@types/geojson": "^7946.0.16",
"@types/leaflet": "^1.9.23",
"@types/node": "^26.6.11",
"@types/react": "^19.3.2",
"@types/react-dom": "^19.3.0",
"@types/topojson-client": "^3.1.5",
"@types/topojson-specification": "^1.0.5",
"@vitejs/plugin-react": "^6.2.1",
"@vitest/coverage-v8": "^5.1.2",
"autoprefixer": "^10.7.0",
+1 -2
View File
@@ -149,7 +149,6 @@
"client/src/components/shared/DialogShell.tsx": 1,
"client/src/components/shared/SlidingTabs.tsx": 1,
"client/src/components/shared/elevationProfileModel.ts": 1,
"client/src/db/offlineDb.ts": 1,
"client/src/help/defineScreen.ts": 1,
"client/src/help/types.ts": 1,
"client/src/hooks/useDawarichConnection.ts": 1,
@@ -174,7 +173,7 @@
"client/src/store/backgroundTasksStore.ts": 1,
"client/src/store/helpStore.ts": 2,
"client/src/theme/applyAppearance.ts": 1,
"client/src/types.ts": 5,
"client/src/types.ts": 4,
"client/src/utils/connectionsVisibility.ts": 1,
"client/src/utils/dayDeleteImpact.ts": 3,
"client/src/utils/journeyLifecycle.ts": 1,
@@ -3,7 +3,7 @@ import type { ReservationEndpointsRepository } from '../../db/repositories/Reser
import { InjectRepository } from '@mikro-orm/nestjs';
import { Injectable } from '@nestjs/common';
export interface AtlasFlightRoute {
interface AtlasFlightRoute {
/** Airports of the route, ordered alphabetically so A→B and B→A are one route. */
a: AtlasAirport;
b: AtlasAirport;
@@ -13,7 +13,7 @@ export interface AtlasFlightRoute {
lastDate: string | null;
}
export interface AtlasAirport {
interface AtlasAirport {
code: string | null;
name: string;
lat: number;