editor-js / inline-code

Inline-Code Tool for Editor.js 2.0
MIT License
43 stars 25 forks source link

feat(migration): migrate codebase to TypeScript #43

Closed idebenone closed 1 month ago

idebenone commented 1 month ago

Problem

The current tool, built in JavaScript, lacks type safety, making it prone to runtime errors. Using this tool with TypeScript raises error Could not find a declaration file for module '@editorjs/inline-code'

Cause

This tool was built in JavaScript to be a simplest example of Editor.js Tools API usage.

Solution

To resolve the TypeScript error, the entire codebase of this tool has been migrated from JavaScript to TypeScript. This migration involves several key steps:

Renaming JavaScript files ".js" to TypeScript ".ts". Update project configuration to support TypeScript. Refactor the code necessary to align with TypeScript's stricter type rules.

closes #42