Audit TS module/target config and fix extensionless relative imports across packages
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- build-system, tooling
Research direction
Start with the listed files under packages/sdk/src/entities and packages/sdk/src/entities/EventBus/events/core, then audit each package's tsconfig for module, moduleResolution, and target settings. Check relative imports for explicit .js files or index.js paths, including type-only imports, and verify that the published SDK resolves under Node ESM without breaking the Vite playground or ts-jest consumers.
Written by the indexing model from the issue text.
Description
Problem
Several relative imports in packages/sdk (and likely elsewhere in the
monorepo) omit the .js extension or import a directory instead of its
index.js file, e.g. from '../../entities' instead of
from '../../entities/index.js'.
Since @editorjs/sdk's package.json has "type": "module", Node's ESM
resolver is strict about this: a value import through a bare directory
specifier throws ERR_UNSUPPORTED_DIR_IMPORT, and a missing extension on a
file specifier throws ERR_MODULE_NOT_FOUND. Type-only (import type)
specifiers with the same issue don't break at runtime (TS strips them
entirely), but they do break .d.ts resolution for consumers using
moduleResolution: node16/nodenext.
This doesn't surface as a failure anywhere in the repo today, since the only
consumers are Vite (packages/playground) and ts-jest (test suites) — both
resolve directories/extensions leniently, unlike raw Node ESM. But
@editorjs/sdk is published to npm, so any external consumer running it
under plain Node would hit this.
Known instances
packages/sdk/src/entities/InlineTool.tspackages/sdk/src/entities/BlockTool.tspackages/sdk/src/entities/BlockTune.tspackages/sdk/src/entities/EditorjsPlugin.tspackages/sdk/src/entities/EditorjsAdapterPlugin.tspackages/sdk/src/entities/BlockToolAdapter.tspackages/sdk/src/entities/EventBus/events/core/ToolLoadedCoreEvent.tspackages/sdk/src/entities/EventBus/events/core/SelectionChangedCoreEvent.ts
Similar patterns likely exist elsewhere in the monorepo, outside packages/sdk.
Proposed scope
- Audit
module/moduleResolution/targetin each package's tsconfig to
match how it's actually consumed (bundler vs. Node ESM). - Fix extensionless/directory relative imports repo-wide.
- Consider an ESLint rule (e.g.
import/extensions) to prevent regressions
going forward.
- Dominant language
- TypeScript
- Stars
- 12
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from editor-js/document-model
-
editor-js/document-model#176 · 1 reaction · 2 assignees ·
-
BlocksUI doesn't remove its blocksHolder DOM event listeners (or the holder itself) on destroy() Opengood first issue
Difficulty 4/5 3-5 days Newbie friendliness 58/100
editor-js/document-model#170 ·
-
Index refactoring Opengood first issue
Difficulty 5/5 Over a week Newbie friendliness 38/100
editor-js/document-model#154 ·
-
Block Tunes Open
editor-js/document-model#150 · 1 comment · 1 assignee ·
-
Paste plugin Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
editor-js/document-model#137 ·
All issues in editor-js/document-model
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·