From 36852348a8d61cf1750e542d02fc59b9ff3e4761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Wi=C4=99ch?= Date: Tue, 28 Apr 2026 23:28:52 +0200 Subject: [PATCH] Fix some lint errors --- .eslintrc.js | 2 -- src/app.tsx | 8 ++++---- src/datasource/load_data.ts | 2 +- src/sidepanel/details/details.tsx | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 23b584e..5765a90 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,8 +25,6 @@ module.exports = { 'plugin:react/recommended', ], rules: { - 'no-var': 'off', - 'prefer-const': 'off', 'no-case-declarations': 'off', 'prefer-spread': 'off', 'no-extra-boolean-cast': 'off', diff --git a/src/app.tsx b/src/app.tsx index d67a534..cd4b99b 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -150,7 +150,7 @@ function getArguments(location: H.Location): Arguments { const hash = getParam('file'); const url = getParam('url'); const embedded = getParam('embedded') === 'true'; // False by default. - var sourceSpec: DataSourceSpec | undefined = undefined; + let sourceSpec: DataSourceSpec | undefined = undefined; if (staticUrl) { sourceSpec = { source: DataSourceEnum.GEDCOM_URL, @@ -267,9 +267,9 @@ export function App() { if (data === undefined) { return; } - let shouldHideIds = config.id === Ids.HIDE; - let shouldHideSex = config.sex === Sex.HIDE; - let indiMap = idToIndiMap(data.chartData); + const shouldHideIds = config.id === Ids.HIDE; + const shouldHideSex = config.sex === Sex.HIDE; + const indiMap = idToIndiMap(data.chartData); indiMap.forEach((indi) => { indi.hideId = shouldHideIds; indi.hideSex = shouldHideSex; diff --git a/src/datasource/load_data.ts b/src/datasource/load_data.ts index d35834b..06322d7 100644 --- a/src/datasource/load_data.ts +++ b/src/datasource/load_data.ts @@ -54,7 +54,7 @@ async function loadGedzip( let gedcom = undefined; const images = new Map(); - for (let fileName of Object.keys(unzipped)) { + for (const fileName of Object.keys(unzipped)) { if (fileName.endsWith('.ged')) { if (gedcom) { console.warn('Multiple GEDCOM files found in zip archive.'); diff --git a/src/sidepanel/details/details.tsx b/src/sidepanel/details/details.tsx index e679e3f..9c49f09 100644 --- a/src/sidepanel/details/details.tsx +++ b/src/sidepanel/details/details.tsx @@ -60,13 +60,13 @@ function attributeDetails(entry: GedcomEntry) { return null; } - let attributeName = entry.tree + const attributeName = entry.tree .filter((subentry) => subentry.tag === 'TYPE') .flatMap((type) => getData(type)) .join() .trim(); - let attributeValue = getData(entry).join(' ').trim(); + const attributeValue = getData(entry).join(' ').trim(); if(attributeName) { return ( <>