fix linter errors

This commit is contained in:
Philipp Kühn
2019-05-04 11:00:50 +02:00
parent 0a98827b4c
commit 3a42fe388b
3 changed files with 5 additions and 7 deletions

View File

@@ -32,8 +32,8 @@ index = $pos.index(d)
// this is a copy of splitListItem
// see https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js
export default function splitListItem(itemType) {
return function _splitListItem(state, dispatch) {
export default function splitToDefaultListItem(itemType) {
return function (state, dispatch) {
const { $from, $to, node } = state.selection
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to)) return false
const grandParent = $from.node(-1)

View File

@@ -16,9 +16,7 @@ export default class Emitter {
const callbacks = this._callbacks[event]
if (callbacks) {
for (const callback of callbacks) {
callback.apply(this, args)
}
callbacks.forEach(callback => callback.apply(this, args))
}
return this
@@ -46,7 +44,7 @@ export default class Emitter {
}
// remove specific handler
for (let i = 0; i < callbacks.length; i++) {
for (let i = 0; i < callbacks.length; i += 1) {
const callback = callbacks[i]
if (callback === fn) {
callbacks.splice(i, 1)

View File

@@ -1,3 +1,3 @@
export default function (str) {
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index == 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index === 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
}