You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Tools: Implement @typescript-eslint/no-explicit-any rule
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
import Global from '../api/Global';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
type EventHandler = (callbackId: string, args: any[])=> void;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function createEventHandlers(arg: any, eventHandler: EventHandler) {
|
||||
if (Array.isArray(arg)) {
|
||||
for (let i = 0; i < arg.length; i++) {
|
||||
@ -10,6 +12,7 @@ function createEventHandlers(arg: any, eventHandler: EventHandler) {
|
||||
return arg;
|
||||
} else if (typeof arg === 'string' && arg.indexOf('___plugin_event_') === 0) {
|
||||
const callbackId = arg;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
return async (...args: any[]) => {
|
||||
const result = await eventHandler(callbackId, args);
|
||||
return result;
|
||||
@ -25,10 +28,13 @@ function createEventHandlers(arg: any, eventHandler: EventHandler) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
export default async function executeSandboxCall(pluginId: string, sandbox: Global, path: string, args: any[], eventHandler: EventHandler) {
|
||||
const pathFragments = path.split('.');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
let parent: any = null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
let fn: any = sandbox;
|
||||
|
||||
if (!fn) throw new Error(`No sandbox for plugin ${pluginId}`); // Sanity check as normally cannot happen
|
||||
|
Reference in New Issue
Block a user