Add ESLint + pre-commit hook and fix the issues it surfaced

This commit is contained in:
2026-06-05 01:42:42 +03:00
parent 3d38dd1411
commit 939950b136
10 changed files with 1543 additions and 53 deletions
+2 -4
View File
@@ -19,9 +19,7 @@ export interface FormatDetection {
function isTopology(value: unknown): boolean {
return (
typeof value === 'object' &&
value !== null &&
(value as { type?: unknown }).type === 'Topology'
typeof value === 'object' && value !== null && (value as { type?: unknown }).type === 'Topology'
);
}
@@ -32,7 +30,7 @@ export function detectFormat(raw: string): FormatDetection {
// 1. Try JSON first — highest confidence signal.
try {
const parsed = JSON.parse(text);
const parsed: unknown = JSON.parse(text);
return {
format: isTopology(parsed) ? 'topojson' : 'json',
confidence: 'high',