improve eslint config
This commit is contained in:
@@ -131,6 +131,7 @@ export class Editor extends EventEmitter {
|
||||
*
|
||||
* @param name The name of the command
|
||||
*/
|
||||
// eslint-disable-next-line
|
||||
private __get(name: string) {
|
||||
return this.commandManager.runSingleCommand(name)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
export default class EventEmitter {
|
||||
|
||||
_callbacks: { [key: string]: Function[] } = {}
|
||||
private callbacks: { [key: string]: Function[] } = {}
|
||||
|
||||
on(event: string, fn: Function) {
|
||||
if (!this._callbacks[event]) {
|
||||
this._callbacks[event] = []
|
||||
public on(event: string, fn: Function) {
|
||||
if (!this.callbacks[event]) {
|
||||
this.callbacks[event] = []
|
||||
}
|
||||
|
||||
this._callbacks[event].push(fn)
|
||||
this.callbacks[event].push(fn)
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
emit(event: string, ...args: any) {
|
||||
const callbacks = this._callbacks[event]
|
||||
protected emit(event: string, ...args: any) {
|
||||
const callbacks = this.callbacks[event]
|
||||
|
||||
if (callbacks) {
|
||||
callbacks.forEach(callback => callback.apply(this, args))
|
||||
@@ -22,21 +22,21 @@ export default class EventEmitter {
|
||||
return this
|
||||
}
|
||||
|
||||
off(event: string, fn?: Function) {
|
||||
const callbacks = this._callbacks[event]
|
||||
public off(event: string, fn?: Function) {
|
||||
const callbacks = this.callbacks[event]
|
||||
|
||||
if (callbacks) {
|
||||
if (fn) {
|
||||
this._callbacks[event] = callbacks.filter(callback => callback !== fn)
|
||||
this.callbacks[event] = callbacks.filter(callback => callback !== fn)
|
||||
} else {
|
||||
delete this._callbacks[event]
|
||||
delete this.callbacks[event]
|
||||
}
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
removeAllListeners() {
|
||||
this._callbacks = {}
|
||||
protected removeAllListeners() {
|
||||
this.callbacks = {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@ import deepmerge from 'deepmerge'
|
||||
import collect from 'collect.js'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { keymap } from 'prosemirror-keymap'
|
||||
import { Schema, Node as ProsemirrorNode } from 'prosemirror-model'
|
||||
import { Schema } from 'prosemirror-model'
|
||||
// import { Schema, Node as ProsemirrorNode } from 'prosemirror-model'
|
||||
import { inputRules } from 'prosemirror-inputrules'
|
||||
import { EditorView, Decoration } from 'prosemirror-view'
|
||||
// import { EditorView, Decoration } from 'prosemirror-view'
|
||||
|
||||
import { Editor } from './Editor'
|
||||
import capitalize from './utils/capitalize'
|
||||
// import capitalize from './utils/capitalize'
|
||||
import { Extensions } from './types'
|
||||
import getTopNodeFromExtensions from './utils/getTopNodeFromExtensions'
|
||||
import getNodesFromExtensions from './utils/getNodesFromExtensions'
|
||||
|
||||
Reference in New Issue
Block a user