1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-10 22:11:50 +02:00

Chore: Fixed conflict between TS and eslint

This commit is contained in:
Laurent Cozic
2025-05-05 10:46:00 +01:00
parent 981759691d
commit 277935b8b1
4 changed files with 5 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext, noteId: string, reverseRevIndex:number = 0) => {
execute: async (_context: CommandContext, noteId: string, reverseRevIndex = 0) => {
try {
const note = await RevisionService.instance().restoreNoteById(noteId, reverseRevIndex);
await shim.showMessageBox(RevisionService.instance().restoreSuccessMessage(note), { type: MessageBoxType.Info });

View File

@@ -12,7 +12,7 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext, body:string = '', todo:boolean = false, options: GotoNoteOptions = null) => {
execute: async (_context: CommandContext, body = '', todo = false, options: GotoNoteOptions = null) => {
const folderId = Setting.value('activeFolderId');
if (!folderId) {
logger.warn('Not creating new note -- no active folder ID.');

View File

@@ -13,7 +13,7 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (context: CommandContext, editorViewId:string = '', show:boolean = true) => {
execute: async (context: CommandContext, editorViewId = '', show = true) => {
logger.info('View:', editorViewId, 'Show:', show);
const shownEditorViewIds = Setting.value('plugins.shownEditorViewIds');

View File

@@ -8,8 +8,6 @@ import type { WhenClauseContext } from './commands/stateToWhenClauseContext';
type LabelFunction = ()=> string;
type EnabledCondition = string;
export type CommandArgument = string|number|object|boolean|null;
export interface CommandContext {
// The state may also be of type "AppState" (used by the desktop app), which inherits from "State" (used by all apps)
state: State;
@@ -19,7 +17,7 @@ export interface CommandContext {
export interface CommandRuntime {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
execute(context: CommandContext, ...args: CommandArgument[]): Promise<any | void>;
execute(context: CommandContext, ...args: any[]): Promise<any | void>;
enabledCondition?: EnabledCondition;
// Used for the (optional) toolbar button title
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
@@ -319,7 +317,7 @@ export default class CommandService extends BaseService {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
public async execute(commandName: string, ...args: CommandArgument[]): Promise<any | void> {
public async execute(commandName: string, ...args: any[]): Promise<any | void> {
const command = this.commandByName(commandName);
// Some commands such as "showModalMessage" can be executed many
// times per seconds, so we should only display this message in