diff --git a/.eslintrc.js b/.eslintrc.js index f8f8b40b..0efdd6c4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,6 +30,7 @@ module.exports = { window: false, }, extends: [ + 'plugin:@typescript-eslint/recommended', 'plugin:vue/strongly-recommended', 'airbnb-base', ], @@ -61,6 +62,13 @@ module.exports = { '@typescript-eslint/no-unused-vars': ['error'], 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': ['error'], + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/explicit-module-boundary-type': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/comma-dangle': ['error', 'always-multiline'], }, }, ], diff --git a/packages/core/src/inputRules/nodeInputRule.ts b/packages/core/src/inputRules/nodeInputRule.ts index c69cc700..c014d198 100644 --- a/packages/core/src/inputRules/nodeInputRule.ts +++ b/packages/core/src/inputRules/nodeInputRule.ts @@ -1,7 +1,7 @@ import { InputRule } from 'prosemirror-inputrules' import { NodeType } from 'prosemirror-model' -export default function (regexp: RegExp, type: NodeType, getAttrs?: Function) { +export default function (regexp: RegExp, type: NodeType, getAttrs?: (match: any) => any): InputRule { return new InputRule(regexp, (state, match, start, end) => { const attrs = getAttrs instanceof Function ? getAttrs(match) : getAttrs const { tr } = state diff --git a/packages/core/src/pasteRules/markPasteRule.ts b/packages/core/src/pasteRules/markPasteRule.ts index c10340b0..85f5a93c 100644 --- a/packages/core/src/pasteRules/markPasteRule.ts +++ b/packages/core/src/pasteRules/markPasteRule.ts @@ -1,7 +1,7 @@ import { Plugin } from 'prosemirror-state' import { Slice, Fragment, MarkType } from 'prosemirror-model' -export default function (regexp: RegExp, type: MarkType, getAttrs?: Function) { +export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) => any): Plugin { const handler = (fragment: Fragment, parent?: any) => { const nodes: any[] = [] diff --git a/packages/core/src/utils/capitalize.ts b/packages/core/src/utils/capitalize.ts index e153512d..0b9c9d48 100644 --- a/packages/core/src/utils/capitalize.ts +++ b/packages/core/src/utils/capitalize.ts @@ -1,3 +1,3 @@ -export default function capitalize(value: string = ''): string { +export default function capitalize(value = ''): string { return value.charAt(0).toUpperCase() + value.slice(1) } diff --git a/packages/core/src/utils/minMax.ts b/packages/core/src/utils/minMax.ts index c1aa6838..47a22706 100644 --- a/packages/core/src/utils/minMax.ts +++ b/packages/core/src/utils/minMax.ts @@ -1,3 +1,3 @@ -export default function minMax(value: number = 0, min: number = 0, max: number = 0): number { +export default function minMax(value = 0, min = 0, max = 0): number { return Math.min(Math.max(value, min), max) } diff --git a/packages/extension-history/index.ts b/packages/extension-history/index.ts index 67058d1d..764d6715 100644 --- a/packages/extension-history/index.ts +++ b/packages/extension-history/index.ts @@ -13,7 +13,7 @@ declare module '@tiptap/core/src/Editor' { } export interface HistoryOptions { - historyPluginOptions: Object, + historyPluginOptions: Record, } export default new Extension()