mdx-js / eslint-mdx

ESLint Parser/Plugin for MDX
https://npmjs.org/eslint-plugin-mdx
MIT License
258 stars 29 forks source link

feat: use `worker.mts` for pure ESM #496

Open JounQin opened 6 months ago

JounQin commented 6 months ago

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

https://github.com/mdx-js/eslint-mdx/blob/3bdd2eb88244aeda636c11f3ccaff35ae2c05ac2/packages/eslint-mdx/src/helpers.ts#L60-L64

is unnecessary.

Solution

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

Alternatives

N/A