From e3e35f1ce83e21fb2a215c8b7259965adb10fe7c Mon Sep 17 00:00:00 2001 From: andrewdoro Date: Sat, 30 Mar 2024 13:06:08 +0200 Subject: [PATCH] fix: add modern target config --- package.json | 1 + prettier.config.js => prettier.config.cjs | 4 ++-- rollup.config.js | 1 + src/index.ts | 5 ++-- tsconfig.json | 29 +++++++++++++++-------- 5 files changed, 26 insertions(+), 14 deletions(-) rename prettier.config.js => prettier.config.cjs (80%) diff --git a/package.json b/package.json index 6d62a05..74568f3 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "module": "dist/index.js", "umd": "dist/index.umd.js", "types": "dist/index.d.ts", + "type": "module", "files": [ "dist" ], diff --git a/prettier.config.js b/prettier.config.cjs similarity index 80% rename from prettier.config.js rename to prettier.config.cjs index 862c733..e283e50 100644 --- a/prettier.config.js +++ b/prettier.config.cjs @@ -2,7 +2,7 @@ module.exports = { bracketSpacing: true, semi: true, singleQuote: true, - trailingComma: "all", + trailingComma: 'all', printWidth: 80, tabWidth: 2, -} +}; diff --git a/rollup.config.js b/rollup.config.js index a08b4c7..13f63d4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -48,6 +48,7 @@ export default { tsconfig: './tsconfig.json', tsconfigOverride: { compilerOptions: { + baseUrl: '.', declaration: true, paths: { './*': ['src/*'], diff --git a/src/index.ts b/src/index.ts index 7c92e96..b913622 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ -// @ts-ignore -import { __serializeForClipboard, EditorView } from '@tiptap/pm/view'; import { Extension } from '@tiptap/core'; import { NodeSelection, Plugin, TextSelection } from '@tiptap/pm/state'; import { Fragment, Slice, Node } from '@tiptap/pm/model'; +// @ts-ignore +import { __serializeForClipboard, EditorView } from '@tiptap/pm/view'; + export interface GlobalDragHandleOptions { /** * The width of the drag handle diff --git a/tsconfig.json b/tsconfig.json index df13b69..df79309 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,25 @@ { "compilerOptions": { - "target": "es5", - "module": "esnext", - "outDir": "./dist", - "strict": true, - "moduleResolution": "node", + /* Base Options: */ "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, + "target": "es2022", + "allowJs": true, + "moduleDetection": "force", + "isolatedModules": true, + /* Strictness */ + "strict": true, + "noUncheckedIndexedAccess": true, + /* If transpiling with TypeScript: */ + "moduleResolution": "node", + "module": "ESNext", + "outDir": "dist", + "sourceMap": true, + /* AND if you're building for a library: */ "declaration": true, - "baseUrl": "." - }, - "include": ["src"], - "exclude": ["node_modules"] + + "noEmit": true, + /* If your code runs in the DOM: */ + "lib": ["es2022", "dom", "dom.iterable"] + } }