mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Tools: Implement @typescript-eslint/no-explicit-any rule
This commit is contained in:
parent
42900bcc66
commit
2e2a2b3193
@ -112,6 +112,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'@typescript-eslint/no-explicit-any': ['error'],
|
||||||
|
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
// Formatting
|
// Formatting
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
@ -41,6 +41,7 @@ class LinkSelector {
|
|||||||
const newLinkStore: LinkStoreEntry[] = [];
|
const newLinkStore: LinkStoreEntry[] = [];
|
||||||
const lines: string[] = renderedText.split('\n');
|
const lines: string[] = renderedText.split('\n');
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const r = (lines[i] as any).matchAll(this.linkRegex_);
|
const r = (lines[i] as any).matchAll(this.linkRegex_);
|
||||||
const matches = [...r];
|
const matches = [...r];
|
||||||
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
|
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
|
||||||
@ -63,12 +64,14 @@ class LinkSelector {
|
|||||||
this.linkStore_ = this.findLinks(this.renderedText_);
|
this.linkStore_ = this.findLinks(this.renderedText_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public updateNote(textWidget: any): void {
|
public updateNote(textWidget: any): void {
|
||||||
this.noteId_ = textWidget.noteId;
|
this.noteId_ = textWidget.noteId;
|
||||||
this.scrollTop_ = textWidget.scrollTop_;
|
this.scrollTop_ = textWidget.scrollTop_;
|
||||||
this.updateText(textWidget.renderedText_);
|
this.updateText(textWidget.renderedText_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public scrollWidget(textWidget: any): void {
|
public scrollWidget(textWidget: any): void {
|
||||||
if (this.currentLinkIndex_ === null) return;
|
if (this.currentLinkIndex_ === null) return;
|
||||||
|
|
||||||
@ -94,6 +97,7 @@ class LinkSelector {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public changeLink(textWidget: any, offset: number): void | null {
|
public changeLink(textWidget: any, offset: number): void | null {
|
||||||
if (textWidget.noteId !== this.noteId_) {
|
if (textWidget.noteId !== this.noteId_) {
|
||||||
this.updateNote(textWidget);
|
this.updateNote(textWidget);
|
||||||
@ -124,6 +128,7 @@ class LinkSelector {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public openLink(textWidget: any): void {
|
public openLink(textWidget: any): void {
|
||||||
if (textWidget.noteId !== this.noteId_) return;
|
if (textWidget.noteId !== this.noteId_) return;
|
||||||
if (textWidget.renderedText_ !== this.renderedText_) return;
|
if (textWidget.renderedText_ !== this.renderedText_) return;
|
||||||
|
@ -22,10 +22,14 @@ const { splitCommandBatch } = require('@joplin/lib/string-utils');
|
|||||||
|
|
||||||
class Application extends BaseApplication {
|
class Application extends BaseApplication {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private commands_: Record<string, any> = {};
|
private commands_: Record<string, any> = {};
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private commandMetadata_: any = null;
|
private commandMetadata_: any = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private activeCommand_: any = null;
|
private activeCommand_: any = null;
|
||||||
private allCommandsLoaded_ = false;
|
private allCommandsLoaded_ = false;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private gui_: any = null;
|
private gui_: any = null;
|
||||||
private cache_ = new Cache();
|
private cache_ = new Cache();
|
||||||
|
|
||||||
@ -37,6 +41,7 @@ class Application extends BaseApplication {
|
|||||||
return this.gui().stdoutMaxWidth();
|
return this.gui().stdoutMaxWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async guessTypeAndLoadItem(pattern: string, options: any = null) {
|
public async guessTypeAndLoadItem(pattern: string, options: any = null) {
|
||||||
let type = BaseModel.TYPE_NOTE;
|
let type = BaseModel.TYPE_NOTE;
|
||||||
if (pattern.indexOf('/') === 0) {
|
if (pattern.indexOf('/') === 0) {
|
||||||
@ -46,6 +51,7 @@ class Application extends BaseApplication {
|
|||||||
return this.loadItem(type, pattern, options);
|
return this.loadItem(type, pattern, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async loadItem(type: ModelType | 'folderOrNote', pattern: string, options: any = null) {
|
public async loadItem(type: ModelType | 'folderOrNote', pattern: string, options: any = null) {
|
||||||
const output = await this.loadItems(type, pattern, options);
|
const output = await this.loadItems(type, pattern, options);
|
||||||
|
|
||||||
@ -70,6 +76,7 @@ class Application extends BaseApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async loadItems(type: ModelType | 'folderOrNote', pattern: string, options: any = null): Promise<(FolderEntity | NoteEntity)[]> {
|
public async loadItems(type: ModelType | 'folderOrNote', pattern: string, options: any = null): Promise<(FolderEntity | NoteEntity)[]> {
|
||||||
if (type === 'folderOrNote') {
|
if (type === 'folderOrNote') {
|
||||||
const folders: FolderEntity[] = await this.loadItems(BaseModel.TYPE_FOLDER, pattern, options);
|
const folders: FolderEntity[] = await this.loadItems(BaseModel.TYPE_FOLDER, pattern, options);
|
||||||
@ -160,6 +167,7 @@ class Application extends BaseApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uiType !== null) {
|
if (uiType !== null) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const temp: Record<string, any> = {};
|
const temp: Record<string, any> = {};
|
||||||
for (const n in this.commands_) {
|
for (const n in this.commands_) {
|
||||||
if (!this.commands_.hasOwnProperty(n)) continue;
|
if (!this.commands_.hasOwnProperty(n)) continue;
|
||||||
@ -219,6 +227,7 @@ class Application extends BaseApplication {
|
|||||||
CommandClass = require(`${__dirname}/command-${name}.js`);
|
CommandClass = require(`${__dirname}/command-${name}.js`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message && error.message.indexOf('Cannot find module') >= 0) {
|
if (error.message && error.message.indexOf('Cannot find module') >= 0) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const e: any = new Error(_('No such command: %s', name));
|
const e: any = new Error(_('No such command: %s', name));
|
||||||
e.type = 'notFound';
|
e.type = 'notFound';
|
||||||
throw e;
|
throw e;
|
||||||
@ -238,6 +247,7 @@ class Application extends BaseApplication {
|
|||||||
isDummy: () => {
|
isDummy: () => {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
prompt: (initialText = '', promptString = '', options: any = null) => {
|
prompt: (initialText = '', promptString = '', options: any = null) => {
|
||||||
return cliUtils.prompt(initialText, promptString, options);
|
return cliUtils.prompt(initialText, promptString, options);
|
||||||
},
|
},
|
||||||
@ -260,6 +270,7 @@ class Application extends BaseApplication {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async execCommand(argv: string[]): Promise<any> {
|
public async execCommand(argv: string[]): Promise<any> {
|
||||||
if (!argv.length) return this.execCommand(['help']);
|
if (!argv.length) return this.execCommand(['help']);
|
||||||
// reg.logger().debug('execCommand()', argv);
|
// reg.logger().debug('execCommand()', argv);
|
||||||
@ -390,6 +401,7 @@ class Application extends BaseApplication {
|
|||||||
|
|
||||||
argv = await super.start(argv, { keychainEnabled });
|
argv = await super.start(argv, { keychainEnabled });
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
cliUtils.setStdout((object: any) => {
|
cliUtils.setStdout((object: any) => {
|
||||||
return this.stdout(object);
|
return this.stdout(object);
|
||||||
});
|
});
|
||||||
@ -439,6 +451,7 @@ class Application extends BaseApplication {
|
|||||||
// initialised. So we manually call dispatchUpdateAll() to force an update.
|
// initialised. So we manually call dispatchUpdateAll() to force an update.
|
||||||
Setting.dispatchUpdateAll();
|
Setting.dispatchUpdateAll();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
await refreshFolders((action: any) => this.store().dispatch(action));
|
await refreshFolders((action: any) => this.store().dispatch(action));
|
||||||
|
|
||||||
const tags = await Tag.allWithNotes();
|
const tags = await Tag.allWithNotes();
|
||||||
|
@ -3,14 +3,18 @@ import { reg } from '@joplin/lib/registry.js';
|
|||||||
|
|
||||||
export default class BaseCommand {
|
export default class BaseCommand {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
protected stdout_: any = null;
|
protected stdout_: any = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
protected prompt_: any = null;
|
protected prompt_: any = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
protected dispatcher_: any;
|
protected dispatcher_: any;
|
||||||
|
|
||||||
public usage(): string {
|
public usage(): string {
|
||||||
throw new Error('Usage not defined');
|
throw new Error('Usage not defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public encryptionCheck(item: any) {
|
public encryptionCheck(item: any) {
|
||||||
if (item && item.encryption_applied) throw new Error(_('Cannot change encrypted item'));
|
if (item && item.encryption_applied) throw new Error(_('Cannot change encrypted item'));
|
||||||
}
|
}
|
||||||
@ -19,6 +23,7 @@ export default class BaseCommand {
|
|||||||
throw new Error('Description not defined');
|
throw new Error('Description not defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(_args: any) {
|
public async action(_args: any) {
|
||||||
throw new Error('Action not defined');
|
throw new Error('Action not defined');
|
||||||
}
|
}
|
||||||
@ -31,6 +36,7 @@ export default class BaseCommand {
|
|||||||
return this.compatibleUis().indexOf(ui) >= 0;
|
return this.compatibleUis().indexOf(ui) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public options(): any[] {
|
public options(): any[] {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -59,6 +65,7 @@ export default class BaseCommand {
|
|||||||
this.dispatcher_ = fn;
|
this.dispatcher_ = fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public dispatch(action: any) {
|
public dispatch(action: any) {
|
||||||
if (!this.dispatcher_) throw new Error('Dispatcher not defined');
|
if (!this.dispatcher_) throw new Error('Dispatcher not defined');
|
||||||
return this.dispatcher_(action);
|
return this.dispatcher_(action);
|
||||||
@ -78,6 +85,7 @@ export default class BaseCommand {
|
|||||||
this.prompt_ = fn;
|
this.prompt_ = fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async prompt(message: string, options: any = null) {
|
public async prompt(message: string, options: any = null) {
|
||||||
if (!this.prompt_) throw new Error('Prompt is undefined');
|
if (!this.prompt_) throw new Error('Prompt is undefined');
|
||||||
return await this.prompt_(message, options);
|
return await this.prompt_(message, options);
|
||||||
|
@ -37,6 +37,7 @@ class Command extends BaseCommand {
|
|||||||
return markdownUtils.createMarkdownTable(headers, tableFields);
|
return markdownUtils.createMarkdownTable(headers, tableFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const models = [
|
const models = [
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Attaches the given file to the note.');
|
return _('Attaches the given file to the note.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const title = args['note'];
|
const title = args['note'];
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ class Command extends BaseCommand {
|
|||||||
return [['-v, --verbose', _('Displays the complete information about note.')]];
|
return [['-v, --verbose', _('Displays the complete information about note.')]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const title = args['note'];
|
const title = args['note'];
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ class Command extends BaseCommand {
|
|||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
// being defensive and not attempting to settle twice
|
// being defensive and not attempting to settle twice
|
||||||
let isSettled = false;
|
let isSettled = false;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const chunks: any = [];
|
const chunks: any = [];
|
||||||
|
|
||||||
inputStream.on('readable', () => {
|
inputStream.on('readable', () => {
|
||||||
@ -67,6 +68,7 @@ class Command extends BaseCommand {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const verbose = args.options.verbose;
|
const verbose = args.options.verbose;
|
||||||
const isExport = args.options.export;
|
const isExport = args.options.export;
|
||||||
@ -91,6 +93,7 @@ class Command extends BaseCommand {
|
|||||||
keys.sort();
|
keys.sort();
|
||||||
|
|
||||||
if (isExport) {
|
if (isExport) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const resultObj = keys.reduce<Record<string, any>>((acc, key) => {
|
const resultObj = keys.reduce<Record<string, any>>((acc, key) => {
|
||||||
const value = Setting.value(key);
|
const value = Setting.value(key);
|
||||||
if (!verbose && !value) return acc;
|
if (!verbose && !value) return acc;
|
||||||
|
@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Duplicates the notes matching <note> to [notebook]. If no notebook is specified the note is duplicated in the current notebook.');
|
return _('Duplicates the notes matching <note> to [notebook]. If no notebook is specified the note is duplicated in the current notebook.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
let folder = null;
|
let folder = null;
|
||||||
if (args['notebook']) {
|
if (args['notebook']) {
|
||||||
|
@ -15,6 +15,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Marks a to-do as done.');
|
return _('Marks a to-do as done.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public static async handleAction(commandInstance: BaseCommand, args: any, isCompleted: boolean) {
|
public static async handleAction(commandInstance: BaseCommand, args: any, isCompleted: boolean) {
|
||||||
const note: NoteEntity = await app().loadItem(BaseModel.TYPE_NOTE, args.note);
|
const note: NoteEntity = await app().loadItem(BaseModel.TYPE_NOTE, args.note);
|
||||||
commandInstance.encryptionCheck(note);
|
commandInstance.encryptionCheck(note);
|
||||||
@ -31,6 +32,7 @@ class Command extends BaseCommand {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
await Command.handleAction(this, args, true);
|
await Command.handleAction(this, args, true);
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,11 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(args: any) {
|
public async action(args: any) {
|
||||||
const options = args.options;
|
const options = args.options;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const askForMasterKey = async (error: any) => {
|
const askForMasterKey = async (error: any) => {
|
||||||
const masterKeyId = error.masterKeyId;
|
const masterKeyId = error.masterKeyId;
|
||||||
const password = await this.prompt(_('Enter master password:'), { type: 'string', secure: true });
|
const password = await this.prompt(_('Enter master password:'), { type: 'string', secure: true });
|
||||||
|
@ -17,6 +17,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Edit note.');
|
return _('Edit note.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
let tempFilePath: string|null = null;
|
let tempFilePath: string|null = null;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ class Command extends BaseCommand {
|
|||||||
return [['--format <format>', _('Destination format: %s', formats.join(', '))], ['--note <note>', _('Exports only the given note.')], ['--notebook <notebook>', _('Exports only the given notebook.')]];
|
return [['--format <format>', _('Destination format: %s', formats.join(', '))], ['--note <note>', _('Exports only the given note.')], ['--notebook <notebook>', _('Exports only the given notebook.')]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const exportOptions: ExportOptions = {};
|
const exportOptions: ExportOptions = {};
|
||||||
exportOptions.path = args.path;
|
exportOptions.path = args.path;
|
||||||
@ -35,10 +36,12 @@ class Command extends BaseCommand {
|
|||||||
if (args.options.note) {
|
if (args.options.note) {
|
||||||
const notes = await app().loadItems(BaseModel.TYPE_NOTE, args.options.note, { parent: app().currentFolder() });
|
const notes = await app().loadItems(BaseModel.TYPE_NOTE, args.options.note, { parent: app().currentFolder() });
|
||||||
if (!notes.length) throw new Error(_('Cannot find "%s".', args.options.note));
|
if (!notes.length) throw new Error(_('Cannot find "%s".', args.options.note));
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
exportOptions.sourceNoteIds = notes.map((n: any) => n.id);
|
exportOptions.sourceNoteIds = notes.map((n: any) => n.id);
|
||||||
} else if (args.options.notebook) {
|
} else if (args.options.notebook) {
|
||||||
const folders = await app().loadItems(BaseModel.TYPE_FOLDER, args.options.notebook);
|
const folders = await app().loadItems(BaseModel.TYPE_FOLDER, args.options.notebook);
|
||||||
if (!folders.length) throw new Error(_('Cannot find "%s".', args.options.notebook));
|
if (!folders.length) throw new Error(_('Cannot find "%s".', args.options.notebook));
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
exportOptions.sourceFolderIds = folders.map((n: any) => n.id);
|
exportOptions.sourceFolderIds = folders.map((n: any) => n.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Displays a geolocation URL for the note.');
|
return _('Displays a geolocation URL for the note.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const title = args['note'];
|
const title = args['note'];
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ class Command extends BaseCommand {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const stdoutWidth = app().commandStdoutMaxWidth();
|
const stdoutWidth = app().commandStdoutMaxWidth();
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args.notebook);
|
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args.notebook);
|
||||||
|
|
||||||
|
@ -34,11 +34,13 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['note-pattern'];
|
const pattern = args['note-pattern'];
|
||||||
let items = [];
|
let items = [];
|
||||||
const options = args.options;
|
const options = args.options;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const queryOptions: any = {};
|
const queryOptions: any = {};
|
||||||
if (options.limit) queryOptions.limit = options.limit;
|
if (options.limit) queryOptions.limit = options.limit;
|
||||||
if (options.sort) {
|
if (options.sort) {
|
||||||
|
@ -43,6 +43,7 @@ class Command extends BaseCommand {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(args: any) {
|
public async action(args: any) {
|
||||||
const targetFolder = args.options.parent;
|
const targetFolder = args.options.parent;
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Moves the given <item> to [notebook]');
|
return _('Moves the given <item> to [notebook]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['item'];
|
const pattern = args['item'];
|
||||||
const destination = args['notebook'];
|
const destination = args['notebook'];
|
||||||
|
@ -14,6 +14,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Renames the given <item> (note or notebook) to <name>.');
|
return _('Renames the given <item> (note or notebook) to <name>.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['item'];
|
const pattern = args['item'];
|
||||||
const name = args['name'];
|
const name = args['name'];
|
||||||
|
@ -12,6 +12,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Restore the items matching <pattern> from the trash.');
|
return _('Restore the items matching <pattern> from the trash.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['pattern'];
|
const pattern = args['pattern'];
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['notebook'];
|
const pattern = args['notebook'];
|
||||||
const force = args.options && args.options.force === true;
|
const force = args.options && args.options.force === true;
|
||||||
|
@ -21,6 +21,7 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const pattern = args['note-pattern'];
|
const pattern = args['note-pattern'];
|
||||||
const force = args.options && args.options.force === true;
|
const force = args.options && args.options.force === true;
|
||||||
|
@ -22,6 +22,7 @@ class Command extends BaseCommand {
|
|||||||
return _('Sets the property <name> of the given <note> to the given [value]. Possible properties are:\n\n%s', s.join(', '));
|
return _('Sets the property <name> of the given <note> to the given [value]. Possible properties are:\n\n%s', s.join(', '));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const title = args['note'];
|
const title = args['note'];
|
||||||
const propName = args['name'];
|
const propName = args['name'];
|
||||||
@ -36,6 +37,7 @@ class Command extends BaseCommand {
|
|||||||
|
|
||||||
const timestamp = Date.now();
|
const timestamp = Date.now();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const newNote: any = {
|
const newNote: any = {
|
||||||
id: notes[i].id,
|
id: notes[i].id,
|
||||||
type_: notes[i].type_,
|
type_: notes[i].type_,
|
||||||
|
@ -35,7 +35,9 @@ class Command extends BaseCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(args: any) {
|
public async action(args: any) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const schema: Record<string, any> = {
|
const schema: Record<string, any> = {
|
||||||
title: 'JSON schema for Joplin setting files',
|
title: 'JSON schema for Joplin setting files',
|
||||||
'$id': Setting.schemaUrl,
|
'$id': Setting.schemaUrl,
|
||||||
@ -52,6 +54,7 @@ class Command extends BaseCommand {
|
|||||||
const type = settingTypeToSchemaType(md.type);
|
const type = settingTypeToSchemaType(md.type);
|
||||||
if (!type) continue;
|
if (!type) continue;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const props: Record<string, any> = {};
|
const props: Record<string, any> = {};
|
||||||
props.type = type;
|
props.type = type;
|
||||||
props.default = md.value;
|
props.default = md.value;
|
||||||
@ -61,6 +64,7 @@ class Command extends BaseCommand {
|
|||||||
if (md.description && md.description('desktop')) description.push(md.description('desktop'));
|
if (md.description && md.description('desktop')) description.push(md.description('desktop'));
|
||||||
|
|
||||||
if (description.length) props.description = description.join('. ');
|
if (description.length) props.description = description.join('. ');
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
if (md.isEnum) props.enum = Object.keys(md.options()).map((v: any) => Setting.formatValue(key, v));
|
if (md.isEnum) props.enum = Object.keys(md.options()).map((v: any) => Setting.formatValue(key, v));
|
||||||
if ('minimum' in md) props.minimum = md.minimum;
|
if ('minimum' in md) props.minimum = md.minimum;
|
||||||
if ('maximum' in md) props.maximum = md.maximum;
|
if ('maximum' in md) props.maximum = md.maximum;
|
||||||
|
@ -25,6 +25,7 @@ class Command extends BaseCommand {
|
|||||||
private syncTargetId_: number = null;
|
private syncTargetId_: number = null;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private releaseLockFn_: Function = null;
|
private releaseLockFn_: Function = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private oneDriveApiUtils_: any = null;
|
private oneDriveApiUtils_: any = null;
|
||||||
|
|
||||||
public usage() {
|
public usage() {
|
||||||
@ -59,6 +60,7 @@ class Command extends BaseCommand {
|
|||||||
// OneDrive
|
// OneDrive
|
||||||
this.oneDriveApiUtils_ = new OneDriveApiNodeUtils(syncTarget.api());
|
this.oneDriveApiUtils_ = new OneDriveApiNodeUtils(syncTarget.api());
|
||||||
const auth = await this.oneDriveApiUtils_.oauthDance({
|
const auth = await this.oneDriveApiUtils_.oauthDance({
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
log: (...s: any[]) => {
|
log: (...s: any[]) => {
|
||||||
return this.stdout(...s);
|
return this.stdout(...s);
|
||||||
},
|
},
|
||||||
@ -133,6 +135,7 @@ class Command extends BaseCommand {
|
|||||||
return !!this.oneDriveApiUtils_;
|
return !!this.oneDriveApiUtils_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(args: any) {
|
public async action(args: any) {
|
||||||
this.releaseLockFn_ = null;
|
this.releaseLockFn_ = null;
|
||||||
|
|
||||||
@ -181,7 +184,9 @@ class Command extends BaseCommand {
|
|||||||
|
|
||||||
const sync = await syncTarget.synchronizer();
|
const sync = await syncTarget.synchronizer();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const options: any = {
|
const options: any = {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onProgress: (report: any) => {
|
onProgress: (report: any) => {
|
||||||
const lines = Synchronizer.reportToLines(report);
|
const lines = Synchronizer.reportToLines(report);
|
||||||
if (lines.length) cliUtils.redraw(lines.join(' '));
|
if (lines.length) cliUtils.redraw(lines.join(' '));
|
||||||
|
@ -6,11 +6,13 @@ import populateDatabase from '@joplin/lib/services/debug/populateDatabase';
|
|||||||
import { readCredentialFile } from '@joplin/lib/utils/credentialFiles';
|
import { readCredentialFile } from '@joplin/lib/utils/credentialFiles';
|
||||||
import JoplinServerApi from '@joplin/lib/JoplinServerApi';
|
import JoplinServerApi from '@joplin/lib/JoplinServerApi';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function randomElement(array: any[]): any {
|
function randomElement(array: any[]): any {
|
||||||
if (!array.length) return null;
|
if (!array.length) return null;
|
||||||
return array[Math.floor(Math.random() * array.length)];
|
return array[Math.floor(Math.random() * array.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function itemCount(args: any) {
|
function itemCount(args: any) {
|
||||||
const count = Number(args.arg0);
|
const count = Number(args.arg0);
|
||||||
if (!count || isNaN(count)) throw new Error('Note count must be specified');
|
if (!count || isNaN(count)) throw new Error('Note count must be specified');
|
||||||
@ -30,6 +32,7 @@ class Command extends BaseCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public options(): any[] {
|
public options(): any[] {
|
||||||
return [
|
return [
|
||||||
['--folder-count <count>', 'Folders to create'],
|
['--folder-count <count>', 'Folders to create'],
|
||||||
@ -40,6 +43,7 @@ class Command extends BaseCommand {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async action(args: any) {
|
public async action(args: any) {
|
||||||
const { command, options } = args;
|
const { command, options } = args;
|
||||||
|
|
||||||
@ -53,6 +57,7 @@ class Command extends BaseCommand {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const promises: any[] = [];
|
const promises: any[] = [];
|
||||||
|
|
||||||
if (command === 'createRandomNotes') {
|
if (command === 'createRandomNotes') {
|
||||||
|
@ -16,6 +16,7 @@ class Command extends BaseCommand {
|
|||||||
return ['cli'];
|
return ['cli'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public override async action(args: any) {
|
public override async action(args: any) {
|
||||||
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args['notebook']);
|
const folder = await app().loadItem(BaseModel.TYPE_FOLDER, args['notebook']);
|
||||||
if (!folder) throw new Error(_('Cannot find "%s".', args['notebook']));
|
if (!folder) throw new Error(_('Cannot find "%s".', args['notebook']));
|
||||||
|
@ -25,6 +25,7 @@ export default class FolderListWidget extends ListWidget {
|
|||||||
this.trimItemTitle = false;
|
this.trimItemTitle = false;
|
||||||
this.showIds = false;
|
this.showIds = false;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.itemRenderer = (item: any) => {
|
this.itemRenderer = (item: any) => {
|
||||||
const output = [];
|
const output = [];
|
||||||
if (item === '-') {
|
if (item === '-') {
|
||||||
@ -42,6 +43,7 @@ export default class FolderListWidget extends ListWidget {
|
|||||||
if (this.folderHasChildren_(this.folders, item.id)) {
|
if (this.folderHasChildren_(this.folders, item.id)) {
|
||||||
for (let i = 0; i < this.folders.length; i++) {
|
for (let i = 0; i < this.folders.length; i++) {
|
||||||
if (this.folders[i].parent_id === item.id) {
|
if (this.folders[i].parent_id === item.id) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
noteCount -= (this.folders[i] as any).note_count;
|
noteCount -= (this.folders[i] as any).note_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,6 +167,7 @@ export default class FolderListWidget extends ListWidget {
|
|||||||
|
|
||||||
this.logger().info('FFFFFFFFFFFFF', JSON.stringify(this.folders, null, 4));
|
this.logger().info('FFFFFFFFFFFFF', JSON.stringify(this.folders, null, 4));
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let newItems: any[] = [];
|
let newItems: any[] = [];
|
||||||
const orderFolders = (parentId: string) => {
|
const orderFolders = (parentId: string) => {
|
||||||
this.logger().info('PARENT', parentId);
|
this.logger().info('PARENT', parentId);
|
||||||
|
@ -27,6 +27,7 @@ export default class StatusBarWidget extends BaseWidget {
|
|||||||
this.invalidate();
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async prompt(initialText = '', promptString: any = null, options: any = null) {
|
public async prompt(initialText = '', promptString: any = null, options: any = null) {
|
||||||
if (this.promptState_) throw new Error('Another prompt already active');
|
if (this.promptState_) throw new Error('Another prompt already active');
|
||||||
if (promptString === null) promptString = ':';
|
if (promptString === null) promptString = ':';
|
||||||
@ -86,6 +87,7 @@ export default class StatusBarWidget extends BaseWidget {
|
|||||||
|
|
||||||
// const textStyle = this.promptActive ? (s) => s : chalk.bgBlueBright.white;
|
// const textStyle = this.promptActive ? (s) => s : chalk.bgBlueBright.white;
|
||||||
// const textStyle = (s) => s;
|
// const textStyle = (s) => s;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const textStyle = this.promptActive ? (s: any) => s : chalk.gray;
|
const textStyle = this.promptActive ? (s: any) => s : chalk.gray;
|
||||||
|
|
||||||
this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' '));
|
this.term.drawHLine(this.absoluteInnerX, this.absoluteInnerY, this.innerWidth, textStyle(' '));
|
||||||
@ -106,6 +108,7 @@ export default class StatusBarWidget extends BaseWidget {
|
|||||||
|
|
||||||
const isSecurePrompt = !!this.promptState_.secure;
|
const isSecurePrompt = !!this.promptState_.secure;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const options: any = {
|
const options: any = {
|
||||||
cancelable: true,
|
cancelable: true,
|
||||||
history: this.history,
|
history: this.history,
|
||||||
@ -118,6 +121,7 @@ export default class StatusBarWidget extends BaseWidget {
|
|||||||
if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition;
|
if ('cursorPosition' in this.promptState_) options.cursorPosition = this.promptState_.cursorPosition;
|
||||||
if (isSecurePrompt) options.echoChar = true;
|
if (isSecurePrompt) options.echoChar = true;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.inputEventEmitter_ = this.term.inputField(options, (error: any, input: any) => {
|
this.inputEventEmitter_ = this.term.inputField(options, (error: any, input: any) => {
|
||||||
let resolveResult = null;
|
let resolveResult = null;
|
||||||
const resolveFn = this.promptState_.resolve;
|
const resolveFn = this.promptState_.resolve;
|
||||||
|
@ -8,14 +8,17 @@ import uuid from '@joplin/lib/uuid';
|
|||||||
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');
|
const sandboxProxy = require('@joplin/lib/services/plugins/sandboxProxy');
|
||||||
|
|
||||||
function createConsoleWrapper(pluginId: string) {
|
function createConsoleWrapper(pluginId: string) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const wrapper: any = {};
|
const wrapper: any = {};
|
||||||
|
|
||||||
for (const n in console) {
|
for (const n in console) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
if (!console.hasOwnProperty(n)) continue;
|
if (!console.hasOwnProperty(n)) continue;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
wrapper[n] = (...args: any[]) => {
|
wrapper[n] = (...args: any[]) => {
|
||||||
const newArgs = args.slice();
|
const newArgs = args.slice();
|
||||||
newArgs.splice(0, 0, `Plugin "${pluginId}":`);
|
newArgs.splice(0, 0, `Plugin "${pluginId}":`);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
return (console as any)[n](...newArgs);
|
return (console as any)[n](...newArgs);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -33,6 +36,7 @@ function createConsoleWrapper(pluginId: string) {
|
|||||||
export default class PluginRunner extends BasePluginRunner {
|
export default class PluginRunner extends BasePluginRunner {
|
||||||
|
|
||||||
private eventHandlers_: EventHandlers = {};
|
private eventHandlers_: EventHandlers = {};
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private activeSandboxCalls_: any = {};
|
private activeSandboxCalls_: any = {};
|
||||||
|
|
||||||
public constructor() {
|
public constructor() {
|
||||||
@ -41,12 +45,14 @@ export default class PluginRunner extends BasePluginRunner {
|
|||||||
this.eventHandler = this.eventHandler.bind(this);
|
this.eventHandler = this.eventHandler.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private async eventHandler(eventHandlerId: string, args: any[]) {
|
private async eventHandler(eventHandlerId: string, args: any[]) {
|
||||||
const cb = this.eventHandlers_[eventHandlerId];
|
const cb = this.eventHandlers_[eventHandlerId];
|
||||||
return cb(...args);
|
return cb(...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private newSandboxProxy(pluginId: string, sandbox: Global) {
|
private newSandboxProxy(pluginId: string, sandbox: Global) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const target = async (path: string, args: any[]) => {
|
const target = async (path: string, args: any[]) => {
|
||||||
const callId = `${pluginId}::${path}::${uuid.createNano()}`;
|
const callId = `${pluginId}::${path}::${uuid.createNano()}`;
|
||||||
this.activeSandboxCalls_[callId] = true;
|
this.activeSandboxCalls_[callId] = true;
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { _ } from '@joplin/lib/locale';
|
import { _ } from '@joplin/lib/locale';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied
|
||||||
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
||||||
cmd.setStdout((text: string) => {
|
cmd.setStdout((text: string) => {
|
||||||
return stdout(text);
|
return stdout(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
cmd.setDispatcher((action: any) => {
|
cmd.setDispatcher((action: any) => {
|
||||||
if (store()) {
|
if (store()) {
|
||||||
return store().dispatch(action);
|
return store().dispatch(action);
|
||||||
@ -14,6 +15,7 @@ export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
cmd.setPrompt(async (message: string, options: any) => {
|
cmd.setPrompt(async (message: string, options: any) => {
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
if (!options.type) options.type = 'boolean';
|
if (!options.type) options.type = 'boolean';
|
||||||
|
@ -3,7 +3,7 @@ import Folder from '@joplin/lib/models/Folder';
|
|||||||
import BaseCommand from '../base-command';
|
import BaseCommand from '../base-command';
|
||||||
import setupCommand from '../setupCommand';
|
import setupCommand from '../setupCommand';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any -- Old code before rule was applied, Old code before rule was applied
|
||||||
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
|
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
|
||||||
const command = new CommandClass();
|
const command = new CommandClass();
|
||||||
setupCommand(command, stdout, null, null);
|
setupCommand(command, stdout, null, null);
|
||||||
|
@ -22,6 +22,7 @@ describe('HtmlToMd', () => {
|
|||||||
|
|
||||||
// if (htmlFilename.indexOf('image_preserve_size') !== 0) continue;
|
// if (htmlFilename.indexOf('image_preserve_size') !== 0) continue;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const htmlToMdOptions: any = {};
|
const htmlToMdOptions: any = {};
|
||||||
|
|
||||||
if (htmlFilename === 'anchor_local.html') {
|
if (htmlFilename === 'anchor_local.html') {
|
||||||
|
@ -4,6 +4,7 @@ import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/
|
|||||||
import shim from '@joplin/lib/shim';
|
import shim from '@joplin/lib/shim';
|
||||||
const { themeStyle } = require('@joplin/lib/theme');
|
const { themeStyle } = require('@joplin/lib/theme');
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function newTestMdToHtml(options: any = null) {
|
function newTestMdToHtml(options: any = null) {
|
||||||
options = {
|
options = {
|
||||||
ResourceModel: {
|
ResourceModel: {
|
||||||
@ -37,6 +38,7 @@ describe('MdToHtml', () => {
|
|||||||
|
|
||||||
// if (mdFilename !== 'sanitize_9.md') continue;
|
// if (mdFilename !== 'sanitize_9.md') continue;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const mdToHtmlOptions: any = {
|
const mdToHtmlOptions: any = {
|
||||||
bodyOnly: true,
|
bodyOnly: true,
|
||||||
};
|
};
|
||||||
@ -86,6 +88,7 @@ describe('MdToHtml', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should return enabled plugin assets', (async () => {
|
it('should return enabled plugin assets', (async () => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const pluginOptions: any = {};
|
const pluginOptions: any = {};
|
||||||
const pluginNames = MdToHtml.pluginNames();
|
const pluginNames = MdToHtml.pluginNames();
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import shim from '@joplin/lib/shim';
|
|||||||
import Setting from '@joplin/lib/models/Setting';
|
import Setting from '@joplin/lib/models/Setting';
|
||||||
import { db, setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
|
import { db, setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function describeIfCompatible(name: string, fn: any, elseFn: any) {
|
function describeIfCompatible(name: string, fn: any, elseFn: any) {
|
||||||
if (['win32', 'darwin'].includes(shim.platformName())) {
|
if (['win32', 'darwin'].includes(shim.platformName())) {
|
||||||
return describe(name, fn);
|
return describe(name, fn);
|
||||||
|
@ -82,6 +82,7 @@ describe('services_PluginService', () => {
|
|||||||
|
|
||||||
const allFolders = await Folder.all();
|
const allFolders = await Folder.all();
|
||||||
expect(allFolders.length).toBe(2);
|
expect(allFolders.length).toBe(2);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
expect(allFolders.map((f: any) => f.title).sort().join(', ')).toBe('multi - simple1, multi - simple2');
|
expect(allFolders.map((f: any) => f.title).sort().join(', ')).toBe('multi - simple1, multi - simple2');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ describe('JoplinWorkspace', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should listen to noteChange events', async () => {
|
test('should listen to noteChange events', async () => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const appState: Record<string, any> = {
|
const appState: Record<string, any> = {
|
||||||
selectedNoteIds: [],
|
selectedNoteIds: [],
|
||||||
};
|
};
|
||||||
@ -49,6 +50,7 @@ describe('JoplinWorkspace', () => {
|
|||||||
|
|
||||||
const folder = (await Folder.all())[0];
|
const folder = (await Folder.all())[0];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const result: any = JSON.parse(folder.title);
|
const result: any = JSON.parse(folder.title);
|
||||||
|
|
||||||
expect(result.id).toBe(note.id);
|
expect(result.id).toBe(note.id);
|
||||||
|
@ -11,11 +11,13 @@ describe('services_plugins_sandboxProxy', () => {
|
|||||||
it('should create a new sandbox proxy', (async () => {
|
it('should create a new sandbox proxy', (async () => {
|
||||||
interface Result {
|
interface Result {
|
||||||
path: string;
|
path: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
args: any[];
|
args: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const results: Result[] = [];
|
const results: Result[] = [];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const target: any = (path: string, args: any[]) => {
|
const target: any = (path: string, args: any[]) => {
|
||||||
results.push({ path, args });
|
results.push({ path, args });
|
||||||
};
|
};
|
||||||
@ -34,11 +36,13 @@ describe('services_plugins_sandboxProxy', () => {
|
|||||||
it('should allow importing a namespace', (async () => {
|
it('should allow importing a namespace', (async () => {
|
||||||
interface Result {
|
interface Result {
|
||||||
path: string;
|
path: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
args: any[];
|
args: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const results: Result[] = [];
|
const results: Result[] = [];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const target: any = (path: string, args: any[]) => {
|
const target: any = (path: string, args: any[]) => {
|
||||||
results.push({ path, args });
|
results.push({ path, args });
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,7 @@ import PluginService from '@joplin/lib/services/plugins/PluginService';
|
|||||||
import PluginRunner from '../app/services/plugins/PluginRunner';
|
import PluginRunner from '../app/services/plugins/PluginRunner';
|
||||||
|
|
||||||
export interface PluginServiceOptions {
|
export interface PluginServiceOptions {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
getState?(): Record<string, any>;
|
getState?(): Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,24 +20,28 @@ interface RendererProcessQuitReply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface PluginWindows {
|
interface PluginWindows {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ElectronAppWrapper {
|
export default class ElectronAppWrapper {
|
||||||
|
|
||||||
private logger_: Logger = null;
|
private logger_: Logger = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private electronApp_: any;
|
private electronApp_: any;
|
||||||
private env_: string;
|
private env_: string;
|
||||||
private isDebugMode_: boolean;
|
private isDebugMode_: boolean;
|
||||||
private profilePath_: string;
|
private profilePath_: string;
|
||||||
private win_: BrowserWindow = null;
|
private win_: BrowserWindow = null;
|
||||||
private willQuitApp_ = false;
|
private willQuitApp_ = false;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private tray_: any = null;
|
private tray_: any = null;
|
||||||
private buildDir_: string = null;
|
private buildDir_: string = null;
|
||||||
private rendererProcessQuitReply_: RendererProcessQuitReply = null;
|
private rendererProcessQuitReply_: RendererProcessQuitReply = null;
|
||||||
private pluginWindows_: PluginWindows = {};
|
private pluginWindows_: PluginWindows = {};
|
||||||
private initialCallbackUrl_: string = null;
|
private initialCallbackUrl_: string = null;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public constructor(electronApp: any, env: string, profilePath: string|null, isDebugMode: boolean, initialCallbackUrl: string) {
|
public constructor(electronApp: any, env: string, profilePath: string|null, isDebugMode: boolean, initialCallbackUrl: string) {
|
||||||
this.electronApp_ = electronApp;
|
this.electronApp_ = electronApp;
|
||||||
this.env_ = env;
|
this.env_ = env;
|
||||||
@ -115,6 +119,7 @@ export default class ElectronAppWrapper {
|
|||||||
const windowStateKeeper = require('electron-window-state');
|
const windowStateKeeper = require('electron-window-state');
|
||||||
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const stateOptions: any = {
|
const stateOptions: any = {
|
||||||
defaultWidth: Math.round(0.8 * screen.getPrimaryDisplay().workArea.width),
|
defaultWidth: Math.round(0.8 * screen.getPrimaryDisplay().workArea.width),
|
||||||
defaultHeight: Math.round(0.8 * screen.getPrimaryDisplay().workArea.height),
|
defaultHeight: Math.round(0.8 * screen.getPrimaryDisplay().workArea.height),
|
||||||
@ -126,6 +131,7 @@ export default class ElectronAppWrapper {
|
|||||||
// Load the previous state with fallback to defaults
|
// Load the previous state with fallback to defaults
|
||||||
const windowState = windowStateKeeper(stateOptions);
|
const windowState = windowStateKeeper(stateOptions);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const windowOptions: any = {
|
const windowOptions: any = {
|
||||||
x: windowState.x,
|
x: windowState.x,
|
||||||
y: windowState.y,
|
y: windowState.y,
|
||||||
@ -192,6 +198,7 @@ export default class ElectronAppWrapper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.win_.webContents.on('did-fail-load', async event => {
|
this.win_.webContents.on('did-fail-load', async event => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
if ((event as any).isMainFrame) {
|
if ((event as any).isMainFrame) {
|
||||||
await this.handleAppFailure('Renderer process failed to load', false);
|
await this.handleAppFailure('Renderer process failed to load', false);
|
||||||
}
|
}
|
||||||
@ -228,6 +235,7 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.win_.on('close', (event: any) => {
|
this.win_.on('close', (event: any) => {
|
||||||
// If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true)
|
// If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true)
|
||||||
// otherwise the window is simply hidden, and will be re-open once the app is "activated" (which happens when the
|
// otherwise the window is simply hidden, and will be re-open once the app is "activated" (which happens when the
|
||||||
@ -276,6 +284,7 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
ipcMain.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
ipcMain.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
||||||
if (message === 'appCloseReply') {
|
if (message === 'appCloseReply') {
|
||||||
// We got the response from the renderer process:
|
// We got the response from the renderer process:
|
||||||
@ -287,6 +296,7 @@ export default class ElectronAppWrapper {
|
|||||||
|
|
||||||
// This handler receives IPC messages from a plugin or from the main window,
|
// This handler receives IPC messages from a plugin or from the main window,
|
||||||
// and forwards it to the main window or the plugin window.
|
// and forwards it to the main window or the plugin window.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
ipcMain.on('pluginMessage', (_event: any, message: PluginMessage) => {
|
ipcMain.on('pluginMessage', (_event: any, message: PluginMessage) => {
|
||||||
try {
|
try {
|
||||||
if (message.target === 'mainWindow') {
|
if (message.target === 'mainWindow') {
|
||||||
@ -325,6 +335,7 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public registerPluginWindow(pluginId: string, window: any) {
|
public registerPluginWindow(pluginId: string, window: any) {
|
||||||
this.pluginWindows_[pluginId] = window;
|
this.pluginWindows_[pluginId] = window;
|
||||||
}
|
}
|
||||||
@ -387,6 +398,7 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note: this must be called only after the "ready" event of the app has been dispatched
|
// Note: this must be called only after the "ready" event of the app has been dispatched
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public createTray(contextMenu: any) {
|
public createTray(contextMenu: any) {
|
||||||
try {
|
try {
|
||||||
this.tray_ = new Tray(`${this.buildDir()}/icons/${this.trayIconFilename_()}`);
|
this.tray_ = new Tray(`${this.buildDir()}/icons/${this.trayIconFilename_()}`);
|
||||||
@ -423,6 +435,7 @@ export default class ElectronAppWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Someone tried to open a second instance - focus our window instead
|
// Someone tried to open a second instance - focus our window instead
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.electronApp_.on('second-instance', (_e: any, argv: string[]) => {
|
this.electronApp_.on('second-instance', (_e: any, argv: string[]) => {
|
||||||
const win = this.window();
|
const win = this.window();
|
||||||
if (!win) return;
|
if (!win) return;
|
||||||
@ -463,6 +476,7 @@ export default class ElectronAppWrapper {
|
|||||||
this.win_.show();
|
this.win_.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.electronApp_.on('open-url', (event: any, url: string) => {
|
this.electronApp_.on('open-url', (event: any, url: string) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
void this.openCallbackUrl(url);
|
void this.openCallbackUrl(url);
|
||||||
|
@ -68,6 +68,7 @@ export default class InteropServiceHelper {
|
|||||||
|
|
||||||
win = bridge().newBrowserWindow(windowOptions);
|
win = bridge().newBrowserWindow(windowOptions);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
return new Promise<any>((resolve, reject) => {
|
return new Promise<any>((resolve, reject) => {
|
||||||
win.webContents.on('did-finish-load', () => {
|
win.webContents.on('did-finish-load', () => {
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ export default class InteropServiceHelper {
|
|||||||
// pdfs.
|
// pdfs.
|
||||||
// https://github.com/laurent22/joplin/issues/6254.
|
// https://github.com/laurent22/joplin/issues/6254.
|
||||||
await win.webContents.executeJavaScript('document.querySelectorAll(\'details\').forEach(el=>el.setAttribute(\'open\',\'\'))');
|
await win.webContents.executeJavaScript('document.querySelectorAll(\'details\').forEach(el=>el.setAttribute(\'open\',\'\'))');
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const data = await win.webContents.printToPDF(options as any);
|
const data = await win.webContents.printToPDF(options as any);
|
||||||
resolve(data);
|
resolve(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -126,6 +128,7 @@ export default class InteropServiceHelper {
|
|||||||
resolve(null);
|
resolve(null);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
win.webContents.print(options as any, (success: boolean, reason: string) => {
|
win.webContents.print(options as any, (success: boolean, reason: string) => {
|
||||||
cleanup();
|
cleanup();
|
||||||
if (!success && reason !== 'cancelled') reject(new Error(`Could not print: ${reason}`));
|
if (!success && reason !== 'cancelled') reject(new Error(`Could not print: ${reason}`));
|
||||||
|
@ -11,6 +11,7 @@ const logger = Logger.create('app.reducer');
|
|||||||
export interface AppStateRoute {
|
export interface AppStateRoute {
|
||||||
type: string;
|
type: string;
|
||||||
routeName: string;
|
routeName: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
props: any;
|
props: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,29 +22,36 @@ export enum AppStateDialogName {
|
|||||||
|
|
||||||
export interface AppStateDialog {
|
export interface AppStateDialog {
|
||||||
name: AppStateDialogName;
|
name: AppStateDialogName;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
props: Record<string, any>;
|
props: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppState extends State {
|
export interface AppState extends State {
|
||||||
route: AppStateRoute;
|
route: AppStateRoute;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
navHistory: any[];
|
navHistory: any[];
|
||||||
noteVisiblePanes: string[];
|
noteVisiblePanes: string[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
windowContentSize: any;
|
windowContentSize: any;
|
||||||
watchedNoteFiles: string[];
|
watchedNoteFiles: string[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
lastEditorScrollPercents: any;
|
lastEditorScrollPercents: any;
|
||||||
devToolsVisible: boolean;
|
devToolsVisible: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
visibleDialogs: any; // empty object if no dialog is visible. Otherwise contains the list of visible dialogs.
|
visibleDialogs: any; // empty object if no dialog is visible. Otherwise contains the list of visible dialogs.
|
||||||
focusedField: string;
|
focusedField: string;
|
||||||
layoutMoveMode: boolean;
|
layoutMoveMode: boolean;
|
||||||
startupPluginsLoaded: boolean;
|
startupPluginsLoaded: boolean;
|
||||||
|
|
||||||
// Extra reducer keys go here
|
// Extra reducer keys go here
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
watchedResources: any;
|
watchedResources: any;
|
||||||
mainLayout: LayoutItem;
|
mainLayout: LayoutItem;
|
||||||
dialogs: AppStateDialog[];
|
dialogs: AppStateDialog[];
|
||||||
isResettingLayout: boolean;
|
isResettingLayout: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export function createAppDefaultState(windowContentSize: any, resourceEditWatcherDefaultState: any): AppState {
|
export function createAppDefaultState(windowContentSize: any, resourceEditWatcherDefaultState: any): AppState {
|
||||||
return {
|
return {
|
||||||
...defaultState,
|
...defaultState,
|
||||||
@ -69,6 +77,7 @@ export function createAppDefaultState(windowContentSize: any, resourceEditWatche
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export default function(state: AppState, action: any) {
|
export default function(state: AppState, action: any) {
|
||||||
let newState = state;
|
let newState = state;
|
||||||
|
|
||||||
@ -129,6 +138,7 @@ export default function(state: AppState, action: any) {
|
|||||||
case 'NOTE_VISIBLE_PANES_TOGGLE':
|
case 'NOTE_VISIBLE_PANES_TOGGLE':
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const getNextLayout = (currentLayout: any) => {
|
const getNextLayout = (currentLayout: any) => {
|
||||||
currentLayout = panes.length === 2 ? 'both' : currentLayout[0];
|
currentLayout = panes.length === 2 ? 'both' : currentLayout[0];
|
||||||
|
|
||||||
@ -183,6 +193,7 @@ export default function(state: AppState, action: any) {
|
|||||||
logger.warn('MAIN_LAYOUT_SET_ITEM_PROP: Found an empty item in layout: ', JSON.stringify(state.mainLayout));
|
logger.warn('MAIN_LAYOUT_SET_ITEM_PROP: Found an empty item in layout: ', JSON.stringify(state.mainLayout));
|
||||||
} else {
|
} else {
|
||||||
if (item.key === action.itemKey) {
|
if (item.key === action.itemKey) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(item as any)[action.propName] = action.propValue;
|
(item as any)[action.propName] = action.propValue;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ const appDefaultState = createAppDefaultState(
|
|||||||
|
|
||||||
class Application extends BaseApplication {
|
class Application extends BaseApplication {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private checkAllPluginStartedIID_: any = null;
|
private checkAllPluginStartedIID_: any = null;
|
||||||
private initPluginServiceDone_ = false;
|
private initPluginServiceDone_ = false;
|
||||||
private ocrService_: OcrService;
|
private ocrService_: OcrService;
|
||||||
@ -98,6 +99,7 @@ class Application extends BaseApplication {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public reducer(state: AppState = appDefaultState, action: any) {
|
public reducer(state: AppState = appDefaultState, action: any) {
|
||||||
let newState = appReducer(state, action);
|
let newState = appReducer(state, action);
|
||||||
newState = resourceEditWatcherReducer(newState, action);
|
newState = resourceEditWatcherReducer(newState, action);
|
||||||
@ -113,6 +115,7 @@ class Application extends BaseApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
protected async generalMiddleware(store: any, next: any, action: any) {
|
protected async generalMiddleware(store: any, next: any, action: any) {
|
||||||
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'locale' || action.type === 'SETTING_UPDATE_ALL') {
|
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'locale' || action.type === 'SETTING_UPDATE_ALL') {
|
||||||
setLocale(Setting.value('locale'));
|
setLocale(Setting.value('locale'));
|
||||||
@ -233,13 +236,16 @@ class Application extends BaseApplication {
|
|||||||
// The context menu must be setup in renderer process because that's where
|
// The context menu must be setup in renderer process because that's where
|
||||||
// the spell checker service lives.
|
// the spell checker service lives.
|
||||||
electronContextMenu({
|
electronContextMenu({
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
shouldShowMenu: (_event: any, params: any) => {
|
shouldShowMenu: (_event: any, params: any) => {
|
||||||
// params.inputFieldType === 'none' when right-clicking the text editor. This is a bit of a hack to detect it because in this
|
// params.inputFieldType === 'none' when right-clicking the text editor. This is a bit of a hack to detect it because in this
|
||||||
// case we don't want to use the built-in context menu but a custom one.
|
// case we don't want to use the built-in context menu but a custom one.
|
||||||
return params.isEditable && params.inputFieldType !== 'none';
|
return params.isEditable && params.inputFieldType !== 'none';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
menu: (actions: any, props: any) => {
|
menu: (actions: any, props: any) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const spellCheckerMenuItems = SpellCheckerService.instance().contextMenuItems(props.misspelledWord, props.dictionarySuggestions).map((item: any) => new MenuItem(item));
|
const spellCheckerMenuItems = SpellCheckerService.instance().contextMenuItems(props.misspelledWord, props.dictionarySuggestions).map((item: any) => new MenuItem(item));
|
||||||
|
|
||||||
const output = [
|
const output = [
|
||||||
@ -350,6 +356,7 @@ class Application extends BaseApplication {
|
|||||||
private setupOcrService() {
|
private setupOcrService() {
|
||||||
if (Setting.value('ocr.enabled')) {
|
if (Setting.value('ocr.enabled')) {
|
||||||
if (!this.ocrService_) {
|
if (!this.ocrService_) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const Tesseract = (window as any).Tesseract;
|
const Tesseract = (window as any).Tesseract;
|
||||||
|
|
||||||
const driver = new OcrDriverTesseract(
|
const driver = new OcrDriverTesseract(
|
||||||
@ -375,6 +382,7 @@ class Application extends BaseApplication {
|
|||||||
eventManager.on(EventName.ResourceChange, handleResourceChange);
|
eventManager.on(EventName.ResourceChange, handleResourceChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async start(argv: string[], startOptions: StartOptions = null): Promise<any> {
|
public async start(argv: string[], startOptions: StartOptions = null): Promise<any> {
|
||||||
// If running inside a package, the command line, instead of being "node.exe <path> <flags>" is "joplin.exe <flags>" so
|
// If running inside a package, the command line, instead of being "node.exe <path> <flags>" is "joplin.exe <flags>" so
|
||||||
// insert an extra argument so that they can be processed in a consistent way everywhere.
|
// insert an extra argument so that they can be processed in a consistent way everywhere.
|
||||||
@ -456,6 +464,7 @@ class Application extends BaseApplication {
|
|||||||
// manually call dispatchUpdateAll() to force an update.
|
// manually call dispatchUpdateAll() to force an update.
|
||||||
Setting.dispatchUpdateAll();
|
Setting.dispatchUpdateAll();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
await refreshFolders((action: any) => this.dispatch(action));
|
await refreshFolders((action: any) => this.dispatch(action));
|
||||||
|
|
||||||
const tags = await Tag.allWithNotes();
|
const tags = await Tag.allWithNotes();
|
||||||
@ -584,12 +593,14 @@ class Application extends BaseApplication {
|
|||||||
|
|
||||||
ResourceEditWatcher.instance().initialize(
|
ResourceEditWatcher.instance().initialize(
|
||||||
reg.logger(),
|
reg.logger(),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(action: any) => { this.store().dispatch(action); },
|
(action: any) => { this.store().dispatch(action); },
|
||||||
(path: string) => bridge().openItem(path),
|
(path: string) => bridge().openItem(path),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Forwards the local event to the global event manager, so that it can
|
// Forwards the local event to the global event manager, so that it can
|
||||||
// be picked up by the plugin manager.
|
// be picked up by the plugin manager.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
ResourceEditWatcher.instance().on('resourceChange', (event: any) => {
|
ResourceEditWatcher.instance().on('resourceChange', (event: any) => {
|
||||||
eventManager.emit(EventName.ResourceChange, event);
|
eventManager.emit(EventName.ResourceChange, event);
|
||||||
});
|
});
|
||||||
@ -598,6 +609,7 @@ class Application extends BaseApplication {
|
|||||||
|
|
||||||
// Make it available to the console window - useful to call revisionService.collectRevisions()
|
// Make it available to the console window - useful to call revisionService.collectRevisions()
|
||||||
if (Setting.value('env') === 'dev') {
|
if (Setting.value('env') === 'dev') {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(window as any).joplin = {
|
(window as any).joplin = {
|
||||||
revisionService: RevisionService.instance(),
|
revisionService: RevisionService.instance(),
|
||||||
migrationService: MigrationService.instance(),
|
migrationService: MigrationService.instance(),
|
||||||
|
@ -21,6 +21,7 @@ interface OpenDialogOptions {
|
|||||||
properties?: string[];
|
properties?: string[];
|
||||||
defaultPath?: string;
|
defaultPath?: string;
|
||||||
createDirectory?: boolean;
|
createDirectory?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
filters?: any[];
|
filters?: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +127,7 @@ export class Bridge {
|
|||||||
this.onAllowedExtensionsChangeListener_ = listener;
|
this.onAllowedExtensionsChangeListener_ = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async captureException(error: any) {
|
public async captureException(error: any) {
|
||||||
Sentry.captureException(error);
|
Sentry.captureException(error);
|
||||||
// We wait to give the "beforeSend" event handler time to process the crash dump and write
|
// We wait to give the "beforeSend" event handler time to process the crash dump and write
|
||||||
@ -191,6 +193,7 @@ export class Bridge {
|
|||||||
|
|
||||||
electronApp: this.electronApp(),
|
electronApp: this.electronApp(),
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
shouldShowMenu: (_event: any, params: any) => {
|
shouldShowMenu: (_event: any, params: any) => {
|
||||||
return params.isEditable;
|
return params.isEditable;
|
||||||
},
|
},
|
||||||
@ -219,6 +222,7 @@ export class Bridge {
|
|||||||
return require('electron').shell.showItemInFolder(toSystemSlashes(fullPath));
|
return require('electron').shell.showItemInFolder(toSystemSlashes(fullPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public newBrowserWindow(options: any) {
|
public newBrowserWindow(options: any) {
|
||||||
return new BrowserWindow(options);
|
return new BrowserWindow(options);
|
||||||
}
|
}
|
||||||
@ -248,6 +252,7 @@ export class Bridge {
|
|||||||
return this.window().webContents.closeDevTools();
|
return this.window().webContents.closeDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async showSaveDialog(options: any) {
|
public async showSaveDialog(options: any) {
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
if (!('defaultPath' in options) && this.lastSelectedPaths_.file) options.defaultPath = this.lastSelectedPaths_.file;
|
if (!('defaultPath' in options) && this.lastSelectedPaths_.file) options.defaultPath = this.lastSelectedPaths_.file;
|
||||||
@ -262,16 +267,20 @@ export class Bridge {
|
|||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
let fileType = 'file';
|
let fileType = 'file';
|
||||||
if (options.properties && options.properties.includes('openDirectory')) fileType = 'directory';
|
if (options.properties && options.properties.includes('openDirectory')) fileType = 'directory';
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
if (!('defaultPath' in options) && (this.lastSelectedPaths_ as any)[fileType]) options.defaultPath = (this.lastSelectedPaths_ as any)[fileType];
|
if (!('defaultPath' in options) && (this.lastSelectedPaths_ as any)[fileType]) options.defaultPath = (this.lastSelectedPaths_ as any)[fileType];
|
||||||
if (!('createDirectory' in options)) options.createDirectory = true;
|
if (!('createDirectory' in options)) options.createDirectory = true;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const { filePaths } = await dialog.showOpenDialog(this.window(), options as any);
|
const { filePaths } = await dialog.showOpenDialog(this.window(), options as any);
|
||||||
if (filePaths && filePaths.length) {
|
if (filePaths && filePaths.length) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(this.lastSelectedPaths_ as any)[fileType] = dirname(filePaths[0]);
|
(this.lastSelectedPaths_ as any)[fileType] = dirname(filePaths[0]);
|
||||||
}
|
}
|
||||||
return filePaths;
|
return filePaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't use this directly - call one of the showXxxxxxxMessageBox() instead
|
// Don't use this directly - call one of the showXxxxxxxMessageBox() instead
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private showMessageBox_(window: any, options: MessageDialogOptions): number {
|
private showMessageBox_(window: any, options: MessageDialogOptions): number {
|
||||||
if (!window) window = this.window();
|
if (!window) window = this.window();
|
||||||
return dialog.showMessageBoxSync(window, { message: '', ...options });
|
return dialog.showMessageBoxSync(window, { message: '', ...options });
|
||||||
@ -313,6 +322,7 @@ export class Bridge {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public showInfoMessageBox(message: string, options: any = {}) {
|
public showInfoMessageBox(message: string, options: any = {}) {
|
||||||
const result = this.showMessageBox_(this.window(), { type: 'info',
|
const result = this.showMessageBox_(this.window(), { type: 'info',
|
||||||
message: message,
|
message: message,
|
||||||
|
@ -64,6 +64,7 @@ async function addSkippedVersion(s: string) {
|
|||||||
await KvStore.instance().setValue('updateCheck::skippedVersions', JSON.stringify(versions));
|
await KvStore.instance().setValue('updateCheck::skippedVersions', JSON.stringify(versions));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export default async function checkForUpdates(inBackground: boolean, parentWindow: any, options: CheckForUpdateOptions) {
|
export default async function checkForUpdates(inBackground: boolean, parentWindow: any, options: CheckForUpdateOptions) {
|
||||||
if (isCheckingForUpdate_) {
|
if (isCheckingForUpdate_) {
|
||||||
logger.info('Skipping check because it is already running');
|
logger.info('Skipping check because it is already running');
|
||||||
|
@ -11,6 +11,7 @@ export const runtime = (): CommandRuntime => {
|
|||||||
return {
|
return {
|
||||||
// "targetPath" should be a file for JEX export (because the format can
|
// "targetPath" should be a file for JEX export (because the format can
|
||||||
// contain multiple folders) or a directory otherwise.
|
// contain multiple folders) or a directory otherwise.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
execute: async (_context: any, folderIds: string[], format: ExportModuleOutputFormat, targetPath: string) => {
|
execute: async (_context: any, folderIds: string[], format: ExportModuleOutputFormat, targetPath: string) => {
|
||||||
const exportOptions: ExportOptions = {
|
const exportOptions: ExportOptions = {
|
||||||
sourceFolderIds: folderIds,
|
sourceFolderIds: folderIds,
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
execute: async (_context: any, noteIds: string[], format: ExportModuleOutputFormat, targetDirectoryPath: string) => {
|
execute: async (_context: any, noteIds: string[], format: ExportModuleOutputFormat, targetDirectoryPath: string) => {
|
||||||
const exportOptions: ExportOptions = {
|
const exportOptions: ExportOptions = {
|
||||||
path: targetDirectoryPath,
|
path: targetDirectoryPath,
|
||||||
|
@ -6,6 +6,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
execute: async (_context: any, target: string) => {
|
execute: async (_context: any, target: string) => {
|
||||||
if (target === 'noteBody') return CommandService.instance().execute('focusElementNoteBody');
|
if (target === 'noteBody') return CommandService.instance().execute('focusElementNoteBody');
|
||||||
if (target === 'noteList') return CommandService.instance().execute('focusElementNoteList');
|
if (target === 'noteList') return CommandService.instance().execute('focusElementNoteList');
|
||||||
|
@ -23,6 +23,7 @@ export const runtime = (): CommandRuntime => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
enabledCondition: 'oneNoteSelected && !noteIsReadOnly && (!modalDialogVisible || gotoAnythingVisible)',
|
enabledCondition: 'oneNoteSelected && !noteIsReadOnly && (!modalDialogVisible || gotoAnythingVisible)',
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
mapStateToTitle: (state: any) => {
|
mapStateToTitle: (state: any) => {
|
||||||
const noteId = stateUtils.selectedNoteId(state);
|
const noteId = stateUtils.selectedNoteId(state);
|
||||||
return state.watchedNoteFiles.includes(noteId) ? _('Stop') : '';
|
return state.watchedNoteFiles.includes(noteId) ? _('Stop') : '';
|
||||||
|
@ -2,6 +2,9 @@ import * as React from 'react';
|
|||||||
const styled = require('styled-components').default;
|
const styled = require('styled-components').default;
|
||||||
const { space } = require('styled-system');
|
const { space } = require('styled-system');
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
|
type StyleProps = any;
|
||||||
|
|
||||||
export enum ButtonLevel {
|
export enum ButtonLevel {
|
||||||
Primary = 'primary',
|
Primary = 'primary',
|
||||||
Secondary = 'secondary',
|
Secondary = 'secondary',
|
||||||
@ -26,6 +29,7 @@ interface Props {
|
|||||||
iconAnimation?: string;
|
iconAnimation?: string;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
style?: any;
|
style?: any;
|
||||||
size?: ButtonSize;
|
size?: ButtonSize;
|
||||||
isSquare?: boolean;
|
isSquare?: boolean;
|
||||||
@ -71,131 +75,131 @@ const StyledButtonBase = styled.button`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledIcon = styled(styled.span(space))`
|
const StyledIcon = styled(styled.span(space))`
|
||||||
font-size: ${(props: any) => props.theme.toolbarIconSize}px;
|
font-size: ${(props: StyleProps) => props.theme.toolbarIconSize}px;
|
||||||
${(props: any) => props.animation ? `animation: ${props.animation}` : ''};
|
${(props: StyleProps) => props.animation ? `animation: ${props.animation}` : ''};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonPrimary = styled(StyledButtonBase)`
|
const StyledButtonPrimary = styled(StyledButtonBase)`
|
||||||
border: none;
|
border: none;
|
||||||
background-color: ${(props: any) => props.theme.backgroundColor5};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColor5};
|
||||||
|
|
||||||
${(props: any) => props.disabled} {
|
${(props: StyleProps) => props.disabled} {
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorHover5};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover5};
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorActive5};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive5};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.color5};
|
color: ${(props: StyleProps) => props.theme.color5};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.color5};
|
color: ${(props: StyleProps) => props.theme.color5};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonSecondary = styled(StyledButtonBase)`
|
const StyledButtonSecondary = styled(StyledButtonBase)`
|
||||||
border: 1px solid ${(props: any) => props.theme.borderColor4};
|
border: 1px solid ${(props: StyleProps) => props.theme.borderColor4};
|
||||||
background-color: ${(props: any) => props.theme.backgroundColor4};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColor4};
|
||||||
|
|
||||||
${(props: any) => props.disabled} {
|
${(props: StyleProps) => props.disabled} {
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorHover4};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover4};
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorActive4};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive4};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.color4};
|
color: ${(props: StyleProps) => props.theme.color4};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.color4};
|
color: ${(props: StyleProps) => props.theme.color4};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonTertiary = styled(StyledButtonBase)`
|
const StyledButtonTertiary = styled(StyledButtonBase)`
|
||||||
border: 1px solid ${(props: any) => props.theme.color3};
|
border: 1px solid ${(props: StyleProps) => props.theme.color3};
|
||||||
background-color: ${(props: any) => props.theme.backgroundColor3};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColor3};
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorHoverDim3};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorHoverDim3};
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorActive3};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorActive3};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.color};
|
color: ${(props: StyleProps) => props.theme.color};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.color};
|
color: ${(props: StyleProps) => props.theme.color};
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonRecommended = styled(StyledButtonBase)`
|
const StyledButtonRecommended = styled(StyledButtonBase)`
|
||||||
border: 1px solid ${(props: any) => props.theme.borderColor4};
|
border: 1px solid ${(props: StyleProps) => props.theme.borderColor4};
|
||||||
background-color: ${(props: any) => props.theme.warningBackgroundColor};
|
background-color: ${(props: StyleProps) => props.theme.warningBackgroundColor};
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.color};
|
color: ${(props: StyleProps) => props.theme.color};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.color};
|
color: ${(props: StyleProps) => props.theme.color};
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonSidebarSecondary = styled(StyledButtonBase)`
|
const StyledButtonSidebarSecondary = styled(StyledButtonBase)`
|
||||||
background: none;
|
background: none;
|
||||||
border-color: ${(props: any) => props.theme.color2};
|
border-color: ${(props: StyleProps) => props.theme.color2};
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: ${(props: any) => props.theme.colorHover2};
|
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||||
border-color: ${(props: any) => props.theme.colorHover2};
|
border-color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||||
background: none;
|
background: none;
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.colorHover2};
|
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.colorHover2};
|
color: ${(props: StyleProps) => props.theme.colorHover2};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
color: ${(props: any) => props.theme.colorActive2};
|
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||||
border-color: ${(props: any) => props.theme.colorActive2};
|
border-color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||||
background: none;
|
background: none;
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.colorActive2};
|
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.colorActive2};
|
color: ${(props: StyleProps) => props.theme.colorActive2};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledTitle} {
|
${StyledTitle} {
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
}
|
}
|
||||||
|
|
||||||
${StyledIcon} {
|
${StyledIcon} {
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -207,6 +211,7 @@ function buttonClass(level: ButtonLevel) {
|
|||||||
return StyledButtonSecondary;
|
return StyledButtonSecondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
const Button = React.forwardRef((props: Props, ref: any) => {
|
const Button = React.forwardRef((props: Props, ref: any) => {
|
||||||
const iconOnly = props.iconName && !props.title;
|
const iconOnly = props.iconName && !props.title;
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@ import Button, { ButtonLevel } from '../Button/Button';
|
|||||||
import { _ } from '@joplin/lib/locale';
|
import { _ } from '@joplin/lib/locale';
|
||||||
const styled = require('styled-components').default;
|
const styled = require('styled-components').default;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
|
type StyleProps = any;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
backButtonTitle?: string;
|
backButtonTitle?: string;
|
||||||
hasChanges?: boolean;
|
hasChanges?: boolean;
|
||||||
@ -18,11 +21,11 @@ export const StyledRoot = styled.div`
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: ${(props: any) => props.theme.backgroundColor3};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColor3};
|
||||||
padding-left: ${(props: any) => props.theme.configScreenPadding}px;
|
padding-left: ${(props: StyleProps) => props.theme.configScreenPadding}px;
|
||||||
border-top-width: 1px;
|
border-top-width: 1px;
|
||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
border-top-color: ${(props: any) => props.theme.dividerColor};
|
border-top-color: ${(props: StyleProps) => props.theme.dividerColor};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function ButtonBar(props: Props) {
|
export default function ButtonBar(props: Props) {
|
||||||
|
@ -21,14 +21,18 @@ import shouldShowMissingPasswordWarning from '@joplin/lib/components/shared/conf
|
|||||||
import MacOSMissingPasswordHelpLink from './controls/MissingPasswordHelpLink';
|
import MacOSMissingPasswordHelpLink from './controls/MissingPasswordHelpLink';
|
||||||
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
|
const { KeymapConfigScreen } = require('../KeymapConfig/KeymapConfigScreen');
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const settingKeyToControl: any = {
|
const settingKeyToControl: any = {
|
||||||
'plugins.states': control_PluginsStates,
|
'plugins.states': control_PluginsStates,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
class ConfigScreenComponent extends React.Component<any, any> {
|
class ConfigScreenComponent extends React.Component<any, any> {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private rowStyle_: any = null;
|
private rowStyle_: any = null;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public constructor(props: any) {
|
public constructor(props: any) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@ -138,10 +142,12 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
this.setState({ selectedSectionName: section.name, screenName: screenName });
|
this.setState({ selectedSectionName: section.name, screenName: screenName });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private sidebar_selectionChange(event: any) {
|
private sidebar_selectionChange(event: any) {
|
||||||
void this.switchSection(event.section.name);
|
void this.switchSection(event.section.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public renderSectionDescription(section: any) {
|
public renderSectionDescription(section: any) {
|
||||||
const description = Setting.sectionDescription(section.name);
|
const description = Setting.sectionDescription(section.name);
|
||||||
if (!description) return null;
|
if (!description) return null;
|
||||||
@ -154,6 +160,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public sectionToComponent(key: string, section: any, settings: any, selected: boolean) {
|
public sectionToComponent(key: string, section: any, settings: any, selected: boolean) {
|
||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
|
|
||||||
@ -172,10 +179,12 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
const settingComps = createSettingComponents(false);
|
const settingComps = createSettingComponents(false);
|
||||||
const advancedSettingComps = createSettingComponents(true);
|
const advancedSettingComps = createSettingComponents(true);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const sectionWidths: Record<string, any> = {
|
const sectionWidths: Record<string, any> = {
|
||||||
plugins: '100%',
|
plugins: '100%',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const sectionStyle: any = {
|
const sectionStyle: any = {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
@ -281,6 +290,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private renderHeader(themeId: number, label: string, style: any = null) {
|
private renderHeader(themeId: number, label: string, style: any = null) {
|
||||||
const theme = themeStyle(themeId);
|
const theme = themeStyle(themeId);
|
||||||
|
|
||||||
@ -302,9 +312,11 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
return description ? <div style={this.descriptionStyle(themeId)}>{description}</div> : null;
|
return description ? <div style={this.descriptionStyle(themeId)}>{description}</div> : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public settingToComponent(key: string, value: any) {
|
public settingToComponent(key: string, value: any) {
|
||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const output: any = null;
|
const output: any = null;
|
||||||
|
|
||||||
const rowStyle = {
|
const rowStyle = {
|
||||||
@ -339,6 +351,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
paddingTop: 4,
|
paddingTop: 4,
|
||||||
paddingBottom: 4 };
|
paddingBottom: 4 };
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const updateSettingValue = (key: string, value: any) => {
|
const updateSettingValue = (key: string, value: any) => {
|
||||||
const md = Setting.settingMetadata(key);
|
const md = Setting.settingMetadata(key);
|
||||||
if (md.needRestart) {
|
if (md.needRestart) {
|
||||||
@ -363,6 +376,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
metadata={md}
|
metadata={md}
|
||||||
value={value}
|
value={value}
|
||||||
themeId={this.props.themeId}
|
themeId={this.props.themeId}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
updateSettingValue(key, event.value);
|
updateSettingValue(key, event.value);
|
||||||
}}
|
}}
|
||||||
@ -404,6 +418,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
<select
|
<select
|
||||||
value={value}
|
value={value}
|
||||||
style={selectStyle}
|
style={selectStyle}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
updateSettingValue(key, event.target.value);
|
updateSettingValue(key, event.target.value);
|
||||||
}}
|
}}
|
||||||
@ -449,6 +464,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (md.type === Setting.TYPE_STRING) {
|
} else if (md.type === Setting.TYPE_STRING) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const inputStyle: any = { ...textInputBaseStyle, width: '50%',
|
const inputStyle: any = { ...textInputBaseStyle, width: '50%',
|
||||||
minWidth: '20em' };
|
minWidth: '20em' };
|
||||||
const inputType = md.secure === true ? 'password' : 'text';
|
const inputType = md.secure === true ? 'password' : 'text';
|
||||||
@ -476,6 +492,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
return cmdString;
|
return cmdString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onPathChange = (event: any) => {
|
const onPathChange = (event: any) => {
|
||||||
if (md.subType === 'file_path_and_args') {
|
if (md.subType === 'file_path_and_args') {
|
||||||
const cmd = splitCmd(this.state.settings[key]);
|
const cmd = splitCmd(this.state.settings[key]);
|
||||||
@ -486,6 +503,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onArgsChange = (event: any) => {
|
const onArgsChange = (event: any) => {
|
||||||
const cmd = splitCmd(this.state.settings[key]);
|
const cmd = splitCmd(this.state.settings[key]);
|
||||||
cmd[1] = event.target.value;
|
cmd[1] = event.target.value;
|
||||||
@ -522,6 +540,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
<input
|
<input
|
||||||
type={inputType}
|
type={inputType}
|
||||||
style={inputStyle}
|
style={inputStyle}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
onArgsChange(event);
|
onArgsChange(event);
|
||||||
}}
|
}}
|
||||||
@ -547,6 +566,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
<input
|
<input
|
||||||
type={inputType}
|
type={inputType}
|
||||||
style={{ ...inputStyle, marginBottom: 0, marginRight: 5 }}
|
style={{ ...inputStyle, marginBottom: 0, marginRight: 5 }}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
onPathChange(event);
|
onPathChange(event);
|
||||||
}}
|
}}
|
||||||
@ -567,6 +587,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onTextChange = (event: any) => {
|
const onTextChange = (event: any) => {
|
||||||
updateSettingValue(key, event.target.value);
|
updateSettingValue(key, event.target.value);
|
||||||
};
|
};
|
||||||
@ -580,6 +601,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
type={inputType}
|
type={inputType}
|
||||||
style={inputStyle}
|
style={inputStyle}
|
||||||
value={this.state.settings[key]}
|
value={this.state.settings[key]}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
onTextChange(event);
|
onTextChange(event);
|
||||||
}}
|
}}
|
||||||
@ -592,6 +614,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (md.type === Setting.TYPE_INT) {
|
} else if (md.type === Setting.TYPE_INT) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onNumChange = (event: any) => {
|
const onNumChange = (event: any) => {
|
||||||
updateSettingValue(key, event.target.value);
|
updateSettingValue(key, event.target.value);
|
||||||
};
|
};
|
||||||
@ -599,6 +622,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
const label = [md.label()];
|
const label = [md.label()];
|
||||||
if (md.unitLabel) label.push(`(${md.unitLabel()})`);
|
if (md.unitLabel) label.push(`(${md.unitLabel()})`);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const inputStyle: any = { ...textInputBaseStyle };
|
const inputStyle: any = { ...textInputBaseStyle };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -610,6 +634,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
type="number"
|
type="number"
|
||||||
style={inputStyle}
|
style={inputStyle}
|
||||||
value={this.state.settings[key]}
|
value={this.state.settings[key]}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
onNumChange(event);
|
onNumChange(event);
|
||||||
}}
|
}}
|
||||||
@ -717,6 +742,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
|
|
||||||
const sections = shared.settingsSections({ device: AppType.Desktop, settings });
|
const sections = shared.settingsSections({ device: AppType.Desktop, settings });
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const needRestartComp: any = this.state.needRestart ? (
|
const needRestartComp: any = this.state.needRestart ? (
|
||||||
<div style={{ ...theme.textStyle, padding: 10, paddingLeft: 24, backgroundColor: theme.warningBackgroundColor, color: theme.color }}>
|
<div style={{ ...theme.textStyle, padding: 10, paddingLeft: 24, backgroundColor: theme.warningBackgroundColor, color: theme.color }}>
|
||||||
{this.restartMessage()}
|
{this.restartMessage()}
|
||||||
@ -751,6 +777,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const mapStateToProps = (state: any) => {
|
const mapStateToProps = (state: any) => {
|
||||||
return {
|
return {
|
||||||
themeId: state.settings.theme,
|
themeId: state.settings.theme,
|
||||||
|
@ -4,16 +4,20 @@ import Setting from '@joplin/lib/models/Setting';
|
|||||||
import { _ } from '@joplin/lib/locale';
|
import { _ } from '@joplin/lib/locale';
|
||||||
const styled = require('styled-components').default;
|
const styled = require('styled-components').default;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
|
type StyleProps = any;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
selection: string;
|
selection: string;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onSelectionChange: Function;
|
onSelectionChange: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
sections: any[];
|
sections: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const StyledRoot = styled.div`
|
export const StyledRoot = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: ${(props: any) => props.theme.backgroundColor2};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColor2};
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@ -23,16 +27,16 @@ export const StyledListItem = styled.a`
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding: ${(props: any) => props.theme.mainPadding}px;
|
padding: ${(props: StyleProps) => props.theme.mainPadding}px;
|
||||||
background: ${(props: any) => props.selected ? props.theme.selectedColor2 : 'none'};
|
background: ${(props: StyleProps) => props.selected ? props.theme.selectedColor2 : 'none'};
|
||||||
transition: 0.1s;
|
transition: 0.1s;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
opacity: ${(props: any) => props.selected ? 1 : 0.8};
|
opacity: ${(props: StyleProps) => props.selected ? 1 : 0.8};
|
||||||
padding-left: ${(props: any) => props.isSubSection ? '35' : props.theme.mainPadding}px;
|
padding-left: ${(props: StyleProps) => props.isSubSection ? '35' : props.theme.mainPadding}px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${(props: any) => props.theme.backgroundColorHover2};
|
background-color: ${(props: StyleProps) => props.theme.backgroundColorHover2};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -40,21 +44,21 @@ export const StyledDivider = styled.div`
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
padding: ${(props: any) => props.theme.mainPadding}px;
|
padding: ${(props: StyleProps) => props.theme.mainPadding}px;
|
||||||
padding-top: ${(props: any) => props.theme.mainPadding * .8}px;
|
padding-top: ${(props: StyleProps) => props.theme.mainPadding * .8}px;
|
||||||
padding-bottom: ${(props: any) => props.theme.mainPadding * .8}px;
|
padding-bottom: ${(props: StyleProps) => props.theme.mainPadding * .8}px;
|
||||||
border-top: 1px solid ${(props: any) => props.theme.dividerColor};
|
border-top: 1px solid ${(props: StyleProps) => props.theme.dividerColor};
|
||||||
border-bottom: 1px solid ${(props: any) => props.theme.dividerColor};
|
border-bottom: 1px solid ${(props: StyleProps) => props.theme.dividerColor};
|
||||||
background-color: ${(props: any) => props.theme.selectedColor2};
|
background-color: ${(props: StyleProps) => props.theme.selectedColor2};
|
||||||
font-size: ${(props: any) => Math.round(props.theme.fontSize)}px;
|
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize)}px;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledListItemLabel = styled.span`
|
export const StyledListItemLabel = styled.span`
|
||||||
font-size: ${(props: any) => Math.round(props.theme.fontSize * 1.2)}px;
|
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize * 1.2)}px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -63,14 +67,16 @@ export const StyledListItemLabel = styled.span`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledListItemIcon = styled.i`
|
export const StyledListItemIcon = styled.i`
|
||||||
font-size: ${(props: any) => Math.round(props.theme.fontSize * 1.4)}px;
|
font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize * 1.4)}px;
|
||||||
color: ${(props: any) => props.theme.color2};
|
color: ${(props: StyleProps) => props.theme.color2};
|
||||||
margin-right: ${(props: any) => props.theme.mainPadding / 1.5}px;
|
margin-right: ${(props: StyleProps) => props.theme.mainPadding / 1.5}px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function Sidebar(props: Props) {
|
export default function Sidebar(props: Props) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
const buttons: any[] = [];
|
const buttons: any[] = [];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied;
|
||||||
function renderButton(section: any) {
|
function renderButton(section: any) {
|
||||||
const selected = props.selection === section.name;
|
const selected = props.selection === section.name;
|
||||||
return (
|
return (
|
||||||
|
@ -5,6 +5,7 @@ import bridge from '../../../services/bridge';
|
|||||||
import StyledLink from '../../style/StyledLink';
|
import StyledLink from '../../style/StyledLink';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
theme: any;
|
theme: any;
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,7 @@ const BoxedLabel = styled.div`
|
|||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const StyledNameAndVersion = styled.div<{ mb: any }>`
|
const StyledNameAndVersion = styled.div<{ mb: any }>`
|
||||||
font-family: ${props => props.theme.fontFamily};
|
font-family: ${props => props.theme.fontFamily};
|
||||||
color: ${props => props.theme.color};
|
color: ${props => props.theme.color};
|
||||||
|
@ -28,6 +28,7 @@ const Root = styled.div`
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const UserPluginsRoot = styled.div<any>`
|
const UserPluginsRoot = styled.div<any>`
|
||||||
${space}
|
${space}
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -38,12 +39,14 @@ const ToolsButton = styled(Button)`
|
|||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const RepoApiErrorMessage = styled(StyledMessage)<any>`
|
const RepoApiErrorMessage = styled(StyledMessage)<any>`
|
||||||
max-width: ${props => props.maxWidth}px;
|
max-width: ${props => props.maxWidth}px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
value: any;
|
value: any;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
@ -233,6 +236,7 @@ export default function(props: Props) {
|
|||||||
setSearchQuery(event.value);
|
setSearchQuery(event.value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onSearchPluginSettingsChange = useCallback((event: any) => {
|
const onSearchPluginSettingsChange = useCallback((event: any) => {
|
||||||
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
|
props.onChange({ value: pluginService.serializePluginSettings(event.value) });
|
||||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||||
|
@ -24,6 +24,7 @@ interface Props {
|
|||||||
searchQuery: string;
|
searchQuery: string;
|
||||||
onSearchQueryChange(event: OnChangeEvent): void;
|
onSearchQueryChange(event: OnChangeEvent): void;
|
||||||
pluginSettings: PluginSettings;
|
pluginSettings: PluginSettings;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onPluginSettingsChange(event: any): void;
|
onPluginSettingsChange(event: any): void;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderDescription: Function;
|
renderDescription: Function;
|
||||||
|
@ -23,6 +23,7 @@ interface Props {
|
|||||||
cancelButtonDisabled?: boolean;
|
cancelButtonDisabled?: boolean;
|
||||||
okButtonShow?: boolean;
|
okButtonShow?: boolean;
|
||||||
okButtonLabel?: string;
|
okButtonLabel?: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
okButtonRef?: any;
|
okButtonRef?: any;
|
||||||
okButtonDisabled?: boolean;
|
okButtonDisabled?: boolean;
|
||||||
customButtons?: ButtonSpec[];
|
customButtons?: ButtonSpec[];
|
||||||
|
@ -29,6 +29,7 @@ export default (props: Props) => {
|
|||||||
return ln && globalKeydownHandlersRef.current[ln - 1] === elementId;
|
return ln && globalKeydownHandlersRef.current[ln - 1] === elementId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const isInSubModal = (targetElement: any) => {
|
const isInSubModal = (targetElement: any) => {
|
||||||
// If we are inside a sub-modal within the dialog, we shouldn't handle
|
// If we are inside a sub-modal within the dialog, we shouldn't handle
|
||||||
// global key events. It can be for example the emoji picker. In general
|
// global key events. It can be for example the emoji picker. In general
|
||||||
@ -39,6 +40,7 @@ export default (props: Props) => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onKeyDown = useCallback((event: any) => {
|
const onKeyDown = useCallback((event: any) => {
|
||||||
// Early exit if it's neither ENTER nor ESCAPE, because isInSubModal
|
// Early exit if it's neither ENTER nor ESCAPE, because isInSubModal
|
||||||
// function can be costly.
|
// function can be costly.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const Root = styled.div<any>`
|
const Root = styled.div<any>`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: ${props => props.justifyContent ? props.justifyContent : 'center'};
|
justify-content: ${props => props.justifyContent ? props.justifyContent : 'center'};
|
||||||
|
@ -11,8 +11,10 @@ interface Props {
|
|||||||
themeId: string;
|
themeId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
class DropboxLoginScreenComponent extends React.Component<any, any> {
|
class DropboxLoginScreenComponent extends React.Component<any, any> {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private shared_: any;
|
private shared_: any;
|
||||||
|
|
||||||
public constructor(props: Props) {
|
public constructor(props: Props) {
|
||||||
@ -61,6 +63,7 @@ class DropboxLoginScreenComponent extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const mapStateToProps = (state: any) => {
|
const mapStateToProps = (state: any) => {
|
||||||
return {
|
return {
|
||||||
themeId: state.settings.theme,
|
themeId: state.settings.theme,
|
||||||
|
@ -31,6 +31,7 @@ export const Dropdown = (props: Props) => {
|
|||||||
return optionComps;
|
return optionComps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onChange = useCallback((event: any) => {
|
const onChange = useCallback((event: any) => {
|
||||||
props.onChange({ value: event.target.value });
|
props.onChange({ value: event.target.value });
|
||||||
}, [props.onChange]);
|
}, [props.onChange]);
|
||||||
|
@ -86,6 +86,7 @@ export default function(props: Props) {
|
|||||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||||
}, [onClose, folderTitle, folderIcon, props.folderId, props.parentId]);
|
}, [onClose, folderTitle, folderIcon, props.folderId, props.parentId]);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onFolderTitleChange = useCallback((event: any) => {
|
const onFolderTitleChange = useCallback((event: any) => {
|
||||||
setFolderTitle(event.target.value);
|
setFolderTitle(event.target.value);
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -58,6 +58,7 @@ export const IconSelector = (props: Props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!emojiButtonClassReady) return () => {};
|
if (!emojiButtonClassReady) return () => {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const p: EmojiButton = new (window as any).EmojiButton({
|
const p: EmojiButton = new (window as any).EmojiButton({
|
||||||
zIndex: 10000,
|
zIndex: 10000,
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,7 @@ import ToggleAdvancedSettingsButton from '../ConfigScreen/controls/ToggleAdvance
|
|||||||
import MacOSMissingPasswordHelpLink from '../ConfigScreen/controls/MissingPasswordHelpLink';
|
import MacOSMissingPasswordHelpLink from '../ConfigScreen/controls/MissingPasswordHelpLink';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
themeId: any;
|
themeId: any;
|
||||||
masterKeys: MasterKeyEntity[];
|
masterKeys: MasterKeyEntity[];
|
||||||
passwords: Record<string, string>;
|
passwords: Record<string, string>;
|
||||||
@ -34,6 +35,7 @@ interface Props {
|
|||||||
const EncryptionConfigScreen = (props: Props) => {
|
const EncryptionConfigScreen = (props: Props) => {
|
||||||
const { inputPasswords, onInputPasswordChange } = useInputPasswords(props.passwords);
|
const { inputPasswords, onInputPasswordChange } = useInputPasswords(props.passwords);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const theme: any = useMemo(() => {
|
const theme: any = useMemo(() => {
|
||||||
return themeStyle(props.themeId);
|
return themeStyle(props.themeId);
|
||||||
}, [props.themeId]);
|
}, [props.themeId]);
|
||||||
@ -157,6 +159,7 @@ const EncryptionConfigScreen = (props: Props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const headerComp = isEnabledMasterKeys ? <h2>{_('Encryption keys')}</h2> : <a onClick={() => toggleShowDisabledMasterKeys() } style={{ ...theme.urlStyle, display: 'inline-block', marginBottom: 10 }} href="#">{showTable ? _('Hide disabled keys') : _('Show disabled keys')}</a>;
|
const headerComp = isEnabledMasterKeys ? <h2>{_('Encryption keys')}</h2> : <a onClick={() => toggleShowDisabledMasterKeys() } style={{ ...theme.urlStyle, display: 'inline-block', marginBottom: 10 }} href="#">{showTable ? _('Hide disabled keys') : _('Show disabled keys')}</a>;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const infoComp: any = null; // isEnabledMasterKeys ? <p>{'Note: Only one key is going to be used for encryption (the one marked as "active"). Any of the keys might be used for decryption, depending on how the notes or notebooks were originally encrypted.'}</p> : null;
|
const infoComp: any = null; // isEnabledMasterKeys ? <p>{'Note: Only one key is going to be used for encryption (the one marked as "active"). Any of the keys might be used for decryption, depending on how the notes or notebooks were originally encrypted.'}</p> : null;
|
||||||
const tableComp = !showTable ? null : (
|
const tableComp = !showTable ? null : (
|
||||||
<table>
|
<table>
|
||||||
|
@ -26,6 +26,7 @@ interface State {
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
message?: string;
|
message?: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
children: any;
|
children: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
|||||||
|
|
||||||
public state: State = { error: null, errorInfo: null, pluginInfos: [], plugins: {} };
|
public state: State = { error: null, errorInfo: null, pluginInfos: [], plugins: {} };
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public componentDidCatch(error: any, errorInfo: ErrorInfo) {
|
public componentDidCatch(error: any, errorInfo: ErrorInfo) {
|
||||||
if (typeof error === 'string') error = { message: error };
|
if (typeof error === 'string') error = { message: error };
|
||||||
|
|
||||||
|
@ -8,13 +8,16 @@ interface Props {
|
|||||||
themeId: number;
|
themeId: number;
|
||||||
type: string;
|
type: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
style?: any;
|
style?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const themeSelector = (_state: any, props: any) => themeStyle(props.themeId);
|
const themeSelector = (_state: any, props: any) => themeStyle(props.themeId);
|
||||||
|
|
||||||
const styleSelector = createSelector(
|
const styleSelector = createSelector(
|
||||||
themeSelector,
|
themeSelector,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(theme: any) => {
|
(theme: any) => {
|
||||||
const output = {
|
const output = {
|
||||||
root: {
|
root: {
|
||||||
|
@ -8,6 +8,7 @@ interface Props {
|
|||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClick: Function;
|
onClick: Function;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
style: any;
|
style: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ class HelpButtonComponent extends React.Component<Props> {
|
|||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
const style = { ...this.props.style, color: theme.color, textDecoration: 'none' };
|
const style = { ...this.props.style, color: theme.color, textDecoration: 'none' };
|
||||||
const helpIconStyle = { flex: 0, width: 16, height: 16, marginLeft: 10 };
|
const helpIconStyle = { flex: 0, width: 16, height: 16, marginLeft: 10 };
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const extraProps: any = {};
|
const extraProps: any = {};
|
||||||
if (this.props.tip) extraProps['data-tip'] = this.props.tip;
|
if (this.props.tip) extraProps['data-tip'] = this.props.tip;
|
||||||
return (
|
return (
|
||||||
|
@ -3,6 +3,7 @@ import { themeStyle } from '@joplin/lib/theme';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
style: any;
|
style: any;
|
||||||
iconName: string;
|
iconName: string;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
|
@ -83,6 +83,7 @@ class ImportScreenComponent extends React.Component<Props, State> {
|
|||||||
let lastProgress = '';
|
let lastProgress = '';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onProgress: (progressState: any) => {
|
onProgress: (progressState: any) => {
|
||||||
const line = [];
|
const line = [];
|
||||||
line.push(_('Found: %d.', progressState.loaded));
|
line.push(_('Found: %d.', progressState.loaded));
|
||||||
@ -94,6 +95,7 @@ class ImportScreenComponent extends React.Component<Props, State> {
|
|||||||
lastProgress = line.join(' ');
|
lastProgress = line.join(' ');
|
||||||
this.addMessage('progress', lastProgress);
|
this.addMessage('progress', lastProgress);
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onError: (error: any) => {
|
onError: (error: any) => {
|
||||||
// Don't display the error directly because most of the time it doesn't matter
|
// Don't display the error directly because most of the time it doesn't matter
|
||||||
// (eg. for weird broken HTML, but the note is still imported)
|
// (eg. for weird broken HTML, but the note is still imported)
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
style: any;
|
style: any;
|
||||||
itemHeight: number;
|
itemHeight: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
items: any[];
|
items: any[];
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
@ -22,6 +24,7 @@ interface State {
|
|||||||
class ItemList extends React.Component<Props, State> {
|
class ItemList extends React.Component<Props, State> {
|
||||||
|
|
||||||
private scrollTop_: number;
|
private scrollTop_: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private listRef: any;
|
private listRef: any;
|
||||||
|
|
||||||
public constructor(props: Props) {
|
public constructor(props: Props) {
|
||||||
@ -72,15 +75,18 @@ class ItemList extends React.Component<Props, State> {
|
|||||||
this.updateStateItemIndexes(newProps);
|
this.updateStateItemIndexes(newProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public onScroll(event: any) {
|
public onScroll(event: any) {
|
||||||
this.scrollTop_ = event.target.scrollTop;
|
this.scrollTop_ = event.target.scrollTop;
|
||||||
this.updateStateItemIndexes();
|
this.updateStateItemIndexes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public onKeyDown(event: any) {
|
public onKeyDown(event: any) {
|
||||||
if (this.props.onKeyDown) this.props.onKeyDown(event);
|
if (this.props.onKeyDown) this.props.onKeyDown(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public onDrop(event: any) {
|
public onDrop(event: any) {
|
||||||
if (this.props.onNoteDrop) this.props.onNoteDrop(event);
|
if (this.props.onNoteDrop) this.props.onNoteDrop(event);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const { buildStyle } = require('@joplin/lib/theme');
|
const { buildStyle } = require('@joplin/lib/theme');
|
||||||
|
|
||||||
export default function styles(themeId: number) {
|
export default function styles(themeId: number) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
return buildStyle('KeymapConfigScreen', themeId, (theme: any) => {
|
return buildStyle('KeymapConfigScreen', themeId, (theme: any) => {
|
||||||
return {
|
return {
|
||||||
container: {
|
container: {
|
||||||
|
@ -65,8 +65,10 @@ interface Props {
|
|||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
mainLayout: LayoutItem;
|
mainLayout: LayoutItem;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
style: any;
|
style: any;
|
||||||
layoutMoveMode: boolean;
|
layoutMoveMode: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
editorNoteStatuses: any;
|
editorNoteStatuses: any;
|
||||||
customCss: string;
|
customCss: string;
|
||||||
shouldUpgradeSyncTarget: boolean;
|
shouldUpgradeSyncTarget: boolean;
|
||||||
@ -78,6 +80,7 @@ interface Props {
|
|||||||
showShouldReencryptMessage: boolean;
|
showShouldReencryptMessage: boolean;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
settingEditorCodeView: boolean;
|
settingEditorCodeView: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
pluginsLegacy: any;
|
pluginsLegacy: any;
|
||||||
startupPluginsLoaded: boolean;
|
startupPluginsLoaded: boolean;
|
||||||
shareInvitations: ShareInvitation[];
|
shareInvitations: ShareInvitation[];
|
||||||
@ -102,10 +105,14 @@ interface ShareFolderDialogOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
promptOptions: any;
|
promptOptions: any;
|
||||||
modalLayer: LayerModalState;
|
modalLayer: LayerModalState;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
notePropertiesDialogOptions: any;
|
notePropertiesDialogOptions: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
noteContentPropertiesDialogOptions: any;
|
noteContentPropertiesDialogOptions: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
shareNoteDialogOptions: any;
|
shareNoteDialogOptions: any;
|
||||||
shareFolderDialogOptions: ShareFolderDialogOptions;
|
shareFolderDialogOptions: ShareFolderDialogOptions;
|
||||||
}
|
}
|
||||||
@ -132,9 +139,11 @@ const defaultLayout: LayoutItem = {
|
|||||||
|
|
||||||
class MainScreenComponent extends React.Component<Props, State> {
|
class MainScreenComponent extends React.Component<Props, State> {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private waitForNotesSavedIID_: any;
|
private waitForNotesSavedIID_: any;
|
||||||
private isPrinting_: boolean;
|
private isPrinting_: boolean;
|
||||||
private styleKey_: string;
|
private styleKey_: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private styles_: any;
|
private styles_: any;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private promptOnClose_: Function;
|
private promptOnClose_: Function;
|
||||||
@ -176,6 +185,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
|
|
||||||
window.addEventListener('resize', this.window_resize);
|
window.addEventListener('resize', this.window_resize);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
ipcRenderer.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
ipcRenderer.on('asynchronous-message', (_event: any, message: string, args: any) => {
|
||||||
if (message === 'openCallbackUrl') {
|
if (message === 'openCallbackUrl') {
|
||||||
this.openCallbackUrl(args.url);
|
this.openCallbackUrl(args.url);
|
||||||
@ -330,6 +340,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public updateRootLayoutSize() {
|
public updateRootLayoutSize() {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.updateMainLayout(produce(this.props.mainLayout, (draft: any) => {
|
this.updateMainLayout(produce(this.props.mainLayout, (draft: any) => {
|
||||||
const s = this.rootLayoutSize();
|
const s = this.rootLayoutSize();
|
||||||
draft.width = s.width;
|
draft.width = s.width;
|
||||||
@ -400,6 +411,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public layoutModeListenerKeyDown(event: any) {
|
public layoutModeListenerKeyDown(event: any) {
|
||||||
if (event.key !== 'Escape') return;
|
if (event.key !== 'Escape') return;
|
||||||
if (!this.props.layoutMoveMode) return;
|
if (!this.props.layoutMoveMode) return;
|
||||||
@ -425,6 +437,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public async printTo_(target: string, options: any) {
|
public async printTo_(target: string, options: any) {
|
||||||
// Concurrent print calls are disallowed to avoid incorrect settings being restored upon completion
|
// Concurrent print calls are disallowed to avoid incorrect settings being restored upon completion
|
||||||
if (this.isPrinting_) {
|
if (this.isPrinting_) {
|
||||||
@ -533,6 +546,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private renderNotificationMessage(message: string, callForAction: string = null, callForActionHandler: Function = null, callForAction2: string = null, callForActionHandler2: Function = null) {
|
private renderNotificationMessage(message: string, callForAction: string = null, callForActionHandler: Function = null, callForAction2: string = null, callForActionHandler2: Function = null) {
|
||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };
|
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };
|
||||||
|
|
||||||
if (!callForAction) return <span>{message}</span>;
|
if (!callForAction) return <span>{message}</span>;
|
||||||
@ -557,6 +571,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
public renderNotification(theme: any, styles: any) {
|
public renderNotification(theme: any, styles: any) {
|
||||||
if (!this.messageBoxVisible()) return null;
|
if (!this.messageBoxVisible()) return null;
|
||||||
|
|
||||||
@ -705,6 +720,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private resizableLayout_resize(event: any) {
|
private resizableLayout_resize(event: any) {
|
||||||
this.updateMainLayout(event.layout);
|
this.updateMainLayout(event.layout);
|
||||||
}
|
}
|
||||||
@ -714,6 +730,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
this.updateMainLayout(newLayout);
|
this.updateMainLayout(newLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
private resizableLayout_renderItem(key: string, event: any) {
|
private resizableLayout_renderItem(key: string, event: any) {
|
||||||
// Key should never be undefined but somehow it can happen, also not
|
// Key should never be undefined but somehow it can happen, also not
|
||||||
// clear how. For now in this case render nothing so that the app
|
// clear how. For now in this case render nothing so that the app
|
||||||
@ -728,6 +745,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
|
|
||||||
// const viewsToRemove:string[] = [];
|
// const viewsToRemove:string[] = [];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const components: any = {
|
const components: any = {
|
||||||
sideBar: () => {
|
sideBar: () => {
|
||||||
return <Sidebar key={key} />;
|
return <Sidebar key={key} />;
|
||||||
@ -854,6 +872,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
const styles = this.styles(this.props.themeId, style.width, style.height, this.messageBoxVisible());
|
const styles = this.styles(this.props.themeId, style.width, style.height, this.messageBoxVisible());
|
||||||
|
|
||||||
if (!this.promptOnClose_) {
|
if (!this.promptOnClose_) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
this.promptOnClose_ = (answer: any, buttonType: any) => {
|
this.promptOnClose_ = (answer: any, buttonType: any) => {
|
||||||
return this.state.promptOptions.onClose(answer, buttonType);
|
return this.state.promptOptions.onClose(answer, buttonType);
|
||||||
};
|
};
|
||||||
@ -898,6 +917,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
lastDeletion={this.props.lastDeletion}
|
lastDeletion={this.props.lastDeletion}
|
||||||
lastDeletionNotificationTime={this.props.lastDeletionNotificationTime}
|
lastDeletionNotificationTime={this.props.lastDeletionNotificationTime}
|
||||||
themeId={this.props.themeId}
|
themeId={this.props.themeId}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
dispatch={this.props.dispatch as any}
|
dispatch={this.props.dispatch as any}
|
||||||
/>
|
/>
|
||||||
{messageComp}
|
{messageComp}
|
||||||
|
@ -9,6 +9,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Create new profile...'),
|
label: () => _('Create new profile...'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext) => {
|
execute: async (context: CommandContext) => {
|
||||||
|
@ -12,6 +12,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
iconName: 'icon-alarm',
|
iconName: 'icon-alarm',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteId: string = null) => {
|
execute: async (context: CommandContext, noteId: string = null) => {
|
||||||
@ -29,6 +30,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
inputType: 'datetime',
|
inputType: 'datetime',
|
||||||
buttons: ['ok', 'cancel', 'clear'],
|
buttons: ['ok', 'cancel', 'clear'],
|
||||||
value: note.todo_due ? new Date(note.todo_due) : defaultDate,
|
value: note.todo_due ? new Date(note.todo_due) : defaultDate,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onClose: async (answer: any, buttonType: string) => {
|
onClose: async (answer: any, buttonType: string) => {
|
||||||
let newNote: NoteEntity = null;
|
let newNote: NoteEntity = null;
|
||||||
|
|
||||||
@ -57,6 +59,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
|
|
||||||
enabledCondition: 'oneNoteSelected && noteIsTodo && !noteTodoCompleted',
|
enabledCondition: 'oneNoteSelected && noteIsTodo && !noteTodoCompleted',
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
mapStateToTitle: (state: any) => {
|
mapStateToTitle: (state: any) => {
|
||||||
const note = stateUtils.selectedNote(state);
|
const note = stateUtils.selectedNote(state);
|
||||||
return note && note.todo_due ? time.formatMsToLocal(note.todo_due) : null;
|
return note && note.todo_due ? time.formatMsToLocal(note.todo_due) : null;
|
||||||
|
@ -10,6 +10,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => `PDF - ${_('PDF File')}`,
|
label: () => `PDF - ${_('PDF File')}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||||
|
@ -14,6 +14,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function menuItemById(id: string) {
|
function menuItemById(id: string) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
return PluginManager.instance().menuItems().find((i: any) => i.id === id);
|
return PluginManager.instance().menuItems().find((i: any) => i.id === id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ export const runtime = (): CommandRuntime => {
|
|||||||
} else if (uiType === UiType.ControlledApi) {
|
} else if (uiType === UiType.ControlledApi) {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
|
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
|
||||||
menuItem.userData = {
|
menuItem.userData = {
|
||||||
callback: { resolve, reject },
|
callback: { resolve, reject },
|
||||||
|
@ -4,6 +4,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
name: 'hideModalMessage',
|
name: 'hideModalMessage',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async () => {
|
execute: async () => {
|
||||||
|
@ -8,15 +8,19 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Move to notebook'),
|
label: () => _('Move to notebook'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||||
noteIds = noteIds || context.state.selectedNoteIds;
|
noteIds = noteIds || context.state.selectedNoteIds;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const folders: any[] = await Folder.sortFolderTree();
|
const folders: any[] = await Folder.sortFolderTree();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const startFolders: any[] = [];
|
const startFolders: any[] = [];
|
||||||
const maxDepth = 15;
|
const maxDepth = 15;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const addOptions = (folders: any[], depth: number) => {
|
const addOptions = (folders: any[], depth: number) => {
|
||||||
for (let i = 0; i < folders.length; i++) {
|
for (let i = 0; i < folders.length; i++) {
|
||||||
const folder = folders[i];
|
const folder = folders[i];
|
||||||
@ -33,6 +37,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
inputType: 'dropdown',
|
inputType: 'dropdown',
|
||||||
value: '',
|
value: '',
|
||||||
autocomplete: startFolders,
|
autocomplete: startFolders,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onClose: async (answer: any) => {
|
onClose: async (answer: any) => {
|
||||||
if (answer) {
|
if (answer) {
|
||||||
for (let i = 0; i < noteIds.length; i++) {
|
for (let i = 0; i < noteIds.length; i++) {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
iconName: 'fa-file',
|
iconName: 'fa-file',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Rename'),
|
label: () => _('Rename'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, folderId: string = null) => {
|
execute: async (context: CommandContext, folderId: string = null) => {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Rename'),
|
label: () => _('Rename'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, tagId: string = null) => {
|
execute: async (context: CommandContext, tagId: string = null) => {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
iconName: 'icon-tags',
|
iconName: 'icon-tags',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||||
@ -15,18 +16,22 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
|
|
||||||
const tags = await Tag.commonTagsByNoteIds(noteIds);
|
const tags = await Tag.commonTagsByNoteIds(noteIds);
|
||||||
const startTags = tags
|
const startTags = tags
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
.map((a: any) => {
|
.map((a: any) => {
|
||||||
return { value: a.id, label: a.title };
|
return { value: a.id, label: a.title };
|
||||||
})
|
})
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
.sort((a: any, b: any) => {
|
.sort((a: any, b: any) => {
|
||||||
// sensitivity accent will treat accented characters as different
|
// sensitivity accent will treat accented characters as different
|
||||||
// but treats caps as equal
|
// but treats caps as equal
|
||||||
return a.label.localeCompare(b.label, undefined, { sensitivity: 'accent' });
|
return a.label.localeCompare(b.label, undefined, { sensitivity: 'accent' });
|
||||||
});
|
});
|
||||||
const allTags = await Tag.allWithNotes();
|
const allTags = await Tag.allWithNotes();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const tagSuggestions = allTags.map((a: any) => {
|
const tagSuggestions = allTags.map((a: any) => {
|
||||||
return { value: a.id, label: a.title };
|
return { value: a.id, label: a.title };
|
||||||
})
|
})
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
.sort((a: any, b: any) => {
|
.sort((a: any, b: any) => {
|
||||||
// sensitivity accent will treat accented characters as different
|
// sensitivity accent will treat accented characters as different
|
||||||
// but treats caps as equal
|
// but treats caps as equal
|
||||||
@ -39,6 +44,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
inputType: 'tags',
|
inputType: 'tags',
|
||||||
value: startTags,
|
value: startTags,
|
||||||
autocomplete: tagSuggestions,
|
autocomplete: tagSuggestions,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onClose: async (answer: any[]) => {
|
onClose: async (answer: any[]) => {
|
||||||
if (answer !== null) {
|
if (answer !== null) {
|
||||||
const endTagTitles = answer.map(a => {
|
const endTagTitles = answer.map(a => {
|
||||||
@ -47,6 +53,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
if (noteIds.length === 1) {
|
if (noteIds.length === 1) {
|
||||||
await Tag.setNoteTagsByTitles(noteIds[0], endTagTitles);
|
await Tag.setNoteTagsByTitles(noteIds[0], endTagTitles);
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const startTagTitles = startTags.map((a: any) => { return a.label.trim(); });
|
const startTagTitles = startTags.map((a: any) => { return a.label.trim(); });
|
||||||
const addTags = endTagTitles.filter((value: string) => !startTagTitles.includes(value));
|
const addTags = endTagTitles.filter((value: string) => !startTagTitles.includes(value));
|
||||||
const delTags = startTagTitles.filter((value: string) => !endTagTitles.includes(value));
|
const delTags = startTagTitles.filter((value: string) => !endTagTitles.includes(value));
|
||||||
@ -54,6 +61,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
// apply the tag additions and deletions to each selected note
|
// apply the tag additions and deletions to each selected note
|
||||||
for (let i = 0; i < noteIds.length; i++) {
|
for (let i = 0; i < noteIds.length; i++) {
|
||||||
const tags = await Tag.tagsByNoteId(noteIds[i]);
|
const tags = await Tag.tagsByNoteId(noteIds[i]);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let tagTitles = tags.map((a: any) => { return a.title; });
|
let tagTitles = tags.map((a: any) => { return a.title; });
|
||||||
tagTitles = tagTitles.concat(addTags);
|
tagTitles = tagTitles.concat(addTags);
|
||||||
tagTitles = tagTitles.filter((value: string) => !delTags.includes(value));
|
tagTitles = tagTitles.filter((value: string) => !delTags.includes(value));
|
||||||
|
@ -5,6 +5,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
name: 'showModalMessage',
|
name: 'showModalMessage',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (_context: CommandContext, message: string) => {
|
execute: async (_context: CommandContext, message: string) => {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Statistics...'),
|
label: () => _('Statistics...'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteId: string = null) => {
|
execute: async (context: CommandContext, noteId: string = null) => {
|
||||||
|
@ -8,6 +8,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
iconName: 'icon-info',
|
iconName: 'icon-info',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteId: string = null) => {
|
execute: async (context: CommandContext, noteId: string = null) => {
|
||||||
|
@ -14,11 +14,14 @@ enum PromptInputType {
|
|||||||
interface PromptConfig {
|
interface PromptConfig {
|
||||||
label: string;
|
label: string;
|
||||||
inputType?: PromptInputType;
|
inputType?: PromptInputType;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
value?: any;
|
value?: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
autocomplete?: any[];
|
autocomplete?: any[];
|
||||||
buttons?: string[];
|
buttons?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (_context: CommandContext, config: PromptConfig) => {
|
execute: async (_context: CommandContext, config: PromptConfig) => {
|
||||||
@ -26,6 +29,7 @@ export const runtime = (comp: any): CommandRuntime => {
|
|||||||
comp.setState({
|
comp.setState({
|
||||||
promptOptions: {
|
promptOptions: {
|
||||||
...config,
|
...config,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onClose: async (answer: any, buttonType: string) => {
|
onClose: async (answer: any, buttonType: string) => {
|
||||||
comp.setState({ promptOptions: null });
|
comp.setState({ promptOptions: null });
|
||||||
resolve({
|
resolve({
|
||||||
|
@ -6,6 +6,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Share notebook...'),
|
label: () => _('Share notebook...'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, folderId: string = null) => {
|
execute: async (context: CommandContext, folderId: string = null) => {
|
||||||
|
@ -6,6 +6,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
label: () => _('Publish note...'),
|
label: () => _('Publish note...'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
execute: async (context: CommandContext, noteIds: string[] = null) => {
|
||||||
|
@ -19,6 +19,7 @@ export const runtime = (): CommandRuntime => {
|
|||||||
useSpellChecker = useSpellChecker === null ? context.state.settings['spellChecker.enabled'] : useSpellChecker;
|
useSpellChecker = useSpellChecker === null ? context.state.settings['spellChecker.enabled'] : useSpellChecker;
|
||||||
|
|
||||||
const menuItems = SpellCheckerService.instance().spellCheckerConfigMenuItems(selectedLanguages, useSpellChecker);
|
const menuItems = SpellCheckerService.instance().spellCheckerConfigMenuItems(selectedLanguages, useSpellChecker);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const menu = Menu.buildFromTemplate(menuItems as any);
|
const menu = Menu.buildFromTemplate(menuItems as any);
|
||||||
menu.popup({ window: bridge().window() });
|
menu.popup({ window: bridge().window() });
|
||||||
},
|
},
|
||||||
|
@ -10,6 +10,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
execute: async (_context: CommandContext, field?: string | any[], reverse?: boolean) => {
|
execute: async (_context: CommandContext, field?: string | any[], reverse?: boolean) => {
|
||||||
// field: Sort order's field. undefined means switching a field.
|
// field: Sort order's field. undefined means switching a field.
|
||||||
// reverse: whether the sort order is reversed or not. undefined means toggling.
|
// reverse: whether the sort order is reversed or not. undefined means toggling.
|
||||||
|
@ -7,6 +7,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
iconName: 'icon-layout ',
|
iconName: 'icon-layout ',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export const runtime = (comp: any): CommandRuntime => {
|
export const runtime = (comp: any): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async () => {
|
execute: async () => {
|
||||||
|
@ -94,14 +94,17 @@ export default function(props: Props) {
|
|||||||
return !hasMasterPasswordEncryptedData;
|
return !hasMasterPasswordEncryptedData;
|
||||||
}, [hasMasterPasswordEncryptedData, mode]);
|
}, [hasMasterPasswordEncryptedData, mode]);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onCurrentPasswordChange = useCallback((event: any) => {
|
const onCurrentPasswordChange = useCallback((event: any) => {
|
||||||
setCurrentPassword(event.target.value);
|
setCurrentPassword(event.target.value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onPasswordChange1 = useCallback((event: any) => {
|
const onPasswordChange1 = useCallback((event: any) => {
|
||||||
setPassword1(event.target.value);
|
setPassword1(event.target.value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const onPasswordChange2 = useCallback((event: any) => {
|
const onPasswordChange2 = useCallback((event: any) => {
|
||||||
setPassword2(event.target.value);
|
setPassword2(event.target.value);
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -60,6 +60,7 @@ function getPluginCommandNames(plugins: PluginStates): string[] {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemClick: Function) {
|
function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemClick: Function) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const output: any = {
|
const output: any = {
|
||||||
label: label,
|
label: label,
|
||||||
submenu: [],
|
submenu: [],
|
||||||
@ -76,13 +77,16 @@ function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemCl
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const useSwitchProfileMenuItems = (profileConfig: ProfileConfig, menuItemDic: any) => {
|
const useSwitchProfileMenuItems = (profileConfig: ProfileConfig, menuItemDic: any) => {
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const switchProfileMenuItems: any[] = [];
|
const switchProfileMenuItems: any[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < profileConfig.profiles.length; i++) {
|
for (let i = 0; i < profileConfig.profiles.length; i++) {
|
||||||
const profile = profileConfig.profiles[i];
|
const profile = profileConfig.profiles[i];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let menuItem: any = {};
|
let menuItem: any = {};
|
||||||
const profileNum = i + 1;
|
const profileNum = i + 1;
|
||||||
|
|
||||||
@ -113,9 +117,11 @@ const useSwitchProfileMenuItems = (profileConfig: ProfileConfig, menuItemDic: an
|
|||||||
};
|
};
|
||||||
|
|
||||||
const useNoteListMenuItems = (noteListRendererIds: string[]) => {
|
const useNoteListMenuItems = (noteListRendererIds: string[]) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const [menuItems, setMenuItems] = useState<any[]>([]);
|
const [menuItems, setMenuItems] = useState<any[]>([]);
|
||||||
|
|
||||||
useAsyncEffect(async (event) => {
|
useAsyncEffect(async (event) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const output: any[] = [];
|
const output: any[] = [];
|
||||||
for (const id of noteListRendererIds) {
|
for (const id of noteListRendererIds) {
|
||||||
const renderer = getListRendererById(id);
|
const renderer = getListRendererById(id);
|
||||||
@ -141,6 +147,7 @@ const useNoteListMenuItems = (noteListRendererIds: string[]) => {
|
|||||||
interface Props {
|
interface Props {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
menuItemProps: any;
|
menuItemProps: any;
|
||||||
routeName: string;
|
routeName: string;
|
||||||
selectedFolderId: string;
|
selectedFolderId: string;
|
||||||
@ -152,7 +159,9 @@ interface Props {
|
|||||||
showNoteCounts: boolean;
|
showNoteCounts: boolean;
|
||||||
uncompletedTodosOnTop: boolean;
|
uncompletedTodosOnTop: boolean;
|
||||||
showCompletedTodos: boolean;
|
showCompletedTodos: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
pluginMenuItems: any[];
|
pluginMenuItems: any[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
pluginMenus: any[];
|
pluginMenus: any[];
|
||||||
['spellChecker.enabled']: boolean;
|
['spellChecker.enabled']: boolean;
|
||||||
['spellChecker.languages']: string[];
|
['spellChecker.languages']: string[];
|
||||||
@ -181,8 +190,10 @@ function menuItemSetEnabled(id: string, enabled: boolean) {
|
|||||||
menuItem.enabled = enabled;
|
menuItem.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function useMenuStates(menu: any, props: Props) {
|
function useMenuStates(menu: any, props: Props) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let timeoutId: any = null;
|
let timeoutId: any = null;
|
||||||
|
|
||||||
function scheduleUpdate() {
|
function scheduleUpdate() {
|
||||||
@ -212,10 +223,12 @@ function useMenuStates(menu: any, props: Props) {
|
|||||||
const sortOptions = Setting.enumOptions(`${type}.sortOrder.field`);
|
const sortOptions = Setting.enumOptions(`${type}.sortOrder.field`);
|
||||||
for (const field in sortOptions) {
|
for (const field in sortOptions) {
|
||||||
if (!sortOptions.hasOwnProperty(field)) continue;
|
if (!sortOptions.hasOwnProperty(field)) continue;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
menuItemSetChecked(`sort:${type}:${field}`, (props as any)[`${type}.sortOrder.field`] === field);
|
menuItemSetChecked(`sort:${type}:${field}`, (props as any)[`${type}.sortOrder.field`] === field);
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = type === 'notes' ? 'toggleNotesSortOrderReverse' : `sort:${type}:reverse`;
|
const id = type === 'notes' ? 'toggleNotesSortOrderReverse' : `sort:${type}:reverse`;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
menuItemSetChecked(id, (props as any)[`${type}.sortOrder.reverse`]);
|
menuItemSetChecked(id, (props as any)[`${type}.sortOrder.reverse`]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,12 +302,14 @@ function useMenu(props: Props) {
|
|||||||
|
|
||||||
void CommandService.instance().execute('showModalMessage', modalMessage);
|
void CommandService.instance().execute('showModalMessage', modalMessage);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const errors: any[] = [];
|
const errors: any[] = [];
|
||||||
|
|
||||||
const importOptions = {
|
const importOptions = {
|
||||||
path,
|
path,
|
||||||
format: module.format,
|
format: module.format,
|
||||||
outputFormat: module.outputFormat,
|
outputFormat: module.outputFormat,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onProgress: (status: any) => {
|
onProgress: (status: any) => {
|
||||||
const statusStrings: string[] = Object.keys(status).map((key: string) => {
|
const statusStrings: string[] = Object.keys(status).map((key: string) => {
|
||||||
return `${key}: ${status[key]}`;
|
return `${key}: ${status[key]}`;
|
||||||
@ -302,6 +317,7 @@ function useMenu(props: Props) {
|
|||||||
|
|
||||||
void CommandService.instance().execute('showModalMessage', `${modalMessage}\n\n${statusStrings.join('\n')}`);
|
void CommandService.instance().execute('showModalMessage', `${modalMessage}\n\n${statusStrings.join('\n')}`);
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
onError: (error: any) => {
|
onError: (error: any) => {
|
||||||
errors.push(error);
|
errors.push(error);
|
||||||
console.warn(error);
|
console.warn(error);
|
||||||
@ -349,6 +365,7 @@ function useMenu(props: Props) {
|
|||||||
const onImportModuleClickRef = useRef(null);
|
const onImportModuleClickRef = useRef(null);
|
||||||
onImportModuleClickRef.current = onImportModuleClick;
|
onImportModuleClickRef.current = onImportModuleClick;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const pluginCommandNames = useMemo(() => props.pluginMenuItems.map((view: any) => view.commandName), [props.pluginMenuItems]);
|
const pluginCommandNames = useMemo(() => props.pluginMenuItems.map((view: any) => view.commandName), [props.pluginMenuItems]);
|
||||||
|
|
||||||
const menuItemDic = useMemo(() => {
|
const menuItemDic = useMemo(() => {
|
||||||
@ -360,11 +377,13 @@ function useMenu(props: Props) {
|
|||||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||||
}, [commandNames, pluginCommandNames, props.locale]);
|
}, [commandNames, pluginCommandNames, props.locale]);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const switchProfileMenuItems: any[] = useSwitchProfileMenuItems(props.profileConfig, menuItemDic);
|
const switchProfileMenuItems: any[] = useSwitchProfileMenuItems(props.profileConfig, menuItemDic);
|
||||||
|
|
||||||
const noteListMenuItems = useNoteListMenuItems(props.noteListRendererIds);
|
const noteListMenuItems = useNoteListMenuItems(props.noteListRendererIds);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let timeoutId: any = null;
|
let timeoutId: any = null;
|
||||||
|
|
||||||
function updateMenu() {
|
function updateMenu() {
|
||||||
@ -442,6 +461,7 @@ function useMenu(props: Props) {
|
|||||||
label: module.fullLabel(),
|
label: module.fullLabel(),
|
||||||
click: async () => {
|
click: async () => {
|
||||||
await InteropServiceHelper.export(
|
await InteropServiceHelper.export(
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
(action: any) => props.dispatch(action),
|
(action: any) => props.dispatch(action),
|
||||||
module,
|
module,
|
||||||
{
|
{
|
||||||
@ -507,9 +527,11 @@ function useMenu(props: Props) {
|
|||||||
submenu: switchProfileMenuItems,
|
submenu: switchProfileMenuItems,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let toolsItems: any[] = [];
|
let toolsItems: any[] = [];
|
||||||
|
|
||||||
// we need this workaround, because on macOS the menu is different
|
// we need this workaround, because on macOS the menu is different
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const toolsItemsWindowsLinux: any[] = [
|
const toolsItemsWindowsLinux: any[] = [
|
||||||
{
|
{
|
||||||
label: _('Options'),
|
label: _('Options'),
|
||||||
@ -686,6 +708,7 @@ function useMenu(props: Props) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const rootMenus: any = {
|
const rootMenus: any = {
|
||||||
edit: {
|
edit: {
|
||||||
id: 'edit',
|
id: 'edit',
|
||||||
@ -922,6 +945,7 @@ function useMenu(props: Props) {
|
|||||||
// It seems the "visible" property of separators is ignored by Electron, making
|
// It seems the "visible" property of separators is ignored by Electron, making
|
||||||
// it display separators that we want hidden. So this function iterates through
|
// it display separators that we want hidden. So this function iterates through
|
||||||
// them and remove them completely.
|
// them and remove them completely.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const cleanUpSeparators = (items: any[]) => {
|
const cleanUpSeparators = (items: any[]) => {
|
||||||
const output = [];
|
const output = [];
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
@ -991,6 +1015,7 @@ function useMenu(props: Props) {
|
|||||||
menuItemDic.textCut,
|
menuItemDic.textCut,
|
||||||
menuItemDic.textPaste,
|
menuItemDic.textPaste,
|
||||||
menuItemDic.textSelectAll,
|
menuItemDic.textSelectAll,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
] as any,
|
] as any,
|
||||||
},
|
},
|
||||||
]));
|
]));
|
||||||
@ -1054,6 +1079,7 @@ function useMenu(props: Props) {
|
|||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
function MenuBar(props: Props): any {
|
function MenuBar(props: Props): any {
|
||||||
const menu = useMenu(props);
|
const menu = useMenu(props);
|
||||||
if (menu) Menu.setApplicationMenu(menu);
|
if (menu) Menu.setApplicationMenu(menu);
|
||||||
|
@ -9,6 +9,7 @@ const bridge = require('@electron/remote').require('./bridge').default;
|
|||||||
interface MultiNoteActionsProps {
|
interface MultiNoteActionsProps {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
selectedNoteIds: string[];
|
selectedNoteIds: string[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
notes: any[];
|
notes: any[];
|
||||||
dispatch: Dispatch;
|
dispatch: Dispatch;
|
||||||
watchedNoteFiles: string[];
|
watchedNoteFiles: string[];
|
||||||
@ -18,6 +19,7 @@ interface MultiNoteActionsProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function styles_(props: MultiNoteActionsProps) {
|
function styles_(props: MultiNoteActionsProps) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
return buildStyle('MultiNoteActions', props.themeId, (theme: any) => {
|
return buildStyle('MultiNoteActions', props.themeId, (theme: any) => {
|
||||||
return {
|
return {
|
||||||
root: {
|
root: {
|
||||||
@ -41,6 +43,7 @@ function styles_(props: MultiNoteActionsProps) {
|
|||||||
export default function MultiNoteActions(props: MultiNoteActionsProps) {
|
export default function MultiNoteActions(props: MultiNoteActionsProps) {
|
||||||
const styles = styles_(props);
|
const styles = styles_(props);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const multiNotesButton_click = (item: any) => {
|
const multiNotesButton_click = (item: any) => {
|
||||||
if (item.submenu) {
|
if (item.submenu) {
|
||||||
item.submenu.popup({ window: bridge().window() });
|
item.submenu.popup({ window: bridge().window() });
|
||||||
|
@ -5,6 +5,7 @@ import { AppState } from '../app.reducer';
|
|||||||
const bridge = require('@electron/remote').require('./bridge').default;
|
const bridge = require('@electron/remote').require('./bridge').default;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
route: any;
|
route: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ interface KeyToLabelMap {
|
|||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
let markupToHtml_: any = null;
|
let markupToHtml_: any = null;
|
||||||
function markupToHtml() {
|
function markupToHtml() {
|
||||||
if (markupToHtml_) return markupToHtml_;
|
if (markupToHtml_) return markupToHtml_;
|
||||||
@ -31,6 +32,7 @@ function markupToHtml() {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
// 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) {
|
function countElements(text: string, wordSetter: Function, characterSetter: Function, characterNoSpaceSetter: Function, lineSetter: Function) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
Countable.count(text, (counter: any) => {
|
Countable.count(text, (counter: any) => {
|
||||||
wordSetter(counter.words);
|
wordSetter(counter.words);
|
||||||
characterSetter(counter.all);
|
characterSetter(counter.all);
|
||||||
@ -49,6 +51,7 @@ function formatReadTime(readTimeMinutes: number) {
|
|||||||
|
|
||||||
export default function NoteContentPropertiesDialog(props: NoteContentPropertiesDialogProps) {
|
export default function NoteContentPropertiesDialog(props: NoteContentPropertiesDialogProps) {
|
||||||
const theme = themeStyle(props.themeId);
|
const theme = themeStyle(props.themeId);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const tableBodyComps: any[] = [];
|
const tableBodyComps: any[] = [];
|
||||||
// For the source Markdown
|
// For the source Markdown
|
||||||
const [lines, setLines] = useState<number>(0);
|
const [lines, setLines] = useState<number>(0);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export function cursorPositionToTextOffset(cursorPos: any, body: string) {
|
export function cursorPositionToTextOffset(cursorPos: any, body: string) {
|
||||||
if (!body) return 0;
|
if (!body) return 0;
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ export function cursorPositionToTextOffset(cursorPos: any, body: string) {
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
export function usePrevious(value: any): any {
|
export function usePrevious(value: any): any {
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export interface RenderedBody {
|
export interface RenderedBody {
|
||||||
html: string;
|
html: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
pluginAssets: any[];
|
pluginAssets: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user