Repository navigation
feat(cli): enable safe MDX autofix - #210
Merged
Merged
Conversation
Route .mdx fix requests to Core fixMdx(). Keep fixMarkdown() for regular Markdown. Remove the batch-wide MDX fix rejection from #208. Add tests for mixed batches and source preservation. Cover idempotence, exit codes, unchanged files, and stdin. Compile fixed MDX with @mdx-js/mdx.
State that --stdin always parses Markdown. Warn against --stdin --fix for MDX content. Narrow the MDX fix safety claim for third-party rules.
Fix .mdx from an installed tarball. Assert that ESM and JSX attributes stay unchanged. Assert that Markdown body text changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.mdxfix requests to CorefixMdx(). KeepfixMarkdown()for regular Markdown.--fixrejection from fix(cli): prevent unsafe --fix on MDX files #208. Mixed batches now run normally.changedcheck. The CLI writes only files whose fixed content differs.--stdinalways parses Markdown.--stdin --fixis not safe for MDX content.@mdx-js/mdxas a dev dependency to compile fixed MDX in tests.Behavior
Tests
.mdxand.MDXrouting.fixMarkdown()output.@mdx-js/mdx.Checks
npm run lintnpm test(259 tests passed)npm run test:package