Skip to content

feat: use worker.mts for pure ESM #496

Open
@JounQin

Description

@JounQin

Initial checklist

Problem

A lot of await import in https://github.com/mdx-js/eslint-mdx/blob/3bdd2eb88244aeda636c11f3ccaff35ae2c05ac2/packages/eslint-mdx/src/worker.ts and the hack loadEsmModule

export const loadEsmModule = <T>(modulePath: URL | string): Promise<T> =>
// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
new Function('modulePath', `return import(modulePath);`)(
modulePath,
) as Promise<T>

is unnecessary.

Solution

Just change worker.ts to pure ESM worker.mts which is just supported by synckit natively.

Alternatives

N/A

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions