codex-team / codex-team/editor.js

Fix ToolConfig type definition

Open
#1,432 0 comments 0 reactions 0 assignees View on GitHub
types
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

```
export type BlockToolData = T;
export type ToolConfig = T;
```

suggestion:
```
export type BlockToolData = T | {};
export type ToolConfig = T | {};
```

Each tools should expect empty object as config.
When developing the tools, it is difficult to expect an error by empty object.

https://github.com/codex-team/editor.js/blob/next/src/components/modules/tools.ts#L345
https://github.com/codex-team/editor.js/blob/next/src/components/block/index.ts#L220

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.