Skip to content

Add remark-mdx-remove-esm to list of plugins#2675

Open
talatkuyuk wants to merge 1 commit intomdx-js:mainfrom
talatkuyuk:main
Open

Add remark-mdx-remove-esm to list of plugins#2675
talatkuyuk wants to merge 1 commit intomdx-js:mainfrom
talatkuyuk:main

Conversation

@talatkuyuk
Copy link
Copy Markdown
Contributor

@talatkuyuk talatkuyuk commented Apr 1, 2026

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

remark-mdx-remove-esm is a remark plugin that removes import and/or export statements (mdxjsEsm) from MDX content. It provides an essential security layer for applications handling user-generated content.

It is a remark plugin to sanitize MDX content by removing ESM (import/export) statements for enhanced security.

This change adds remark-mdx-remove-esm to the plugin list in the docs.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (579f20e) to head (6e37192).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2675   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         2649      2649           
  Branches         2         2           
=========================================
  Hits          2649      2649           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@remcohaszing remcohaszing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I have some small tips, but it looks mostly good.

  • Instead of exposing the clsx utility, you could accept falsy values in MdxRemoveEsmOptions. But really I would leave this up to the user.
  • You can use the mdx language for the code fence in the readme instead of markdown.
  • In tsconfig.json you specify include as a glob ("src/**/*"). You can also specify a directory ("src"). It’s the same, but in my experience allowing glob patterns can grow and become unmanageable.
  • Your tests aren’t type checked.

@remcohaszing remcohaszing added the 📚 area/docs This affects documentation label Apr 2, 2026
@talatkuyuk
Copy link
Copy Markdown
Contributor Author

talatkuyuk commented Apr 2, 2026

Thanks @remcohaszing for the suggestions which all I agreed with. It is done, including the removal of clsx utility.

@talatkuyuk talatkuyuk requested a review from remcohaszing April 4, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 area/docs This affects documentation 🤞 phase/open Post is being triaged manually

Development

Successfully merging this pull request may close these issues.

2 participants