1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-03 23:50:33 +02:00

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

This commit is contained in:
Laurent Cozic
2023-06-30 10:30:29 +01:00
parent 48ef6db4a5
commit dd6eec6a03
153 changed files with 296 additions and 9 deletions

View File

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