Conversation
```javascript ```ts wrapCode const longLine = '这是一行很长的代码,当存在 wrapCode meta 属性时会自动换行显示'; ``` 这个 mdx 在编辑的本意是想使用 ```ts wrapCode const longLine = '这是一行很长的代码,当存在 wrapCode meta 属性时会自动换行显示'; ``` 但是由于 prettier 的格式化导致自动换行了,你能加入 prettier ignore 来让这一行的修改变为原本的模样吗 \`\`\`
- **中文文档** (`website/docs/zh/guide/use-mdx/code-blocks.mdx`): 第 227 行和第 236 行 - **英文文档** (`website/docs/en/guide/use-mdx/code-blocks.mdx`): 第 227 行和第 236 行
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds prettier-ignore comments to prevent Prettier from automatically formatting long code lines in the documentation examples for the wrapCode feature. The original intent was to show a single long line of code that would wrap when the wrapCode meta attribute is applied, but Prettier was automatically breaking these lines during formatting, which undermined the demonstration.
Key changes:
- Added
<!-- prettier-ignore -->comments before code block examples in both language versions - Consolidated wrapped code lines back into single long lines to properly demonstrate the
wrapCodefeature
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| website/docs/zh/guide/use-mdx/code-blocks.mdx | Added prettier-ignore comments and consolidated code examples to single lines in Chinese documentation |
| website/docs/en/guide/use-mdx/code-blocks.mdx | Added prettier-ignore comments and consolidated code examples to single lines in English documentation |
I've completed my review of this pull request. The changes are appropriate and correctly implement the intended fix. The prettier-ignore comments are properly placed to prevent automatic formatting of the example code, allowing the documentation to accurately demonstrate how the wrapCode feature works with long single lines of code. Both the Chinese and English versions have been updated consistently.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff Generated by Rsdoctor GitHub Action |
Summary
Related Issue
Checklist
AI Summary
What changed
Added
<!-- prettier-ignore -->comments to thewrapCodecode block examples in both English and Chinese documentation files (website/docs/en/guide/use-mdx/code-blocks.mdxandwebsite/docs/zh/guide/use-mdx/code-blocks.mdx).Why
The code examples demonstrating the
wrapCodemeta attribute were being automatically formatted by Prettier, which split the intentionally long single-line code into multiple lines. This defeated the purpose of the examples, which are meant to show howwrapCodehandles long lines of code that wrap within the code block.Implementation details
<!-- prettier-ignore -->comment before each of the 4 affected code blocks (2 per language file)wrapCodeattributeThis PR was written using Vibe Kanban