Tools: Apply rule @typescript-eslint/ban-types

pull/8404/head
Laurent Cozic 2023-06-30 10:30:29 +01:00
parent 48ef6db4a5
commit dd6eec6a03
153 changed files with 296 additions and 9 deletions

View File

@ -184,6 +184,7 @@ module.exports = {
},
'rules': {
'@typescript-eslint/ban-ts-comment': ['error'],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/explicit-member-accessibility': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
'@typescript-eslint/array-type': 'error',

View File

@ -54,6 +54,7 @@ export default class BaseCommand {
return r[0];
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public setDispatcher(fn: Function) {
this.dispatcher_ = fn;
}
@ -63,6 +64,7 @@ export default class BaseCommand {
return this.dispatcher_(action);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public setStdout(fn: Function) {
this.stdout_ = fn;
}
@ -71,6 +73,7 @@ export default class BaseCommand {
if (this.stdout_) this.stdout_(text);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public setPrompt(fn: Function) {
this.prompt_ = fn;
}

View File

@ -18,6 +18,7 @@ import { pathExists, writeFile } from 'fs-extra';
class Command extends BaseCommand {
private syncTargetId_: number = null;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private releaseLockFn_: Function = null;
private oneDriveApiUtils_: any = null;

View File

@ -65,6 +65,7 @@ export default class PluginRunner extends BasePluginRunner {
}
public async run(plugin: Plugin, sandbox: Global): Promise<void> {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function, reject: Function) => {
const onStarted = () => {
plugin.off('started', onStarted);
@ -85,6 +86,7 @@ export default class PluginRunner extends BasePluginRunner {
public async waitForSandboxCalls(): Promise<void> {
const startTime = Date.now();
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function, reject: Function) => {
const iid = setInterval(() => {
if (!Object.keys(this.activeSandboxCalls_).length) {

View File

@ -1,5 +1,6 @@
import { _ } from '@joplin/lib/locale';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
cmd.setStdout((text: string) => {
return stdout(text);

View File

@ -3,6 +3,7 @@ import Folder from '@joplin/lib/models/Folder';
import BaseCommand from '../base-command';
import setupCommand from '../setupCommand';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
const command = new CommandClass();
setupCommand(command, stdout, null, null);

View File

@ -151,6 +151,7 @@ export default class InteropServiceHelper {
return `${filename}.${fileExtension}`;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static async export(_dispatch: Function, module: Module, options: ExportNoteOptions = null) {
if (!options) options = {};

View File

@ -88,6 +88,7 @@ export class Bridge {
// Perhaps the easiest would be to patch electron-context-menu to
// support the renderer process again. Or possibly revert to an old
// version of electron-context-menu.
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public setupContextMenu(_spellCheckerMenuItemsHandler: Function) {
require('electron-context-menu')({
allWindows: [this.window()],
@ -255,6 +256,7 @@ export class Bridge {
return nativeTheme.shouldUseDarkColors;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public addEventListener(name: string, fn: Function) {
if (name === 'nativeThemeUpdated') {
nativeTheme.on('updated', fn);

View File

@ -20,6 +20,7 @@ interface Props {
iconName?: string;
level?: ButtonLevel;
className?: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClick?: Function;
color?: string;
iconAnimation?: string;

View File

@ -6,8 +6,11 @@ const styled = require('styled-components').default;
interface Props {
backButtonTitle?: string;
hasChanges?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onCancelClick: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onSaveClick?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onApplyClick?: Function;
}

View File

@ -7,6 +7,7 @@ const styled = require('styled-components').default;
interface Props {
selection: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onSelectionChange: Function;
sections: any[];
}

View File

@ -45,9 +45,13 @@ const RepoApiErrorMessage = styled(StyledMessage)<any>`
interface Props {
value: any;
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onChange: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderLabel: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderDescription: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderHeader: Function;
}

View File

@ -25,6 +25,7 @@ interface Props {
onSearchQueryChange(event: OnChangeEvent): void;
pluginSettings: PluginSettings;
onPluginSettingsChange(event: any): void;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderDescription: Function;
maxWidth: number;
repoApi(): RepositoryApi;

View File

@ -13,6 +13,7 @@ export interface OnPluginSettingChangeEvent {
type OnPluginSettingChangeHandler = (event: OnPluginSettingChangeEvent)=> void;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(setInstallingPluginIds: Function, pluginSettings: PluginSettings, repoApi: Function, onPluginSettingsChange: OnPluginSettingChangeHandler, isUpdate: boolean) {
return useCallback(async (event: ItemEvent) => {
const pluginId = event.item.manifest.id;

View File

@ -26,8 +26,10 @@ const DialogRoot = styled.div`
`;
interface Props {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderContent: Function;
className?: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose?: Function;
}

View File

@ -2,7 +2,9 @@ import { useEffect, useState, useRef, useCallback } from 'react';
import { isInsideContainer } from '@joplin/lib/dom';
interface Props {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onOkButtonClick: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onCancelButtonClick: Function;
}

View File

@ -16,6 +16,7 @@ import FolderIconBox from '../FolderIconBox';
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
folderId: string;
parentId: string;

View File

@ -5,6 +5,7 @@ import { AppState } from '../app.reducer';
interface Props {
tip: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClick: Function;
themeId: number;
style: any;

View File

@ -5,6 +5,7 @@ interface Props {
themeId: number;
style: any;
iconName: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClick: Function;
}

View File

@ -5,9 +5,12 @@ interface Props {
itemHeight: number;
items: any[];
disabled?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onKeyDown?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
itemRenderer: Function;
className?: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onNoteDrop?: Function;
}

View File

@ -57,6 +57,7 @@ interface Props {
pluginHtmlContents: PluginHtmlContents;
pluginsLoaded: boolean;
hasNotesBeingSaved: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
mainLayout: LayoutItem;
style: any;
@ -121,6 +122,7 @@ class MainScreenComponent extends React.Component<Props, State> {
private isPrinting_: boolean;
private styleKey_: string;
private styles_: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private promptOnClose_: Function;
public constructor(props: Props) {
@ -514,6 +516,7 @@ class MainScreenComponent extends React.Component<Props, State> {
return this.styles_;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private renderNotificationMessage(message: string, callForAction: string, callForActionHandler: Function, callForAction2: string = null, callForActionHandler2: Function = null) {
const theme = themeStyle(this.props.themeId);
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };

View File

@ -29,6 +29,7 @@ export const runtime = (): CommandRuntime => {
} else if (uiType === UiType.CommandPalette) {
menuItemById('commandPalette').click();
} else if (uiType === UiType.ControlledApi) {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function, reject: Function) => {
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
menuItem.userData = {

View File

@ -14,6 +14,7 @@ import { PasswordInput } from '../PasswordInput/PasswordInput';
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -54,6 +54,7 @@ function getPluginCommandNames(plugins: PluginStates): string[] {
return output;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemClick: Function) {
const output: any = {
label: label,
@ -108,6 +109,7 @@ const useSwitchProfileMenuItems = (profileConfig: ProfileConfig, menuItemDic: an
};
interface Props {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
menuItemProps: any;
routeName: string;

View File

@ -9,6 +9,7 @@ interface MultiNoteActionsProps {
themeId: number;
selectedNoteIds: string[];
notes: any[];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
watchedNoteFiles: string[];
plugins: PluginStates;

View File

@ -10,6 +10,7 @@ interface NoteContentPropertiesDialogProps {
themeId: number;
text: string;
markupLanguage: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose: Function;
}
@ -28,6 +29,7 @@ function markupToHtml() {
return markupToHtml_;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function countElements(text: string, wordSetter: Function, characterSetter: Function, characterNoSpaceSetter: Function, lineSetter: Function) {
Countable.count(text, (counter: any) => {
wordSetter(counter.words);

View File

@ -62,6 +62,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
const editorRef = useRef(null);
const rootRef = useRef(null);
const webviewRef = useRef(null);
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const props_onChangeRef = useRef<Function>(null);
props_onChangeRef.current = props.onChange;

View File

@ -30,7 +30,7 @@ export default function useKeymap(CodeMirror: any) {
}
// Converts a command of the form editor.command to just command
function editorCommandToCodeMirror(command: String) {
function editorCommandToCodeMirror(command: string) {
return command.slice(7); // 7 is the length of editor.
}
@ -38,7 +38,7 @@ export default function useKeymap(CodeMirror: any) {
// CodeMirror requires a - between keys while Electron want's a +
// CodeMirror doesn't recognize Option (it uses Alt instead)
// CodeMirror requires Shift to be first
function normalizeAccelerator(accelerator: String) {
function normalizeAccelerator(accelerator: string) {
const command = accelerator.replace(/\+/g, '-').replace('Option', 'Alt');
// From here is taken out of codemirror/lib/codemirror.js
const parts = command.split(/-(?!$)/);

View File

@ -1,6 +1,7 @@
import { useCallback, useRef } from 'react';
import shim from '@joplin/lib/shim';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function useScrollHandler(editorRef: any, webviewRef: any, onScroll: Function) {
const scrollTimeoutId_ = useRef<any>(null);
const scrollPercent_ = useRef(0);

View File

@ -905,9 +905,11 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
// Need to save the onChange handler to a ref to make sure
// we call the current one from setTimeout.
// https://github.com/facebook/react/issues/14010#issuecomment-433788147
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const props_onChangeRef = useRef<Function>();
props_onChangeRef.current = props.onChange;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const prop_htmlToMarkdownRef = useRef<Function>();
prop_htmlToMarkdownRef.current = props.htmlToMarkdown;

View File

@ -77,6 +77,7 @@ function editableInnerHtml(html: string): string {
return editable[0].innerHTML;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function openEditDialog(editor: any, markupToHtml: any, dispatchDidUpdate: Function, editable: any) {
const source = editable ? findBlockSource(editable) : newBlockSource();

View File

@ -41,6 +41,7 @@ interface ContextMenuActionOptions {
const contextMenuActionOptions: ContextMenuActionOptions = { current: null };
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(editor: any, plugins: PluginStates, dispatch: Function) {
useEffect(() => {
if (!editor) return () => {};

View File

@ -3,6 +3,7 @@ import shim from '@joplin/lib/shim';
interface HookDependencies {
editor: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onScroll: Function;
}

View File

@ -30,6 +30,7 @@ async function saveFileData(data: any, filename: string) {
await writeFile(newFilePath, data);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export async function openItemById(itemId: string, dispatch: Function, hash = '') {
const item = await BaseItem.loadItemById(itemId);
@ -68,6 +69,7 @@ export async function openItemById(itemId: string, dispatch: Function, hash = ''
}
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export function menuItems(dispatch: Function): ContextMenuItems {
return {
open: {
@ -194,6 +196,7 @@ export function menuItems(dispatch: Function): ContextMenuItems {
};
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default async function contextMenu(options: ContextMenuOptions, dispatch: Function) {
const menu = new Menu();

View File

@ -17,14 +17,18 @@ export interface ContextMenuOptions {
linkToCopy: string;
textToCopy: string;
htmlToCopy: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
insertContent: Function;
isReadOnly?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
fireEditorEvent: Function;
}
export interface ContextMenuItem {
label: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onAction: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
isActive: Function;
}

View File

@ -18,6 +18,7 @@ export interface NoteEditorProps {
// style: any;
noteId: string;
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
selectedNoteIds: string[];
selectedFolderId: string;
@ -59,9 +60,11 @@ export interface NoteBodyEditorProps {
onMessage(event: any): void;
onScroll(event: any): void;
markupToHtml: (markupLanguage: MarkupLanguage, markup: string, options: MarkupToHtmlOptions)=> Promise<RenderResult>;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
htmlToMarkdown: Function;
allAssets: (markupLanguage: MarkupLanguage, options: AllAssetsOptions)=> Promise<RenderResultPluginAsset[]>;
disabled: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
noteToolbar: any;
setLocalSearchResultCount(count: number): void;
@ -70,6 +73,7 @@ export interface NoteBodyEditorProps {
keyboardMode: string;
resourceInfos: ResourceInfos;
locale: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onDrop: Function;
noteToolbarButtonInfos: ToolbarButtonInfo[];
plugins: PluginStates;

View File

@ -28,6 +28,7 @@ interface HookDependencies {
onAfterLoad(event: OnLoadEvent): void;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function installResourceChangeHandler(onResourceChangeHandler: Function) {
ResourceFetcher.instance().on('downloadComplete', onResourceChangeHandler);
ResourceFetcher.instance().on('downloadStarted', onResourceChangeHandler);
@ -35,6 +36,7 @@ function installResourceChangeHandler(onResourceChangeHandler: Function) {
ResourceEditWatcher.instance().on('resourceChange', onResourceChangeHandler);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function uninstallResourceChangeHandler(onResourceChangeHandler: Function) {
ResourceFetcher.instance().off('downloadComplete', onResourceChangeHandler);
ResourceFetcher.instance().off('downloadStarted', onResourceChangeHandler);

View File

@ -7,6 +7,7 @@ import ResourceFetcher from '@joplin/lib/services/ResourceFetcher';
import { reg } from '@joplin/lib/registry';
const bridge = require('@electron/remote').require('./bridge').default;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function useMessageHandler(scrollWhenReady: any, setScrollWhenReady: Function, editorRef: any, setLocalSearchResultCount: Function, dispatch: Function, formNote: FormNote) {
return useCallback(async (event: any) => {
const msg = event.channel ? event.channel : '';

View File

@ -24,6 +24,7 @@ function defaultSearchMarkers(): SearchMarkers {
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function useSearchMarkers(showLocalSearch: boolean, localSearchMarkerOptions: Function, searches: any[], selectedSearchId: string, highlightedWords: any[] = []) {
return useMemo((): SearchMarkers => {
if (showLocalSearch) return localSearchMarkerOptions();

View File

@ -15,15 +15,20 @@ const commandsWithDependencies = [
interface HookDependencies {
formNote: FormNote;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
setShowLocalSearch: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
noteSearchBarRef: any;
editorRef: any;
titleInputRef: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
saveNoteAndWait: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
setFormNote: Function;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any, setFormNote: Function): CommandRuntime {
const markdownEditorOnly = !Object.keys(joplinCommandToTinyMceCommands).includes(declaration.name);

View File

@ -5,6 +5,7 @@ export interface Props {
themeId: any;
selectedNoteIds: string[];
notes: NoteEntity[];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
watchedNoteFiles: any[];
plugins: PluginStates;

View File

@ -13,7 +13,9 @@ const formatcoords = require('formatcoords');
interface Props {
noteId: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onRevisionLinkClick: Function;
themeId: number;
}
@ -210,6 +212,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
public async saveProperty() {
if (!this.state.editedKey) return;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function) => {
const newFormNote = { ...this.state.formNote };
@ -234,6 +237,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
}
public async cancelProperty() {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function) => {
this.okButton.current.focus();
this.setState({

View File

@ -22,6 +22,7 @@ import shared from '@joplin/lib/components/shared/note-screen-shared';
interface Props {
themeId: number;
noteId: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onBack: Function;
customCss: string;
}
@ -36,6 +37,7 @@ interface State {
class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
private viewerRef_: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private helpButton_onClick: Function;
public constructor(props: Props) {

View File

@ -4,9 +4,13 @@ import { _ } from '@joplin/lib/locale';
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onNext: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onPrevious: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onChange: Function;
query: string;
searching: boolean;

View File

@ -3,7 +3,9 @@ import * as React from 'react';
import { reg } from '@joplin/lib/registry';
interface Props {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onDomReady: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onIpcMessage: Function;
viewerStyle: any;
contentMaxWidth?: number;

View File

@ -27,6 +27,7 @@ const IFrame = styled.iframe`
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
resource: any;
pageNo: number;

View File

@ -12,6 +12,7 @@ interface Props {
visible: boolean;
style: any;
buttons: any[];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose: Function;
inputType: string;
description: string;

View File

@ -20,6 +20,7 @@ interface Props {
onResize(event: OnResizeEvent): void;
width?: number;
height?: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
renderItem: Function;
onMoveButtonClick(event: MoveButtonClickEvent): void;
moveMode: boolean;
@ -32,6 +33,7 @@ function itemVisible(item: LayoutItem, moveMode: boolean) {
return item.visible !== false;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function renderContainer(item: LayoutItem, parent: LayoutItem | null, sizes: LayoutItemSizes, resizedItemMaxSize: Size | null, onResizeStart: Function, onResize: Function, onResizeStop: Function, children: any[], isLastChild: boolean, moveMode: boolean): any {
const style: any = {
display: itemVisible(item, moveMode) ? 'flex' : 'none',

View File

@ -8,6 +8,7 @@ export default function iterateItems(layout: LayoutItem, callback: ItemItemCallb
const result = callback(0, layout, null);
if (result === false) return;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function recurseFind(item: LayoutItem, callback: Function): boolean {
if (item.children) {
for (let childIndex = 0; childIndex < item.children.length; childIndex++) {

View File

@ -16,6 +16,7 @@ interface Style {
interface Props {
themeId: number;
style: Style;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -34,6 +34,7 @@ const bridge = require('@electron/remote').require('./bridge').default;
interface Props {
themeId: number;
appState: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
size: Size;
zoomFactor: number;
@ -51,6 +52,7 @@ interface ModalDialogProps {
interface RegisteredDialogProps {
themeId: number;
key: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -21,6 +21,7 @@ export const Root = styled.div`
interface Props {
inputRef?: any;
notesParentType: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch?: Function;
selectedNoteId: string;
isFocused?: boolean;
@ -32,6 +33,7 @@ function SearchBar(props: Props) {
const searchId = useRef(uuid.create());
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function search(searchId: string, query: string, dispatch: Function) {
dispatch({
type: 'SEARCH_UPDATE',

View File

@ -21,6 +21,7 @@ const { clipboard } = require('electron');
interface Props {
themeId: number;
noteIds: string[];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onClose: Function;
shares: StateShare[];
syncTargetId: number;

View File

@ -51,6 +51,7 @@ const StyledSpanFix = styled.span`
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
folders: any[];
collapsedFolderIds: string[];
@ -571,6 +572,7 @@ const SidebarComponent = (props: Props) => {
);
};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const renderHeader = (key: string, label: string, iconName: string, contextMenuHandler: Function = null, onPlusButtonClick: Function = null, extraProps: any = {}) => {
const headerClick = extraProps.onClick || null;
delete extraProps.onClick;

View File

@ -15,6 +15,7 @@ import styled from 'styled-components';
interface Props {
themeId: string;
style: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -16,6 +16,7 @@ import StyledLink from '../style/StyledLink';
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}
@ -150,6 +151,7 @@ export default function(props: Props) {
const [joplinCloudPassword, setJoplinCloudPassword] = useState('');
const [joplinCloudLoginInProgress, setJoplinCloudLoginInProgress] = useState(false);
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function closeDialog(dispatch: Function) {
dispatch({
type: 'DIALOG_CLOSE',

View File

@ -36,9 +36,13 @@ interface Props {
inputRef?: any;
value: string;
onChange(event: OnChangeEvent): void;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onFocus?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onBlur?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onKeyDown?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onSearchButtonClick: Function;
searchStarted: boolean;
placeholder?: string;

View File

@ -5,6 +5,7 @@ const Color = require('color');
interface Props {
value: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onToggle: Function;
themeId: number;
}

View File

@ -18,6 +18,7 @@ const { clipboard } = require('electron');
interface ContextMenuProps {
notes: any[];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
watchedNoteFiles: string[];
plugins: PluginStates;

View File

@ -37,6 +37,7 @@ interface SearchResult {
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
folders: any[];
showCompletedTodos: boolean;
@ -61,6 +62,7 @@ interface CommandQuery {
class GotoAnything {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public dispatch: Function;
public static Dialog: any;
public static manifest: any;

View File

@ -2,5 +2,6 @@ import { AppState } from '../../app.reducer';
export interface DesktopCommandContext {
state: AppState;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -23,8 +23,11 @@ export interface Props {
fitToContent?: boolean;
borderBottom?: boolean;
theme?: any;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onSubmit?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onDismiss?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onReady?: Function;
}

View File

@ -1,6 +1,7 @@
import { useEffect, useState, useMemo } from 'react';
const md5 = require('md5');
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(frameWindow: any, isReady: boolean, postMessage: Function, html: string) {
const [loadedHtmlHash, setLoadedHtmlHash] = useState('');

View File

@ -1,5 +1,6 @@
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(postMessage: Function, isReady: boolean, scripts: string[], cssFilePath: string) {
useEffect(() => {
if (!isReady) return;

View File

@ -1,5 +1,6 @@
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(frameWindow: any, onSubmit: Function, onDismiss: Function, loadedHtmlHash: string) {
useEffect(() => {
if (!frameWindow) return () => {};

View File

@ -1,6 +1,7 @@
import PostMessageService, { MessageResponse, ResponderComponentType } from '@joplin/lib/services/PostMessageService';
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function(frameWindow: any, isReady: boolean, pluginId: string, viewId: string, postMessage: Function) {
useEffect(() => {
PostMessageService.instance().registerResponder(ResponderComponentType.UserWebview, viewId, (message: MessageResponse) => {

View File

@ -86,6 +86,7 @@ class CameraView extends Component {
}
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public renderButton(onPress: Function, iconNameOrIcon: any, style: any) {
let icon = null;

View File

@ -19,9 +19,13 @@ interface Props {
noteResources: any;
paddingBottom: number;
noteHash: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onJoplinLinkClick: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onCheckboxChange?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onMarkForDownload?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onLoadEnd?: Function;
}

View File

@ -1,6 +1,7 @@
import { useCallback } from 'react';
import shared from '@joplin/lib/components/shared/note-screen-shared';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function useOnMessage(onCheckboxChange: Function, noteBody: string, onMarkForDownload: Function, onJoplinLinkClick: Function, onResourceLongPress: Function) {
return useCallback((event: any) => {
// 2021-05-19: Historically this was unescaped twice as it was

View File

@ -8,6 +8,7 @@ import Resource from '@joplin/lib/models/Resource';
import { copyToCache } from '../../../utils/ShareUtils';
const Share = require('react-native-share').default;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default function useOnResourceLongPress(onJoplinLinkClick: Function, dialogBoxRef: any) {
return useCallback(async (msg: string) => {
try {

View File

@ -314,6 +314,7 @@ function NoteEditor(props: Props, ref: any) {
const msg = JSON.parse(data);
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const handlers: Record<string, Function> = {
onLog: (event: any) => {
// eslint-disable-next-line no-console

View File

@ -19,6 +19,7 @@ interface Navigation {
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
navigation: Navigation;
}

View File

@ -14,6 +14,7 @@ const { themeStyle } = require('../global-style');
interface Props {
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -12,6 +12,7 @@ const logger = Logger.create('BiometricPopup');
interface Props {
themeId: number;
sensorInfo: SensorInfo;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
}

View File

@ -457,6 +457,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private renderToggle(key: string, label: string, value: any, updateSettingValue: Function, descriptionComp: any = null) {
const theme = themeStyle(this.props.themeId);

View File

@ -23,6 +23,7 @@ Icon.loadFont().catch((error: any) => { console.info(error); });
interface Props {
syncStarted: boolean;
themeId: number;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
dispatch: Function;
collapsedFolderIds: string[];
syncReport: any;
@ -371,6 +372,7 @@ const SideMenuContentComponent = (props: Props) => {
);
};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const renderSidebarButton = (key: string, title: string, iconName: string, onPressHandler: Function = null, selected = false) => {
let icon = <Icon name={iconName} style={styles_.sidebarIcon} />;

View File

@ -82,6 +82,7 @@ export default (props: Props) => {
}, [recorder, props.onDismiss]);
const renderContent = () => {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
const components: Record<RecorderState, Function> = {
[RecorderState.Loading]: () => _('Loading...'),
[RecorderState.Recording]: () => _('Please record your voice...'),

View File

@ -410,6 +410,7 @@ function decryptionWorker_resourceMetadataButNotBlobDecrypted() {
ResourceFetcher.instance().scheduleAutoAddResources();
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
async function initialize(dispatch: Function) {
shimInit();

View File

@ -6,7 +6,9 @@ import { Profile, ProfileConfig } from '@joplin/lib/services/profileConfig/types
import { loadProfileConfig as libLoadProfileConfig, saveProfileConfig as libSaveProfileConfig } from '@joplin/lib/services/profileConfig/index';
import RNFetchBlob from 'rn-fetch-blob';
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
let dispatch_: Function = null;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export const setDispatch = (dispatch: Function) => {
dispatch_ = dispatch;
};

View File

@ -147,7 +147,9 @@ export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
const result: string[] = [];
const eventHandlers: any[] = [];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
let finalResultPromiseResolve: Function = null;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
let finalResultPromiseReject: Function = null;
let finalResultTimeout = false;
@ -213,6 +215,7 @@ export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
completeRecording('', new Error('Could not process your message. Please try again.'));
}, 5000);
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function, reject: Function) => {
finalResultPromiseResolve = resolve;
finalResultPromiseReject = reject;

View File

@ -11,6 +11,7 @@ type TData = {
type: string;
};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default (dispatch: Function, folderId: string) => {
const userInfo = { url: '' };
QuickActions.setShortcutItems([

View File

@ -7,6 +7,7 @@ const { ToastAndroid } = require('react-native');
const { PermissionsAndroid } = require('react-native');
const { Platform } = require('react-native');
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
export default async (sharedData: SharedData, folderId: string, dispatch: Function) => {
if (!!sharedData.resources && sharedData.resources.length > 0) {

View File

@ -309,6 +309,7 @@ export default class BaseApplication {
};
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public on(eventName: string, callback: Function) {
return this.eventEmitter_.on(eventName, callback);
}

View File

@ -81,6 +81,7 @@ class BaseModel {
public static TYPE_SMART_FILTER = ModelType.SmartFilter;
public static TYPE_COMMAND = ModelType.Command;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static dispatch: Function = function() {};
private static saveMutexes_: any = {};
@ -430,6 +431,7 @@ class BaseModel {
return mutex;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static releaseSaveMutex(modelOrId: any, release: Function) {
if (!release) return;
if (!modelOrId) return release();

View File

@ -7,6 +7,7 @@ import ShareService from './services/share/ShareService';
export default class BaseSyncTarget {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static dispatch: Function = () => {};
private synchronizer_: Synchronizer = null;

View File

@ -20,6 +20,7 @@ export default class ClipperServer {
private server_: any = null;
private port_: number = null;
private api_: Api = null;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private dispatch_: Function;
private static instance_: ClipperServer = null;
@ -52,6 +53,7 @@ export default class ClipperServer {
return this.logger_;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public setDispatch(d: Function) {
this.dispatch_ = d;
}

View File

@ -40,9 +40,13 @@ interface Target extends TargetOptions {
}
export interface LoggerWrapper {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
debug: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
info: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
warn: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
error: Function;
}
@ -248,8 +252,9 @@ class Logger {
// because that would slow down the main process, especially
// when many log operations are being done (eg. during sync in
// dev mode).
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
let release: Function = null;
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
/* eslint-disable-next-line promise/prefer-await-to-then, @typescript-eslint/ban-types -- Old code before rule was applied, Old code before rule was applied */
writeToFileMutex_.acquire().then((r: Function) => {
release = r;
return Logger.fsDriver().appendFile(target.path, `${line.join(': ')}\n`, 'utf8');

View File

@ -12,6 +12,7 @@ type IntervalId = number;
interface Interval {
id: IntervalId;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
callback: Function;
interval: number;
lastIntervalTime: number;
@ -29,6 +30,7 @@ export default class PoorManIntervals {
private static intervalId_: IntervalId = 0;
private static intervals_: Intervals = {};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static setInterval(callback: Function, interval: number): IntervalId {
if (interval <= this.maxNativeTimerDuration_) return setInterval(callback, interval);
@ -46,6 +48,7 @@ export default class PoorManIntervals {
return id;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static setTimeout(callback: Function, interval: number): IntervalId {
if (interval <= this.maxNativeTimerDuration_) return setTimeout(callback, interval);

View File

@ -72,9 +72,11 @@ export default class Synchronizer {
// such as cancelling in the middle of a loop.
public testingHooks_: string[] = [];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
private onProgress_: Function;
private progressReport_: any = {};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public dispatch: Function;
public constructor(db: JoplinDatabase, api: FileApi, appType: AppType) {

View File

@ -4,6 +4,7 @@ import Logger from './Logger';
interface Task {
id: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
callback: Function;
}
@ -32,6 +33,7 @@ export default class TaskQueue {
return Setting.value('sync.maxConcurrentConnections');
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public push(id: string, callback: Function) {
if (this.stopping_) throw new Error('Cannot push task when queue is stopping');

View File

@ -99,6 +99,7 @@ class WelcomeUtils {
return output;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public static async install(locale: string, dispatch: Function) {
if (!Setting.value('welcome.enabled')) {
Setting.setValue('welcome.wasBuilt', true);

View File

@ -21,6 +21,7 @@ export class EventManager {
this.appStateListeners_ = {};
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public on(eventName: string, callback: Function) {
return this.emitter_.on(eventName, callback);
}
@ -29,18 +30,22 @@ export class EventManager {
return this.emitter_.emit(eventName, object);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public removeListener(eventName: string, callback: Function) {
return this.emitter_.removeListener(eventName, callback);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public off(eventName: string, callback: Function) {
return this.removeListener(eventName, callback);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public filterOn(filterName: string, callback: Function) {
return this.emitter_.on(`filter:${filterName}`, callback);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public filterOff(filterName: string, callback: Function) {
return this.removeListener(`filter:${filterName}`, callback);
}
@ -67,6 +72,7 @@ export class EventManager {
return output;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public appStateOn(propName: string, callback: Function) {
if (!this.appStateListeners_[propName]) {
this.appStateListeners_[propName] = [];
@ -76,6 +82,7 @@ export class EventManager {
this.appStateListeners_[propName].push(callback);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public appStateOff(propName: string, callback: Function) {
if (!this.appStateListeners_[propName]) {
throw new Error('EventManager: Trying to unregister a state prop watch for a non-watched prop (1)');

View File

@ -60,6 +60,7 @@ function requestCanBeRepeated(error: any) {
return true;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
async function tryAndRepeat(fn: Function, count: number) {
let retryCount = 0;
@ -99,6 +100,7 @@ class FileApi {
private remoteDateMutex_ = new Mutex();
private initialized_ = false;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public constructor(baseDir: string | Function, driver: any) {
this.baseDir_ = baseDir;
this.driver_ = driver;
@ -397,6 +399,7 @@ function basicDeltaContextFromOptions_(options: any) {
// This is the basic delta algorithm, which can be used in case the cloud service does not have
// a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously
// the file system do not.
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
async function basicDelta(path: string, getDirStatFn: Function, options: any) {
const outputLimit = 50;
const itemIds = await options.allItemIdsHandler();

View File

@ -85,6 +85,7 @@ class HtmlUtils {
return html.replace(htmlReg, `:/${id}`);
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public replaceImageUrls(html: string, callback: Function) {
return this.processImageTags(html, (data: any) => {
const newSrc = callback(data.src);
@ -95,6 +96,7 @@ class HtmlUtils {
});
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public replaceEmbedUrls(html: string, callback: Function) {
if (!html) return '';
// We are adding the link as <a> since joplin disabled <embed>, <object> tags due to security reasons.
@ -110,6 +112,7 @@ class HtmlUtils {
return html;
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public replaceMediaUrls(html: string, callback: Function) {
html = this.replaceImageUrls(html, callback);
html = this.replaceEmbedUrls(html, callback);
@ -121,6 +124,7 @@ class HtmlUtils {
// file path is going to be used, it will need to be unescaped first. The
// transformed SRC, must also be escaped before being sent back to this
// function.
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public processImageTags(html: string, callback: Function) {
if (!html) return '';

View File

@ -224,7 +224,9 @@ async function saveNoteTags(note: ExtractedNote) {
interface ImportOptions {
fuzzyMatching?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onProgress?: Function;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
onError?: Function;
outputFormat?: string;
}
@ -326,6 +328,7 @@ export default async function importEnex(parentFolderId: string, filePath: strin
if (!('onProgress' in importOptions)) importOptions.onProgress = function() {};
if (!('onError' in importOptions)) importOptions.onError = function() {};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function handleSaxStreamEvent(fn: Function) {
return function(...args: any[]) {
// Pass the parser to the wrapped function for debugging purposes

View File

@ -16,6 +16,7 @@ export enum MarkdownTableJustify {
export interface MarkdownTableHeader {
name: string;
label: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
filter?: Function;
disableEscape?: boolean;
justify?: MarkdownTableJustify;

View File

@ -57,6 +57,7 @@ export interface SettingItem {
isEnum?: boolean;
section?: string;
label?(): string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
description?: Function;
options?(): any;
optionsOrder?(): string[];
@ -69,6 +70,7 @@ export interface SettingItem {
maximum?: number;
step?: number;
onClick?(): void;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
unitLabel?: Function;
needRestart?: boolean;
autoSave?: boolean;
@ -207,6 +209,7 @@ const defaultMigrations: DefaultMigration[] = [
interface UserSettingMigration {
oldName: string;
newName: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
transformValue: Function;
}

View File

@ -22,6 +22,7 @@ const parseNtpServer = (ntpServer: string): NtpServer => {
};
export async function getNetworkTime(ntpServer: string): Promise<Date> {
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
return new Promise((resolve: Function, reject: Function) => {
const s = parseNtpServer(ntpServer);
ntpClient().getNetworkTime(s.domain, s.port, (error: any, date: Date) => {

View File

@ -44,6 +44,7 @@ export default class OneDriveApi {
}
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
public on(eventName: string, callback: Function) {
this.listeners_[eventName].push(callback);
}

View File

@ -93,6 +93,7 @@ class Registry {
if (delay === null) delay = 1000 * 10;
if (syncOptions === null) syncOptions = {};
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
let promiseResolve: Function = null;
const promise = new Promise((resolve) => {
promiseResolve = resolve;

Some files were not shown because too many files have changed in this diff Show More