codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.4k stars 2.07k forks source link

[Bug] BlockToolData should be imported as a type #2224

Open CODE-BR3AKER opened 1 year ago

CODE-BR3AKER commented 1 year ago

Describe a bug.

Steps to reproduce: When I tried to release my app, the type check failed with following errors:

error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
1 import {BlockToolData} from '../tools';
node_modules/@editorjs/editorjs/types/configs/conversion-config.ts:1:9 - error TS1444: 'BlockToolData' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.
1 import {BlockToolData} from '../tools';
          ~~~~~~~~~~~~~
Found 2 errors in the same file, starting at: node_modules/@editorjs/editorjs/types/configs/conversion-config.ts:1
ERROR: "type-check" exited with 1.

Expected behavior:

Screenshots: https://ibb.co/6vdy38T

Device, Browser, OS: Debian linux, Vite 2.9.9

Editor.js version: 2.26.4

Plugins you use with their versions: "@editorjs/header": "^2.6.2", "@editorjs/list": "^1.7.0", "@editorjs/paragraph": "^2.8.0", "@editorjs/table": "^2.1.0", "@editorjs/underline": "^1.0.0"

CODE-BR3AKER commented 1 year ago

I opened a PR for that: https://github.com/codex-team/editor.js/pull/2225