You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Chore: Fixed conflict between TS and eslint
This commit is contained in:
@@ -9,7 +9,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (_context: CommandContext, noteId: string, reverseRevIndex:number = 0) => {
|
execute: async (_context: CommandContext, noteId: string, reverseRevIndex = 0) => {
|
||||||
try {
|
try {
|
||||||
const note = await RevisionService.instance().restoreNoteById(noteId, reverseRevIndex);
|
const note = await RevisionService.instance().restoreNoteById(noteId, reverseRevIndex);
|
||||||
await shim.showMessageBox(RevisionService.instance().restoreSuccessMessage(note), { type: MessageBoxType.Info });
|
await shim.showMessageBox(RevisionService.instance().restoreSuccessMessage(note), { type: MessageBoxType.Info });
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
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');
|
const folderId = Setting.value('activeFolderId');
|
||||||
if (!folderId) {
|
if (!folderId) {
|
||||||
logger.warn('Not creating new note -- no active folder ID.');
|
logger.warn('Not creating new note -- no active folder ID.');
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export const declaration: CommandDeclaration = {
|
|||||||
|
|
||||||
export const runtime = (): CommandRuntime => {
|
export const runtime = (): CommandRuntime => {
|
||||||
return {
|
return {
|
||||||
execute: async (context: CommandContext, editorViewId:string = '', show:boolean = true) => {
|
execute: async (context: CommandContext, editorViewId = '', show = true) => {
|
||||||
logger.info('View:', editorViewId, 'Show:', show);
|
logger.info('View:', editorViewId, 'Show:', show);
|
||||||
|
|
||||||
const shownEditorViewIds = Setting.value('plugins.shownEditorViewIds');
|
const shownEditorViewIds = Setting.value('plugins.shownEditorViewIds');
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import type { WhenClauseContext } from './commands/stateToWhenClauseContext';
|
|||||||
type LabelFunction = ()=> string;
|
type LabelFunction = ()=> string;
|
||||||
type EnabledCondition = string;
|
type EnabledCondition = string;
|
||||||
|
|
||||||
export type CommandArgument = string|number|object|boolean|null;
|
|
||||||
|
|
||||||
export interface CommandContext {
|
export interface CommandContext {
|
||||||
// The state may also be of type "AppState" (used by the desktop app), which inherits from "State" (used by all apps)
|
// The state may also be of type "AppState" (used by the desktop app), which inherits from "State" (used by all apps)
|
||||||
state: State;
|
state: State;
|
||||||
@@ -19,7 +17,7 @@ export interface CommandContext {
|
|||||||
|
|
||||||
export interface CommandRuntime {
|
export interface CommandRuntime {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
// 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;
|
enabledCondition?: EnabledCondition;
|
||||||
// Used for the (optional) toolbar button title
|
// Used for the (optional) toolbar button title
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
// 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
|
// 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);
|
const command = this.commandByName(commandName);
|
||||||
// Some commands such as "showModalMessage" can be executed many
|
// Some commands such as "showModalMessage" can be executed many
|
||||||
// times per seconds, so we should only display this message in
|
// times per seconds, so we should only display this message in
|
||||||
|
|||||||
Reference in New Issue
Block a user