mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 23:26:15 +00:00
fix lint and remove all eslint overrides
This commit is contained in:
20
.eslintrc.js
20
.eslintrc.js
@@ -23,23 +23,7 @@ module.exports = {
|
|||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
'plugin:react/recommended',
|
'plugin:react/recommended',
|
||||||
|
'plugin:react/jsx-runtime',
|
||||||
],
|
],
|
||||||
rules: {
|
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',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ export function App() {
|
|||||||
function renderMainArea() {
|
function renderMainArea() {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case AppState.SHOWING_CHART:
|
case AppState.SHOWING_CHART:
|
||||||
case AppState.LOADING_MORE:
|
case AppState.LOADING_MORE: {
|
||||||
const updatedSelection = getSelection(data!.chartData, selection);
|
const updatedSelection = getSelection(data!.chartData, selection);
|
||||||
return (
|
return (
|
||||||
<div id="content">
|
<div id="content">
|
||||||
@@ -577,6 +577,7 @@ export function App() {
|
|||||||
</SidebarPushable>
|
</SidebarPushable>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
case AppState.ERROR:
|
case AppState.ERROR:
|
||||||
return <ErrorMessage message={error!} />;
|
return <ErrorMessage message={error!} />;
|
||||||
|
|||||||
@@ -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. */
|
/** Returns all last names of all husbands as a space-separated string. */
|
||||||
function getHusbandLastName(
|
function getHusbandLastName(
|
||||||
indi: JsonIndi,
|
indi: JsonIndi,
|
||||||
indiMap: Map<String, JsonIndi>,
|
indiMap: Map<string, JsonIndi>,
|
||||||
famMap: Map<string, JsonFam>,
|
famMap: Map<string, JsonFam>,
|
||||||
): string {
|
): string {
|
||||||
return (indi.fams || [])
|
return (indi.fams || [])
|
||||||
@@ -67,6 +67,7 @@ class LunrSearchIndex implements SearchIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||||
const self = this;
|
const self = this;
|
||||||
this.index = lunr(function () {
|
this.index = lunr(function () {
|
||||||
//Trimmer will break non-latin characters, so custom multilingual implementation must be used
|
//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 pipelineFunctions: PipelineFunction[] = [];
|
||||||
const searchPipelineFunctions: PipelineFunction[] = [];
|
const searchPipelineFunctions: PipelineFunction[] = [];
|
||||||
languages.forEach((language) => {
|
languages.forEach((language) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const lunrLanguage = lunr[language];
|
const lunrLanguage = lunr[language];
|
||||||
if (language === 'en') {
|
if (language === 'en') {
|
||||||
@@ -129,14 +131,11 @@ class LunrSearchIndex implements SearchIndex {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
lunrInstance.pipeline.reset();
|
lunrInstance.pipeline.reset();
|
||||||
lunrInstance.pipeline.add.apply(lunrInstance.pipeline, pipelineFunctions);
|
lunrInstance.pipeline.add(...pipelineFunctions);
|
||||||
|
|
||||||
if (lunrInstance.searchPipeline) {
|
if (lunrInstance.searchPipeline) {
|
||||||
lunrInstance.searchPipeline.reset();
|
lunrInstance.searchPipeline.reset();
|
||||||
lunrInstance.searchPipeline.add.apply(
|
lunrInstance.searchPipeline.add(...searchPipelineFunctions);
|
||||||
lunrInstance.searchPipeline,
|
|
||||||
searchPipelineFunctions,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export function TopBar(props: Props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (screenSize) {
|
switch (screenSize) {
|
||||||
case ScreenSize.LARGE:
|
case ScreenSize.LARGE: {
|
||||||
// Show dropdown if chart is shown, otherwise show individual menu
|
// Show dropdown if chart is shown, otherwise show individual menu
|
||||||
// items.
|
// items.
|
||||||
const menus = props.showingChart ? (
|
const menus = props.showingChart ? (
|
||||||
@@ -251,6 +251,7 @@ export function TopBar(props: Props) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
return menus;
|
return menus;
|
||||||
|
}
|
||||||
|
|
||||||
case ScreenSize.SMALL:
|
case ScreenSize.SMALL:
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ function fileDetails(objectEntries: GedcomEntry[], gedcom: GedcomData) {
|
|||||||
.map((objectEntry) => dereference(objectEntry, gedcom, (gedcom) => gedcom.other))
|
.map((objectEntry) => dereference(objectEntry, gedcom, (gedcom) => gedcom.other))
|
||||||
.forEach((objectEntry) => {
|
.forEach((objectEntry) => {
|
||||||
const fileEntry = getNonImageFileEntry(objectEntry);
|
const fileEntry = getNonImageFileEntry(objectEntry);
|
||||||
if (!!fileEntry) {
|
if (fileEntry) {
|
||||||
files.push({
|
files.push({
|
||||||
url: fileEntry.data,
|
url: fileEntry.data,
|
||||||
filename: getFileName(fileEntry),
|
filename: getFileName(fileEntry),
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
/** No-op function for analytics. */
|
/** No-op function for analytics. */
|
||||||
export function analyticsEvent(action: string, data?: any) {}
|
export function analyticsEvent(action: string, data?: any) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user