diff --git a/.eslintrc.js b/.eslintrc.js index d5a7a0c3f..fca7f5719 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,5 +48,7 @@ module.exports = { 'consistent-return': 'off', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': ['error'], + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': ['error'], }, } diff --git a/docs/src/components/PageNavigation/index.vue b/docs/src/components/PageNavigation/index.vue index c83b58581..4b0760b0a 100644 --- a/docs/src/components/PageNavigation/index.vue +++ b/docs/src/components/PageNavigation/index.vue @@ -35,7 +35,7 @@ export default { computed: { items() { - return this.linkGroups.reduce((acc, group) => (acc.push(...group.items), acc), []) + return this.linkGroups.reduce((acc, group) => ((acc.push(...group.items), acc)), []) }, currentIndex() { diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 6987abcaf..926185886 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -1,6 +1,6 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state' import { EditorView } from 'prosemirror-view' -import { Schema, DOMParser, DOMSerializer } from 'prosemirror-model' +import { Schema, DOMParser } from 'prosemirror-model' import magicMethods from './utils/magicMethods' import elementFromString from './utils/elementFromString' import nodeIsActive from './utils/nodeIsActive' @@ -16,7 +16,6 @@ import EventEmitter from './EventEmitter' import Extension from './Extension' import Node from './Node' import Mark from './Mark' -import ComponentRenderer from './ComponentRenderer' import defaultPlugins from './plugins' import * as coreCommands from './commands' diff --git a/packages/core/src/commands/removeMark.ts b/packages/core/src/commands/removeMark.ts index 9950819fd..49028fdf2 100644 --- a/packages/core/src/commands/removeMark.ts +++ b/packages/core/src/commands/removeMark.ts @@ -14,9 +14,8 @@ declare module '../Editor' { export const removeMark: RemoveMarkCommand = typeOrName => ({ tr, state }) => { const { selection } = tr const type = getMarkType(typeOrName, state.schema) - let { - from, to, $from, empty, - } = selection + let { from, to } = selection + const { $from, empty } = selection if (empty) { const range = getMarkRange($from, type) diff --git a/packages/core/src/utils/magicMethods.ts b/packages/core/src/utils/magicMethods.ts index e48bf22ee..b12456c24 100644 --- a/packages/core/src/utils/magicMethods.ts +++ b/packages/core/src/utils/magicMethods.ts @@ -1,7 +1,7 @@ export default function magicMethods(Clazz: any) { const classHandler = Object.create(null) - classHandler.construct = (_, args: any) => { + classHandler.construct = (_: any, args: any) => { const instance = new Clazz(...args) const instanceHandler = Object.create(null) const get = Object.getOwnPropertyDescriptor(Clazz.prototype, '__get') diff --git a/packages/extension-bold/index.ts b/packages/extension-bold/index.ts index 31f068296..5f937e56a 100644 --- a/packages/extension-bold/index.ts +++ b/packages/extension-bold/index.ts @@ -10,8 +10,8 @@ declare module '@tiptap/core/src/Editor' { } } -export const starInputRegex = /(?:^|\s)((?:\*\*)((?:[^\*\*]+))(?:\*\*))$/gm -export const starPasteRegex = /(?:^|\s)((?:\*\*)((?:[^\*\*]+))(?:\*\*))/gm +export const starInputRegex = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm +export const starPasteRegex = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm export const underscoreInputRegex = /(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm export const underscorePasteRegex = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm diff --git a/packages/extension-italic/index.ts b/packages/extension-italic/index.ts index 11472c5b7..e60219219 100644 --- a/packages/extension-italic/index.ts +++ b/packages/extension-italic/index.ts @@ -10,8 +10,8 @@ declare module '@tiptap/core/src/Editor' { } } -export const starInputRegex = /(?:^|\s)((?:\*)((?:[^\*]+))(?:\*))$/gm -export const starPasteRegex = /(?:^|\s)((?:\*)((?:[^\*]+))(?:\*))/gm +export const starInputRegex = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm +export const starPasteRegex = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm export const underscoreInputRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm export const underscorePasteRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm diff --git a/packages/vue/src/Renderer.ts b/packages/vue/src/Renderer.ts index ad40af797..67d3e6ec5 100644 --- a/packages/vue/src/Renderer.ts +++ b/packages/vue/src/Renderer.ts @@ -7,7 +7,7 @@ export default class Renderer extends ComponentRenderer { vm!: Vue - constructor(component: Vue, options: any) { + constructor(component: Vue) { super() this.mount(component) }