From 3c43a3e23ed4dd37cb4da68e1f37c5695b2931cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Wi=C4=99ch?= Date: Tue, 28 Apr 2026 23:39:47 +0200 Subject: [PATCH] fix lint and remove all eslint overrides --- .eslintrc.js | 20 ++------------------ src/app.tsx | 3 ++- src/menu/search_index.ts | 11 +++++------ src/menu/top_bar.tsx | 3 ++- src/sidepanel/details/details.tsx | 2 +- src/util/analytics_noop.ts | 4 +++- 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5765a90..a985e0e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,23 +23,7 @@ module.exports = { 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', + 'plugin:react/jsx-runtime', ], - rules: { - 'no-case-declarations': 'off', - 'prefer-spread': 'off', - 'no-extra-boolean-cast': 'off', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-use-before-define': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - 'react/prop-types': 'off', - 'react/react-in-jsx-scope': 'off', - 'react/display-name': 'off', - 'react/no-unescaped-entities': 'off', - }, + rules: {}, }; diff --git a/src/app.tsx b/src/app.tsx index cd4b99b..c17b744 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -548,7 +548,7 @@ export function App() { function renderMainArea() { switch (state) { case AppState.SHOWING_CHART: - case AppState.LOADING_MORE: + case AppState.LOADING_MORE: { const updatedSelection = getSelection(data!.chartData, selection); return (
@@ -577,6 +577,7 @@ export function App() {
); + } case AppState.ERROR: return ; diff --git a/src/menu/search_index.ts b/src/menu/search_index.ts index fdc2d9a..7d49186 100644 --- a/src/menu/search_index.ts +++ b/src/menu/search_index.ts @@ -45,7 +45,7 @@ function compare(a: lunr.Index.Result, b: lunr.Index.Result) { /** Returns all last names of all husbands as a space-separated string. */ function getHusbandLastName( indi: JsonIndi, - indiMap: Map, + indiMap: Map, famMap: Map, ): string { return (indi.fams || []) @@ -67,6 +67,7 @@ class LunrSearchIndex implements SearchIndex { } initialize() { + // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; this.index = lunr(function () { //Trimmer will break non-latin characters, so custom multilingual implementation must be used @@ -110,6 +111,7 @@ class LunrSearchIndex implements SearchIndex { const pipelineFunctions: PipelineFunction[] = []; const searchPipelineFunctions: PipelineFunction[] = []; languages.forEach((language) => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const lunrLanguage = lunr[language]; if (language === 'en') { @@ -129,14 +131,11 @@ class LunrSearchIndex implements SearchIndex { } }); lunrInstance.pipeline.reset(); - lunrInstance.pipeline.add.apply(lunrInstance.pipeline, pipelineFunctions); + lunrInstance.pipeline.add(...pipelineFunctions); if (lunrInstance.searchPipeline) { lunrInstance.searchPipeline.reset(); - lunrInstance.searchPipeline.add.apply( - lunrInstance.searchPipeline, - searchPipelineFunctions, - ); + lunrInstance.searchPipeline.add(...searchPipelineFunctions); } } diff --git a/src/menu/top_bar.tsx b/src/menu/top_bar.tsx index fe50d3b..a271858 100644 --- a/src/menu/top_bar.tsx +++ b/src/menu/top_bar.tsx @@ -224,7 +224,7 @@ export function TopBar(props: Props) { } switch (screenSize) { - case ScreenSize.LARGE: + case ScreenSize.LARGE: { // Show dropdown if chart is shown, otherwise show individual menu // items. const menus = props.showingChart ? ( @@ -251,6 +251,7 @@ export function TopBar(props: Props) { ); return menus; + } case ScreenSize.SMALL: return ( diff --git a/src/sidepanel/details/details.tsx b/src/sidepanel/details/details.tsx index 9c49f09..cd53bb9 100644 --- a/src/sidepanel/details/details.tsx +++ b/src/sidepanel/details/details.tsx @@ -145,7 +145,7 @@ function fileDetails(objectEntries: GedcomEntry[], gedcom: GedcomData) { .map((objectEntry) => dereference(objectEntry, gedcom, (gedcom) => gedcom.other)) .forEach((objectEntry) => { const fileEntry = getNonImageFileEntry(objectEntry); - if (!!fileEntry) { + if (fileEntry) { files.push({ url: fileEntry.data, filename: getFileName(fileEntry), diff --git a/src/util/analytics_noop.ts b/src/util/analytics_noop.ts index 96ffb5d..9f2bed5 100644 --- a/src/util/analytics_noop.ts +++ b/src/util/analytics_noop.ts @@ -1,2 +1,4 @@ /** No-op function for analytics. */ -export function analyticsEvent(action: string, data?: any) {} +export function analyticsEvent(action: string, data?: any) { + // no-op +}