fix lint and remove all eslint overrides

This commit is contained in:
Przemek Więch
2026-04-28 23:39:47 +02:00
parent 36852348a8
commit 3c43a3e23e
6 changed files with 15 additions and 28 deletions

View File

@@ -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: {},
};

View File

@@ -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 (
<div id="content">
@@ -577,6 +577,7 @@ export function App() {
</SidebarPushable>
</div>
);
}
case AppState.ERROR:
return <ErrorMessage message={error!} />;

View File

@@ -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<String, JsonIndi>,
indiMap: Map<string, JsonIndi>,
famMap: Map<string, JsonFam>,
): 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);
}
}

View File

@@ -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 (

View File

@@ -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),

View File

@@ -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
}