-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: migrate site to nutui-react #2955
base: feat_v3.x
Are you sure you want to change the base?
Conversation
Walkthrough本次 PR 整体涉及对 NutUI 项目多个模块的修改。更新内容包括样式文件(SCSS)中对元素选择器、颜色变量、布局及背景等的微调;组件代码(TS/TSX)中优化路由逻辑、状态管理及导入路径;配置文件中调整构建脚本、环境变量及别名设置;文档文件中更新示例代码、API 描述和多语言支持;此外,部分冗余的文件导出被移除,以及 .gitignore 与 index.html 中的路径也进行了相应调整。 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant A as App组件
participant H as Header组件
participant N as Nav组件
participant C as Content组件
U->>A: 访问 URL
A->>H: 渲染 Header,传递当前语言状态
A->>N: 渲染 Nav,设置导航高亮
U->>C: 触发滚动或导航点击
C-->>A: 通知状态更新(例如固定标题)
N->>A: 导航项点击,更新路由
A->>C: 更新并显示对应文档内容
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #2955 +/- ##
==========================================
Coverage 85.59% 85.59%
==========================================
Files 277 277
Lines 18158 18158
Branches 2760 2760
==========================================
Hits 15543 15543
Misses 2610 2610
Partials 5 5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 31
🧹 Nitpick comments (65)
src/sites/doc/components/search/search.tsx (3)
8-8
: 建议使用具体类型替代 any建议为
searchList
定义一个具体的接口类型,避免使用any
。这样可以提高代码的类型安全性和可维护性。- const [searchList, setSearchList] = useState<any>([]) + interface NavItem { + name: string + cName: string + show: boolean + } + const [searchList, setSearchList] = useState<NavItem[]>([])
83-83
: 移除生产环境中的调试代码请移除
console.log
语句,避免在生产环境中输出调试信息。
71-71
: 建议优化国际化和路由处理
- 搜索框的占位符文本应该支持国际化,而不是硬编码的中文
- 组件路由路径应该通过配置或常量来管理,避免硬编码
+ const COMPONENT_BASE_PATH = '/zh-CN/component/'; + const PLACEHOLDER_TEXT = { + 'zh-CN': '在 NutUI 中搜索', + 'en-US': 'Search in NutUI' + }; <input type="text" className="search-input" - placeholder="在 NutUI 中搜索" + placeholder={PLACEHOLDER_TEXT[currentLocale]} value={searchVal} onChange={onChange} onFocus={onfocus} onBlur={onblur} onKeyUp={choseList} /> ... - <Link to={`/zh-CN/component/${item.name.toLowerCase()}`}> + <Link to={`${COMPONENT_BASE_PATH}${item.name.toLowerCase()}`}>Also applies to: 86-86
src/sites/doc/App.tsx (2)
113-113
: 审核useMemo
的使用以优化性能在这里使用
useMemo
并未带来明显的性能优化。loadable
本身已经处理了代码拆分和懒加载,建议移除useMemo
以简化代码。应用以下差异以改进代码:
- const C = useMemo(() => loadable(ru.component), [ru.component]) + const C = loadable(ru.component)
133-133
: 移除多余的空格以提高代码可读性
<BackTop>
组件与className
属性之间有多余的空格,建议删除多余的空格以保持代码整洁。应用以下差异以修正问题:
- <BackTop className={`${fixed ? 'doc-backtop' : ''}`} /> + <BackTop className={`${fixed ? 'doc-backtop' : ''}`} />src/sites/doc/components/header/header.tsx (6)
27-27
: 避免使用any
类型以提高类型安全性在使用
useState
时,避免使用any
类型。建议为currLang
定义明确的类型,以增强代码的类型检查和可维护性。可以定义类型接口,例如:
interface LangType { name: string locale: string }然后修改代码:
- const [currLang, setCurrLang] = useState<any>({}) + const [currLang, setCurrLang] = useState<LangType>({ name: '', locale: '' })
93-95
: 为函数参数添加类型以提高代码可维护性函数
handleMouseHover
的参数isHovered
未指定类型。建议添加类型注解,明确参数类型。应用以下差异以改进代码:
- const handleMouseHover = (isHovered) => { + const handleMouseHover = (isHovered: boolean) => {
122-124
: 为函数参数添加类型以提高代码可维护性函数
handleLanguageSelect
的参数language
未指定类型。建议添加类型注解,明确参数类型。应用以下差异以改进代码:
- const handleLanguageSelect = (language) => { + const handleLanguageSelect = (language: string) => {
126-127
: 为函数参数添加类型以提高代码可维护性函数
onMouseHover4
的参数isHovered
未指定类型。建议添加类型注解,明确参数类型。应用以下差异以改进代码:
- const onMouseHover4 = (isHovered) => { + const onMouseHover4 = (isHovered: boolean) => {
71-86
: 移除被注释的代码以保持代码清洁在第 71 行至第 86 行存在大量被注释的代码。如果这些代码不再需要,建议删除以提高代码的清洁度和可读性。
315-336
: 改进语言切换逻辑以避免页面刷新直接修改
location.href
会导致整个页面重新加载,影响用户体验。建议使用navigate
方法实现无刷新语言切换。应用以下差异以改进代码:
- <li - className="nav-item" - onClick={() => { - let location = window.location - if (currLang.locale == 'zh-CN') { - location.href = location.href.replace('zh-CN', 'en-US') - setCurrLang({ - name: 'English', - locale: 'en-US', - }) - } else { - location.href = location.href.replace('en-US', 'zh-CN') - setCurrLang({ - name: '中文', - locale: 'zh-CN', - }) - } - }} - > + <li + className="nav-item" + onClick={() => { + if (currLang.locale == 'zh-CN') { + navigate(location.pathname.replace('zh-CN', 'en-US')) + setCurrLang({ + name: 'English', + locale: 'en-US', + }) + } else { + navigate(location.pathname.replace('en-US', 'zh-CN')) + setCurrLang({ + name: '中文', + locale: 'zh-CN', + }) + } + }} + >src/sites/config/env.ts (1)
15-16
: 移除多余的分号以保持代码风格一致在对象属性后添加了分号,可能与项目的代码风格不一致。建议根据项目的 ESLint 或 Prettier 配置,保持属性后不加分号的风格。
应用以下差异以改进代码:
const config: EnvConfig = { baseUrl: '', - isPrd: true; // 是否为线上 + isPrd: true // 是否为线上 };src/sites/doc/components/demoblock/codeblock.tsx (1)
15-15
: 未使用的变量
path
变量已构造但未在代码中使用,建议移除未使用的变量或说明其用途。src/sites/doc/components/issue/issue.tsx (1)
3-3
: 未使用的图标导入导入了
Plus
图标但未在代码中使用,建议移除未使用的导入。src/sites/doc/router.ts (1)
50-86
: 建议重构重复的路由处理逻辑当前代码中存在多个相似的路由处理逻辑块,建议提取共同逻辑到一个可复用的函数中。
示例重构方案:
+ const processRoutes = ( + globPattern: string, + routeArray: any[], + pathPrefix: string, + nameRegex: RegExp, + nameModifier: (name: string) => string = (name) => name + ) => { + const modules = import.meta.glob(globPattern); + for (const path in modules) { + let name = (nameRegex.exec(path) as any[])[1]; + routeArray.push({ + path: pathPrefix + nameModifier(name), + component: modules[path], + name: nameModifier(name) + }); + } + }; - const modulesDocs = import.meta.glob('/src/sites/doc/docs/react/*.md'); - for (const path in modulesDocs) { - let name = (/docs\/react\/(.*).md/.exec(path) as any[])[1]; - guideRoutes.push({ - path: `/zh-CN/guide/${name}`, - component: modulesDocs[path], - name - }); - } + processRoutes( + '/src/sites/doc/docs/react/*.md', + guideRoutes, + '/zh-CN/guide/', + /docs\/react\/(.*).md/ + ); // 对其他路由处理块进行类似重构src/sites/doc/components/nav/nav.tsx (2)
54-66
: 移除不必要的 Fragment当只有一个子元素时,使用 Fragment 是多余的。
建议简化代码:
-{_package.show && ( - <> - {_package.isLink ? ( - <a href={_package.name} target="_blank"> - {isZh ? _package.cName : _package.eName} - </a> - ) : ( - <div onClick={() => changeNav(_package)}> - {isZh ? _package.cName : _package.eName} - </div> - )} - </> -)} +{_package.show && ( + _package.isLink ? ( + <a href={_package.name} target="_blank"> + {isZh ? _package.cName : _package.eName} + </a> + ) : ( + <div onClick={() => changeNav(_package)}> + {isZh ? _package.cName : _package.eName} + </div> + ) +)}🧰 Tools
🪛 Biome (1.9.4)
[error] 55-65: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
95-104
: 将内联样式移至 CSS 文件大量使用内联样式会降低代码的可维护性和复用性。
建议将样式移至
nav.scss
文件:-<b - style={{ - background: 'rgb(250, 205, 205)', - padding: '0px 5px', - borderRadius: '5px', - color: 'rgb(255, 255, 255)', - transform: 'scale(0.8)', - height: '20px', - lineHeight: '20px', - display: 'inline-block', - }} +<b className="version-indicator"在
nav.scss
中添加:.version-indicator { background: rgb(250, 205, 205); padding: 0 5px; border-radius: 5px; color: rgb(255, 255, 255); transform: scale(0.8); height: 20px; line-height: 20px; display: inline-block; }src/sites/config/index.ts (1)
35-46
: 删除注释掉的代码保留注释掉的代码会增加维护负担,如果这些代码不再需要,应该将其删除。如果这是临时注释,建议使用版本控制系统来追踪历史变更。
src/sites/config/baseConfig.ts (1)
1-2
: 添加英文注释以提高国际化友好性为了便于国际开发者理解,建议添加英文注释。
-// 抽象配置中心 +// Abstract Configuration Center +// 抽象配置中心src/sites/doc/docs/react/international-react.md (1)
26-26
: 改进标题格式标题中不应包含标点符号。
-## 目前支持的语言: +## 目前支持的语言🧰 Tools
🪛 Markdownlint (0.37.0)
26-26: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/international-react.md (2)
26-26
: 建议修改标题格式建议移除标题中的冒号,以保持与 Markdown 规范一致。
-## 目前支持的语言: +## 目前支持的语言🧰 Tools
🪛 Markdownlint (0.37.0)
26-26: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
35-35
: 建议明确说明泰语支持状态当前表格中泰语状态显示为"等待 PR",建议提供更具体的信息。
-| 泰语 | th-TH | 等待 PR | +| 泰语 | th-TH | 开发中 - 欢迎贡献 |src/sites/doc/docs/react/international-react.en-US.md (1)
25-25
: 建议统一标题格式建议移除标题中的冒号,以保持与其他文档的一致性。
-## Current supported languages: +## Current supported languages🧰 Tools
🪛 Markdownlint (0.37.0)
25-25: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/international-react.en-US.md (1)
42-42
: 建议改进英文表述当前的表述不够清晰和专业。
-Welcome to commit PR If you need new language pack. +We welcome Pull Requests for new language packs.src/sites/doc/components/issue/issue.scss (2)
2-4
: 建议清理注释代码建议移除未使用的注释代码,以提高代码可维护性。如果这些样式将来可能会用到,建议在代码注释中说明保留原因。
Also applies to: 10-10
29-45
: 建议优化图标实现方式当前使用背景图片实现图标可能会导致以下问题:
- 增加额外的网络请求
- 不易于主题定制
- 图标尺寸调整不够灵活
建议考虑使用图标字体或 SVG 组件。
src/sites/assets/styles/reset.scss (1)
130-131
: 建议补充溢出处理说明为了帮助其他开发者理解,建议添加注释说明为什么需要隐藏水平溢出。
#doc { + /* 防止页面内容溢出导致水平滚动 */ overflow-x: hidden; }
src/sites/doc/docs/taro/theme-react.md (1)
51-51
: 修复格式问题请将硬标签(tab)替换为空格,以保持一致的格式。
- }, + },🧰 Tools
🪛 Markdownlint (0.37.0)
51-51: Column: 1
Hard tabs(MD010, no-hard-tabs)
src/sites/doc/components/search/search.scss (2)
22-23
: 删除注释代码建议删除未使用的注释代码,保持代码整洁。
- // font-style: italic; - // opacity: 1; /* 确保不被透明度影响 */
32-32
: 优化 z-index 值
z-index: 99999
值过高,建议使用较小的值以避免与其他组件的层级冲突。- z-index: 99999; + z-index: 1000;src/sites/doc/docs/react/official-theme-react.md (1)
33-35
: 建议增强配置示例的可读性建议在配置示例中添加更多注释,说明每个主题的使用场景和特点。同时,建议说明如何验证主题是否正确加载。
src/sites/doc/components/nav/nav.scss (2)
87-87
: 建议使用变量替代硬编码的颜色值建议将颜色值
#1a1a1a
定义为变量,以保持样式的一致性和可维护性。- color: #1a1a1a; + color: $doc-text-color;
96-100
: 优化悬停效果的实现建议将重复的悬停效果合并到一个选择器中,减少代码重复。
- div { - &:hover { - color: $doc-default-color !important; - } - } + div, a { + &:hover { + color: $doc-default-color !important; + } + }src/sites/doc/docs/taro/theme-react.en-US.md (2)
22-22
: 调整标题层级文档结构中的标题层级不一致。请将h4标题改为h3以保持层级一致性。
-#### Step 1: Create a custom variable SCSS file +### Step 1: Create a custom variable SCSS file -#### Step 2: Modify the configuration file +### Step 2: Modify the configuration fileAlso applies to: 33-33
🧰 Tools
🪛 Markdownlint (0.37.0)
22-22: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time(MD001, heading-increment)
35-35
: 修复强调标记中的空格Markdown强调标记内不应该包含空格。
-Modify the ** ass-loader** configuration +Modify the **ass-loader** configuration🧰 Tools
🪛 Markdownlint (0.37.0)
35-35: null
Spaces inside emphasis markers(MD037, no-space-in-emphasis)
src/sites/doc/docs/react/theme-react.en-US.md (1)
22-22
: 调整标题层级文档结构中的标题层级不一致。请将h4标题改为h3以保持层级一致性。
-#### Step 1: Create a custom variable SCSS file +### Step 1: Create a custom variable SCSS file -#### Step 2: Modify the configuration file +### Step 2: Modify the configuration fileAlso applies to: 33-33
🧰 Tools
🪛 Markdownlint (0.37.0)
22-22: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time(MD001, heading-increment)
src/sites/doc/docs/taro/start-react.md (2)
20-20
: 统一文档标题层级文档中的标题层级不一致,需要统一调整。
-#### 1、使用命令创建 Taro 项目: +### 1、使用命令创建 Taro 项目: -#### 1、安装 NutUI React +### 1、安装 NutUI React -#### 1、检查 Taro 是否安装成功 +### 1、检查 Taro 是否安装成功Also applies to: 54-54, 154-154
🧰 Tools
🪛 Markdownlint (0.37.0)
20-20: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time(MD001, heading-increment)
82-82
: 规范化示例代码标记建议使用更标准的代码示例标记方式。
-:::demo +## 示例代码 -:::Also applies to: 106-106, 174-174, 191-191
src/sites/doc/docs/react/contributing-react.md (2)
67-71
: 代码块需要指定语言标识符为了提高代码块的可读性和语法高亮的准确性,建议为所有代码块添加语言标识符。
应用以下更改:
-``` +```bash git clone https://github.com/{github username}/nutui-react.git npm install npm run dev-
+
bash
git checkout -b username/xxxx
git checkout {现有分支名称}-``` +```bash npm run test // build 使用 node 17 版本 // 构建 @nutui/nutui-react npm run build // 构建 @nutui/nutui-react-taro npm run build:taro
Also applies to: 75-78, 84-91 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 Markdownlint (0.37.0)</summary> 67-67: null Fenced code blocks should have a language specified (MD040, fenced-code-language) </details> </details> --- `99-105`: **建议使用更安全的联系方式** 直接在文档中暴露邮箱地址可能会导致垃圾邮件问题。 建议: 1. 考虑使用联系表单 2. 或者使用反垃圾邮件处理的邮箱地址格式,例如:`nutui [at] jd [dot] com` 3. 或者使用 GitHub Discussions 进行交流 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 Markdownlint (0.37.0)</summary> 99-99: null Bare URL used (MD034, no-bare-urls) --- 105-105: null Bare URL used (MD034, no-bare-urls) </details> </details> </blockquote></details> <details> <summary>src/sites/doc/docs/taro/contributing-react.md (1)</summary><blockquote> `1-121`: **文件内容与 React 贡献指南重复** 该文件的内容与 `src/sites/doc/docs/react/contributing-react.md` 完全相同。建议考虑以下方案: 1. 如果两个框架的贡献流程确实相同,可以考虑创建一个共享的贡献指南文档,然后在各自的文档中引用它。 2. 如果有框架特定的贡献要求,建议在文档中突出这些差异。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 Markdownlint (0.37.0)</summary> 99-99: null Bare URL used (MD034, no-bare-urls) --- 105-105: null Bare URL used (MD034, no-bare-urls) --- 67-67: null Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 75-75: null Fenced code blocks should have a language specified (MD040, fenced-code-language) --- 84-84: null Fenced code blocks should have a language specified (MD040, fenced-code-language) </details> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发 Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co... (wb4) </details> </details> </blockquote></details> <details> <summary>src/sites/doc/docs/taro/start-react.en-US.md (1)</summary><blockquote> `9-16`: **代码块缺少语言标识符** 为了提高代码块的可读性和语法高亮的准确性,建议为所有代码块添加语言标识符。 应用以下更改: ```diff -```sh +```bash # pnpm pnpm install -g @tarojs/cli # npm npm install -g @tarojs/cli # yarn yarn global add @tarojs/cli
-
sh +
bashpnpm
pnpm add @tarojs/plugin-html@version
yarn
yarn add @tarojs/plugin-html@version
npm
npm i @tarojs/plugin-html@version
-```js +```javascript // config/index.js config = { compiler: { type: 'webpack5', prebundle: { exclude: ['@nutui/nutui-react-taro', '@nutui/icons-react-taro'], }, }, cache: { enable: false, }, }
Also applies to: 69-76, 170-183 </blockquote></details> <details> <summary>src/sites/doc/docs/react/start-react.md (1)</summary><blockquote> `11-18`: **代码块需要指定语言标识符** 为了提高代码块的可读性和语法高亮的准确性,建议为所有代码块添加语言标识符。 应用以下更改: ```diff -```sh +```bash # pnpm pnpm add @nutui/nutui-react # yarn yarn add @nutui/nutui-react # npm npm install @nutui/nutui-react
-
sh +
bashpnpm
pnpm add vite-plugin-imp -D
yarn
yarn add vite-plugin-imp -D
npm
npm install vite-plugin-imp -D
-```sh +```bash # pnpm pnpm add babel-plugin-import -D # yarn yarn add babel-plugin-import -D # npm npm install babel-plugin-import -D
Also applies to: 100-107, 146-153 </blockquote></details> <details> <summary>src/sites/doc/App.scss (3)</summary><blockquote> `73-78`: **修复重复的高度声明** `img` 选择器中存在重复的 `height` 属性声明。 ```diff img { height: 26px; - height: 26px; border-radius: 50%; margin-left: 8px; }
152-165
: 优化过渡动画属性建议合并过渡属性并移除被注释的代码。
&-position { top: 0px; display: flex; align-items: center; justify-content: space-between; padding: 24px 40px; - // line-height: 56px; border-bottom: 1px solid #eee; background: #fff; visibility: visible; opacity: 1; - // transition: opacity 0.8s linear, visibility 0.8s linear; - transition: opacity 0.8s; + transition: opacity 0.8s, visibility 0.8s; }
227-231
: 修复 CSS 格式问题
img
选择器的开始花括号应该与属性声明在同一行。- img { - display: block; + img { + display: block; width: 100%; height: 200px; }src/sites/assets/styles/md-style.scss (2)
128-130
: 移除注释掉的代码建议删除未使用的注释代码以提高可维护性。
- // &:first-child { - // padding-left: 0; - // }
240-244
: 移除冗余的图片样式注释建议删除未使用的注释代码。
img { max-width: 100%; - // margin: 16px 0; - // border-radius: $nutui-doc-border-radius; }src/sites/doc/docs/taro/contributing-react.en-US.md (1)
69-73
: 为代码块添加语言标识符建议为所有代码块添加适当的语言标识符以启用语法高亮。
-``` +```bash git clone https://github.com/{github username}/nutui-react.git npm install npm run dev-``` +```bash npm run test // node v17 // @nutui/nutui-react npm run build // @nutui/nutui-react-taro npm run build:taroAlso applies to: 88-95
🧰 Tools
🪛 Markdownlint (0.37.0)
69-69: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
src/sites/doc/docs/react/contributing-react.en-US.md (1)
35-35
: 修正语法错误使用正确的冠词。
-If you have a better idea of an existing component function or API, We also recommend that you use our provided [issue - helper] (https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. +If you have a better idea of an existing component function or API, We also recommend that you use our provided [issue - helper] (https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react) to submit an issue of adding new features.🧰 Tools
🪛 LanguageTool
[misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ...(EN_A_VS_AN)
🪛 Markdownlint (0.37.0)
35-35: null
Bare URL used(MD034, no-bare-urls)
src/sites/doc/docs/taro/intro-react.md (1)
27-27
: 添加 npm 徽章的替代文本为了提高可访问性,建议为 npm 版本徽章添加替代文本。
-| @nutui/nutui-react <img src="https://img.shields.io/npm/v/@nutui/nutui-react" /> | React 17\18 | 京东 [APP 10.0](/next#/resource) 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0、Android >= 6 | +| @nutui/nutui-react <img src="https://img.shields.io/npm/v/@nutui/nutui-react" alt="npm version" /> | React 17\18 | 京东 [APP 10.0](/next#/resource) 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0、Android >= 6 |🧰 Tools
🪛 Markdownlint (0.37.0)
27-27: null
Images should have alternate text (alt text)(MD045, no-alt-text)
src/sites/doc/docs/taro/intro-react.en-US.md (1)
3-3
: 改进英文表述当前英文描述有些生硬,建议优化表达:
-NutUI-React component library, based on Taro, uses React technology stack to develop applet applications, out of the box, helps R&D to quickly develop user interface, improve development efficiency, and improve development experience. +The NutUI-React component library, based on Taro, is a React-based solution for developing mini-program applications. It provides an out-of-the-box experience to help developers quickly build user interfaces while improving development efficiency and experience.🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: You might be missing the article “the” here.
Context: ... component library, based on Taro, uses React technology stack to develop applet appl...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
src/sites/doc/docs/taro/migrate-from-v2.md (2)
530-534
: 修复 Markdown 代码格式以下属性名称的代码格式存在空格问题:
-- `listType ` 重命名为 `previewType` -- `isDeletable ` 重命名为 `deletable` -- `isPreview` 重命名为 ` preview` -- `defaultImg` 重命名为 ` previewUrl` +- `listType` 重命名为 `previewType` +- `isDeletable` 重命名为 `deletable` +- `isPreview` 重命名为 `preview` +- `defaultImg` 重命名为 `previewUrl`🧰 Tools
🪛 Markdownlint (0.37.0)
530-530: null
Spaces inside code span elements(MD038, no-space-in-code)
531-531: null
Spaces inside code span elements(MD038, no-space-in-code)
532-532: null
Spaces inside code span elements(MD038, no-space-in-code)
533-533: null
Spaces inside code span elements(MD038, no-space-in-code)
534-534: null
Spaces inside code span elements(MD038, no-space-in-code)
78-78
: 修复文本格式错误该行包含了错误的反引号格式:
-- 操作反馈类,新增 `Skeleton`、`Empty`(加载结果反馈类),`Popover`、`Notify`、`NoticeBar`、`Popup` (引导提示类)6个组件;同时去除 `BackTop`(导航组件-锚点类)、`Switch`(数据录入-选择器)、`Audio``(展示-多媒体);在此基础上,未来会考虑增加 ResultPage`,整合错误状态、空状态等反馈状态,该组件在考虑中;同时考虑增加加载状态 `Loading` 组件。版本待定。 +- 操作反馈类,新增 `Skeleton`、`Empty`(加载结果反馈类),`Popover`、`Notify`、`NoticeBar`、`Popup`(引导提示类)6个组件;同时去除 `BackTop`(导航组件-锚点类)、`Switch`(数据录入-选择器)、`Audio`(展示-多媒体);在此基础上,未来会考虑增加 `ResultPage`,整合错误状态、空状态等反馈状态,该组件在考虑中;同时考虑增加加载状态 `Loading` 组件。版本待定。src/sites/doc/components/header/header.scss (3)
24-26
: 移除注释掉的代码建议移除注释掉的代码,保持代码整洁:
- // position: fixed; z-index: 9999; top: 0px;
11-11
: 统一 z-index 值
.v3-banner
和.doc-header
的 z-index 值不一致(999 vs 9999),建议统一管理 z-index 值:建议创建 z-index 变量统一管理:
$zindex-banner: 999; $zindex-header: 9999;Also applies to: 25-25
843-843
: 移除未使用的注释建议清理这些注释掉的代码:
- // display: block !important; - // &:first-child { - // border-bottom: 1px solid #5e5e5e; - // }Also applies to: 865-867
src/sites/doc/docs/react/intro-react.en-US.md (4)
1-3
: 建议扩展介绍部分的内容建议在介绍部分添加以下内容:
- 目标用户群体
- 主要应用场景
- 技术特点
7-16
: 建议补充功能描述的细节以下功能点建议添加更详细的说明:
- "支持按需引用":建议说明具体的引用方式
- "支持自定义主题":可以添加简短的示例或链接
- "单元测试覆盖率超过80%":建议提供具体的测试报告链接
28-30
: 建议优化兼容性说明建议将 polyfill 相关的信息整理成更结构化的格式:
- 使用列表形式列出所需的 polyfill
- 添加具体的配置示例
- 提供更详细的浏览器兼容性说明
42-42
: 建议更新许可证链接建议将维基百科的链接替换为项目仓库中实际的 LICENSE 文件链接。
- [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) + [MIT](../LICENSE)src/sites/doc/docs/taro/migrate-from-v1.md (4)
23-23
: 建议补充 codemod 工具的使用说明为了帮助开发者更好地使用
@nutui/nutui-react-codemod
工具,建议添加以下内容:
- 工具的安装命令
- 具体的使用步骤和示例
- 支持的转换规则列表
- 常见问题解答
131-148
: 建议优化属性定义章节的结构当前的属性定义说明较为密集,建议:
- 使用表格形式展示属性命名变更示例
- 为每个命名规范添加明确的代码示例
- 将相似的变更规则分组展示
530-534
: 修复代码标记格式问题以下代码标记中存在多余的空格,需要移除:
listType
->listType
isDeletable
->isDeletable
isPreview
->isPreview
defaultImg
->defaultImg
defaultFileList
->defaultFileList
🧰 Tools
🪛 Markdownlint (0.37.0)
530-530: null
Spaces inside code span elements(MD038, no-space-in-code)
531-531: null
Spaces inside code span elements(MD038, no-space-in-code)
532-532: null
Spaces inside code span elements(MD038, no-space-in-code)
533-533: null
Spaces inside code span elements(MD038, no-space-in-code)
534-534: null
Spaces inside code span elements(MD038, no-space-in-code)
1-888
: 建议优化文档的整体结构为提升文档的可读性和实用性,建议:
- 在文档开头添加目录导航
- 为每个主要部分添加锚点链接
- 在重要的更改处添加升级示例
- 添加常见问题(FAQ)章节
🧰 Tools
🪛 Markdownlint (0.37.0)
530-530: null
Spaces inside code span elements(MD038, no-space-in-code)
531-531: null
Spaces inside code span elements(MD038, no-space-in-code)
532-532: null
Spaces inside code span elements(MD038, no-space-in-code)
533-533: null
Spaces inside code span elements(MD038, no-space-in-code)
534-534: null
Spaces inside code span elements(MD038, no-space-in-code)
804-804: null
Spaces inside code span elements(MD038, no-space-in-code)
🪛 LanguageTool
[uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。
Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon...(wb2)
[uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名
Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路...(wb4)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/sites/assets/images/icon-add.svg
is excluded by!**/*.svg
📒 Files selected for processing (50)
src/sites/assets/styles/highlight.scss
(1 hunks)src/sites/assets/styles/md-style.scss
(10 hunks)src/sites/assets/styles/reset.scss
(3 hunks)src/sites/assets/styles/variables.scss
(3 hunks)src/sites/assets/util/index.ts
(1 hunks)src/sites/config/baseConfig.ts
(1 hunks)src/sites/config/env.ts
(2 hunks)src/sites/config/index.ts
(1 hunks)src/sites/doc/App.scss
(4 hunks)src/sites/doc/App.tsx
(1 hunks)src/sites/doc/components/demoblock/codeblock.tsx
(2 hunks)src/sites/doc/components/demoblock/demoblock.tsx
(1 hunks)src/sites/doc/components/header/header.scss
(15 hunks)src/sites/doc/components/header/header.tsx
(2 hunks)src/sites/doc/components/issue/issue.scss
(2 hunks)src/sites/doc/components/issue/issue.tsx
(2 hunks)src/sites/doc/components/nav/nav.scss
(5 hunks)src/sites/doc/components/nav/nav.tsx
(2 hunks)src/sites/doc/components/search/search.scss
(1 hunks)src/sites/doc/components/search/search.tsx
(1 hunks)src/sites/doc/docs/react/contributing-react.en-US.md
(1 hunks)src/sites/doc/docs/react/contributing-react.md
(1 hunks)src/sites/doc/docs/react/international-react.en-US.md
(1 hunks)src/sites/doc/docs/react/international-react.md
(1 hunks)src/sites/doc/docs/react/intro-react.en-US.md
(1 hunks)src/sites/doc/docs/react/intro-react.md
(1 hunks)src/sites/doc/docs/react/migrate-from-v1.en-US.md
(1 hunks)src/sites/doc/docs/react/migrate-from-v2.en-US.md
(1 hunks)src/sites/doc/docs/react/official-theme-react.en-US.md
(1 hunks)src/sites/doc/docs/react/official-theme-react.md
(1 hunks)src/sites/doc/docs/react/start-react.en-US.md
(1 hunks)src/sites/doc/docs/react/start-react.md
(1 hunks)src/sites/doc/docs/react/theme-react.en-US.md
(1 hunks)src/sites/doc/docs/react/theme-react.md
(1 hunks)src/sites/doc/docs/taro/contributing-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/contributing-react.md
(1 hunks)src/sites/doc/docs/taro/international-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/international-react.md
(1 hunks)src/sites/doc/docs/taro/intro-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/intro-react.md
(1 hunks)src/sites/doc/docs/taro/migrate-from-v1.md
(1 hunks)src/sites/doc/docs/taro/migrate-from-v2.md
(1 hunks)src/sites/doc/docs/taro/official-theme-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/official-theme-react.md
(1 hunks)src/sites/doc/docs/taro/start-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/start-react.md
(1 hunks)src/sites/doc/docs/taro/theme-react.en-US.md
(1 hunks)src/sites/doc/docs/taro/theme-react.md
(1 hunks)src/sites/doc/main.tsx
(1 hunks)src/sites/doc/router.ts
(2 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/sites/doc/components/demoblock/demoblock.tsx
- src/sites/doc/main.tsx
🧰 Additional context used
🪛 LanguageTool
src/sites/doc/docs/react/contributing-react.md
[uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发
Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co...
(wb4)
src/sites/doc/docs/taro/contributing-react.md
[uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发
Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co...
(wb4)
src/sites/doc/docs/react/international-react.en-US.md
[uncategorized] ~3-~3: This verb does not appear to agree with the subject. Consider using a different form.
Context: # Internationalization NutUI-React support multiple languages. NutUI uses Chinese ...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
src/sites/doc/docs/react/migrate-from-v2.en-US.md
[inconsistency] ~77-~77: Do you want to remove this advertisement?
Context: ... light operation of paging on mobile). Translated with DeepL.com (free version)
(DEEPL_AD)
src/sites/doc/docs/react/migrate-from-v1.en-US.md
[inconsistency] ~72-~72: Do you want to remove this advertisement?
Context: ...at Menu
is mainly used as a filter); Translated with DeepL.com (free version)
(DEEPL_AD)
src/sites/doc/docs/taro/migrate-from-v2.md
[uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。
Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon...
(wb2)
[uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名
Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路...
(wb4)
src/sites/doc/docs/react/contributing-react.en-US.md
[style] ~10-~10: Consider a shorter alternative to avoid wordiness.
Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c...
(IN_ORDER_TO_PREMIUM)
[formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...elopment information as much as possible, because the more comprehensive the information,...
(COMMA_BEFORE_BECAUSE)
[misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ...
(EN_A_VS_AN)
[uncategorized] ~59-~59: Possible missing preposition found.
Context: ...problem has been solved, and associated the corresponding issue link on github ## ...
(AI_HYDRA_LEO_MISSING_TO)
src/sites/doc/docs/taro/contributing-react.en-US.md
[style] ~10-~10: Consider a shorter alternative to avoid wordiness.
Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c...
(IN_ORDER_TO_PREMIUM)
[formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...elopment information as much as possible, because the more comprehensive the information,...
(COMMA_BEFORE_BECAUSE)
[misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ...
(EN_A_VS_AN)
[uncategorized] ~59-~59: Possible missing preposition found.
Context: ...problem has been solved, and associated the corresponding issue link on github ## ...
(AI_HYDRA_LEO_MISSING_TO)
src/sites/doc/docs/taro/migrate-from-v1.md
[uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。
Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon...
(wb2)
[uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名
Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路...
(wb4)
src/sites/doc/docs/taro/intro-react.en-US.md
[uncategorized] ~3-~3: You might be missing the article “the” here.
Context: ... component library, based on Taro, uses React technology stack to develop applet appl...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🪛 Markdownlint (0.37.0)
src/sites/doc/docs/react/contributing-react.md
99-99: null
Bare URL used
(MD034, no-bare-urls)
105-105: null
Bare URL used
(MD034, no-bare-urls)
67-67: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
75-75: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
84-84: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
src/sites/doc/docs/taro/contributing-react.md
99-99: null
Bare URL used
(MD034, no-bare-urls)
105-105: null
Bare URL used
(MD034, no-bare-urls)
67-67: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
75-75: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
84-84: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
src/sites/doc/docs/taro/international-react.en-US.md
25-25: Punctuation: ':'
Trailing punctuation in heading
(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/official-theme-react.en-US.md
7-7: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
12-12: null
Spaces inside code span elements
(MD038, no-space-in-code)
src/sites/doc/docs/react/international-react.en-US.md
25-25: Punctuation: ':'
Trailing punctuation in heading
(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/official-theme-react.md
7-7: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
src/sites/doc/docs/react/official-theme-react.en-US.md
7-7: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
12-12: null
Spaces inside code span elements
(MD038, no-space-in-code)
src/sites/doc/docs/taro/international-react.md
26-26: Punctuation: ':'
Trailing punctuation in heading
(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/theme-react.md
51-51: Column: 1
Hard tabs
(MD010, no-hard-tabs)
13-13: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/taro/start-react.en-US.md
20-20: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
54-54: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
148-148: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
20-20: Punctuation: ':'
Trailing punctuation in heading
(MD026, no-trailing-punctuation)
src/sites/doc/docs/taro/start-react.md
20-20: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
54-54: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
154-154: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
src/sites/doc/docs/react/official-theme-react.md
7-7: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
src/sites/doc/docs/react/start-react.en-US.md
9-9: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
73-73: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
184-184: null
Bare URL used
(MD034, no-bare-urls)
src/sites/doc/docs/taro/theme-react.en-US.md
22-22: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
56-56: Column: 1
Hard tabs
(MD010, no-hard-tabs)
12-12: null
Bare URL used
(MD034, no-bare-urls)
18-18: null
Bare URL used
(MD034, no-bare-urls)
35-35: null
Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
15-15: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/react/start-react.md
9-9: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
73-73: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
src/sites/doc/docs/react/theme-react.en-US.md
22-22: Expected: h3; Actual: h4
Heading levels should only increment by one level at a time
(MD001, heading-increment)
12-12: null
Bare URL used
(MD034, no-bare-urls)
18-18: null
Bare URL used
(MD034, no-bare-urls)
35-35: null
Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
15-15: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/taro/migrate-from-v2.md
530-530: null
Spaces inside code span elements
(MD038, no-space-in-code)
531-531: null
Spaces inside code span elements
(MD038, no-space-in-code)
532-532: null
Spaces inside code span elements
(MD038, no-space-in-code)
533-533: null
Spaces inside code span elements
(MD038, no-space-in-code)
534-534: null
Spaces inside code span elements
(MD038, no-space-in-code)
804-804: null
Spaces inside code span elements
(MD038, no-space-in-code)
src/sites/doc/docs/react/contributing-react.en-US.md
19-19: null
Bare URL used
(MD034, no-bare-urls)
23-23: null
Bare URL used
(MD034, no-bare-urls)
27-27: null
Bare URL used
(MD034, no-bare-urls)
31-31: null
Bare URL used
(MD034, no-bare-urls)
31-31: null
Bare URL used
(MD034, no-bare-urls)
35-35: null
Bare URL used
(MD034, no-bare-urls)
39-39: null
Bare URL used
(MD034, no-bare-urls)
107-107: null
Bare URL used
(MD034, no-bare-urls)
113-113: null
Bare URL used
(MD034, no-bare-urls)
69-69: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
79-79: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
90-90: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
src/sites/doc/docs/react/intro-react.md
26-26: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
26-26: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/taro/contributing-react.en-US.md
19-19: null
Bare URL used
(MD034, no-bare-urls)
23-23: null
Bare URL used
(MD034, no-bare-urls)
27-27: null
Bare URL used
(MD034, no-bare-urls)
31-31: null
Bare URL used
(MD034, no-bare-urls)
31-31: null
Bare URL used
(MD034, no-bare-urls)
35-35: null
Bare URL used
(MD034, no-bare-urls)
39-39: null
Bare URL used
(MD034, no-bare-urls)
105-105: null
Bare URL used
(MD034, no-bare-urls)
111-111: null
Bare URL used
(MD034, no-bare-urls)
69-69: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
77-77: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
88-88: null
Fenced code blocks should have a language specified
(MD040, fenced-code-language)
src/sites/doc/docs/react/international-react.md
26-26: Punctuation: ':'
Trailing punctuation in heading
(MD026, no-trailing-punctuation)
src/sites/doc/docs/react/theme-react.md
15-15: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/taro/migrate-from-v1.md
530-530: null
Spaces inside code span elements
(MD038, no-space-in-code)
531-531: null
Spaces inside code span elements
(MD038, no-space-in-code)
532-532: null
Spaces inside code span elements
(MD038, no-space-in-code)
533-533: null
Spaces inside code span elements
(MD038, no-space-in-code)
534-534: null
Spaces inside code span elements
(MD038, no-space-in-code)
804-804: null
Spaces inside code span elements
(MD038, no-space-in-code)
src/sites/doc/docs/react/intro-react.en-US.md
26-26: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
26-26: null
Link fragments should be valid
(MD051, link-fragments)
src/sites/doc/docs/taro/intro-react.en-US.md
27-27: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
src/sites/doc/docs/taro/intro-react.md
27-27: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
🪛 Biome (1.9.4)
src/sites/doc/components/search/search.tsx
[error] 32-34: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/sites/doc/components/nav/nav.tsx
[error] 55-65: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🔇 Additional comments (13)
src/sites/doc/components/search/search.tsx (1)
12-18
: 需要实现或移除空的事件处理函数
onfocus
和onblur
事件处理函数目前是空的。如果这些事件处理不是必需的,建议移除相关代码以减少不必要的复杂性。src/sites/assets/util/index.ts (1)
8-8
: 组件名称处理逻辑更新已确认此更改通过移除 '-taro' 后缀来统一处理常规组件和 Taro 组件的路由,保持了组件名称的一致性。
src/sites/doc/components/demoblock/codeblock.tsx (1)
7-7
: 示例文件导入路径优化通过更新 glob 模式以包含所有子目录,提高了示例文件组织的灵活性。
src/sites/doc/components/issue/issue.tsx (1)
23-23
: 图标样式更新已确认为 Add 图标添加 className 以保持样式一致性的修改是合适的。
src/sites/doc/router.ts (2)
6-9
: 路由数组声明已确认新增的路由数组合理地分类了不同类型的指南文档。
87-87
: 导出语句更新已确认更新后的导出语句正确包含了所有新增的路由数组。
src/sites/doc/docs/taro/international-react.en-US.md (1)
3-3
: 需要修正语法错误英文句子中存在主谓一致性问题。
-NutUI-React support multiple languages. +NutUI-React supports multiple languages.src/sites/assets/styles/highlight.scss (1)
17-19
: 代码结构优化良好!选择器的重构提高了代码的可维护性,同时保持了相同的样式效果。
src/sites/assets/styles/reset.scss (2)
57-62
: 字体声明格式优化字体堆栈的多行格式提高了可读性,便于维护。
102-104
: 请确认隐藏滚动条的必要性全局隐藏滚动条可能会影响用户体验,特别是在需要显示滚动位置的场景。
建议:
- 考虑仅在特定组件中应用此样式
- 为触摸设备提供滚动反馈
src/sites/doc/docs/react/theme-react.md (2)
59-60
: 完善 sass-loader 配置说明建议:
- 添加具体的版本对应关系说明
- 验证示例中的路径是否正确
✅ Verification successful
建议完善 sass-loader 配置说明
建议在文档中补充以下具体的版本对应关系:
- sass-loader v7: 使用
data
选项- sass-loader v8+: 使用
prependData
选项- sass-loader v10+: 使用
additionalData
选项示例中的路径
"./assets/custom_theme.scss"
和"@nutui/nutui/dist/styles/variables.scss"
均已验证正确。🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # 检查项目中实际使用的 sass-loader 配置 rg -A 5 "sass-loader" "webpack|vite\.config"Length of output: 105
Script:
#!/bin/bash # Search for sass-loader mentions in all files rg -i "sass-loader" -A 5 # Find any webpack or vite config files fd -e js -e ts "webpack|vite" # Search specifically in docs directory for configuration examples rg -i "sass-loader|scss" src/sites/doc/docs/Length of output: 22194
15-15
: 修复无效的链接片段链接
#/zh-CN/component/configprovider
需要验证正确的路径。✅ Verification successful
链接格式验证完成
经过验证,
#/zh-CN/component/configprovider
是正确的客户端路由格式,在多个文档文件中都有使用这个相同的链接格式。该链接没有问题,可以保持现状。🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # 验证 ConfigProvider 组件文档位置 fd -t f "configprovider" src/sites/doc/Length of output: 39
Script:
#!/bin/bash # Search for ConfigProvider related files with various cases fd -t f -i "configprovider|配置器" src/sites/doc/ # Search for files containing ConfigProvider rg -i "ConfigProvider" src/sites/doc/ --type md # Search specifically in the component documentation directory fd -t f . src/sites/doc/docs/react/components/Length of output: 3407
Script:
#!/bin/bash # Search for possible component documentation directories fd -t d "components?" src/sites/doc/ # Check if there's a dedicated ConfigProvider documentation file fd -t f -i "config-?provider" src/sites/doc/ # Look for documentation structure/index files fd -t f "index" src/sites/doc/docs/react/Length of output: 153
🧰 Tools
🪛 Markdownlint (0.37.0)
15-15: null
Link fragments should be valid(MD051, link-fragments)
src/sites/assets/styles/variables.scss (1)
Line range hint
2-120
: 样式变量定义清晰合理变量命名规范统一,颜色主题分类明确,代码结构组织良好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1、关注下 路径,不要发生变化;
2、关注下 doc 与 demo 的联动;
3、关注下 多语言 联动,H5 和 小程序保持一致;
4、关注下 主题色,使用 default 里的 主题色值;
5、可以考虑下,在 组件首页,增加 Dongdesign 组件概览的页面~
@@ -1,5 +1,8 @@ | |||
// doc | |||
$doc-default-color: #ff0f23; | |||
$doc-default-color: #fa2c19 !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
关于主题色值,建议使用 default 文件夹下的。
@@ -5,7 +5,7 @@ const isMobile = /ios|iphone|ipod|ipad|android/.test(ua) | |||
|
|||
const getComponentName = () => { | |||
const s = window.location.hash.split('/') | |||
const cname = s[s.length - 1].toLowerCase() | |||
const cname = s[s.length - 1].toLowerCase().replace('-taro', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个逻辑与现有逻辑不一致~ 修改的根目录,从h5改为 taro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 18
🧹 Nitpick comments (90)
src/sites/sites-react/doc/docs/react/official-theme-react.en-US.md (4)
1-6
: 建议优化标题和子标题的语言表达
目前标题“Official theme”和子标题“introduce”中,“introduce”建议修改为“Introduction”,以符合英语书写习惯并提升文档的专业性。
7-13
: 发现表格中的多余空格
在表格中 “Jingdong B Mall Theme” 对应的 SCSS 文件名 "variables-jdb.scss
" 后存在额外的空格,为保持一致性建议去除。
22-42
: Vite 配置示例编写正确
示例中对sass-loader
配置选项的说明较为准确,展示了如何通过additionalData
选项引入默认主题变量。建议可以附加说明当前使用的sass-loader
版本,便于用户了解不同版本选项名称的差异。
44-65
: Webpack 配置示例正确且信息详实
示例清楚展示了配置sass-loader
以导入默认主题,同时指出了不同版本中选项名称可能发生的变化。建议补充使用推荐的sass-loader
版本信息,以进一步帮助用户参考最新的配置要求。src/sites/sites-react/doc/docs/taro/official-theme-react.en-US.md (4)
7-7
: 标题级别应逐级递增
当前第 7 行使用了 "####",而前面的标题级别为 "##"。建议将此处 "####" 修改为 "###",以符合 markdownlint 关于标题递增的规则。🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
7-7: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4(MD001, heading-increment)
12-12
: 删除代码块中的多余空格
第 12 行中的内联代码variables-jdb.scss
包含不必要的尾随空格,容易导致样式导入错误或混淆。建议去除尾随空格,修改为variables-jdb.scss
。[nhitpick]
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
12-12: Spaces inside code span elements
null(MD038, no-space-in-code)
63-63
: 修正代码块结束标记
第 63 行代码块结束标记不正确,“javascript}” 包含了多余的字符。应将其修正为仅包含 “
”,以符合标准 Markdown 语法。
3-3
: 改进标题内容的表达
“## introduce” 作为标题时建议语义更明确,考虑将其修改为 “## Introduction” 以提升专业度和可读性。vite.config.site.ts (2)
16-16
: 随机版本标识可能导致缓存困难。
Math.random()
生成的随机字符串会破坏浏览器缓存的稳定性,并可能引起构建结果无法复用。若需要持续性版本号或可重复构建,建议改用基于环境变量或 Git 提交哈希来生成版本号。
103-103
: 示例注释可视需求删除或完善。此处是示例注释,若后续无实际用途,可移除以保持配置文件洁净;若要留下,也可补充更清晰的说明。
src/sites/sites-react/doc/components/demoblock/codeblock.tsx (1)
15-15
: 新定义的path
变量提醒注意文件关联。
const path = \
${ctx.path}/doc.md`` 仅声明并未使用到,若后续需要调配 MD 文档或动态加载请确保正确引用,否则可能混淆他人阅读。src/sites/sites-react/doc/components/issue/issue.tsx (1)
3-3
: 移除未使用的导入
Plus
图标已导入但未在组件中使用,建议移除以保持代码整洁。-import { Tips, Check, Add, Plus } from '@nutui/icons-react' +import { Tips, Check, Add } from '@nutui/icons-react'src/sites/sites-react/doc/components/search/search.tsx (2)
12-18
: 实现空的事件处理函数
onfocus
和onblur
事件处理函数目前为空。如果不需要这些处理函数,建议移除相关代码。
32-42
: 优化条件链式调用建议使用可选链操作符来简化条件判断,提高代码可读性和安全性。
- const cName = searchList[index] && searchList[index].name; + const cName = searchList[index]?.name;🧰 Tools
🪛 Biome (1.9.4)
[error] 32-34: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/sites/sites-react/doc/router.ts (1)
1-4
: 清理注释掉的代码建议移除已注释的代码块,保持代码库的整洁性。如果这些代码对于未来有参考价值,建议将其记录在文档中。
Also applies to: 19-22
src/sites/sites-react/doc/components/nav/nav.tsx (2)
94-108
: 将内联样式移至 CSS 文件建议将版本标记的内联样式移至 CSS 文件中,以提高代码的可维护性和复用性。
- <b - style={{ - background: 'rgb(250, 205, 205)', - padding: '0px 5px', - borderRadius: '5px', - color: 'rgb(255, 255, 255)', - transform: 'scale(0.8)', - height: '20px', - lineHeight: '20px', - display: 'inline-block', - }} - > + <b className="version-badge">在 nav.scss 中添加:
.version-badge { background: rgb(250, 205, 205); padding: 0 5px; border-radius: 5px; color: rgb(255, 255, 255); transform: scale(0.8); height: 20px; line-height: 20px; display: inline-block; }
55-65
: 简化 Fragment 使用当 Fragment 中只包含一个子元素时,可以移除不必要的 Fragment。
- <> {_package.isLink ? ( <a href={_package.name} target="_blank"> {isZh ? _package.cName : _package.eName} </a> ) : ( <div onClick={() => changeNav(_package)}> {isZh ? _package.cName : _package.eName} </div> )} - </>🧰 Tools
🪛 Biome (1.9.4)
[error] 55-65: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
vite.config.demo.ts (1)
98-105
: 建议更新浏览器兼容性配置当前的浏览器兼容性配置可能过于保守,建议根据项目需求更新。
overrideBrowserslist: [ - '> 0.5%', - 'last 2 versions', - 'ie > 11', - 'iOS >= 10', - 'Android >= 5', + 'last 3 versions', + 'iOS >= 12', + 'Android >= 7', + 'not dead' ],src/sites/sites-react/doc/App.tsx (1)
114-114
: 优化组件加载性能使用 useMemo 缓存动态加载的组件是个好做法,但建议添加错误边界来处理加载失败的情况。
-const C = useMemo(() => loadable(ru.component), [ru.component]) +const C = useMemo(() => loadable(ru.component, { + fallback: <LoadingSpinner />, + onError: (error) => { + console.error('Component loading failed:', error) + return <ErrorBoundary error={error} /> + } +}), [ru.component])src/sites/sites-react/doc/docs.taro.ts (1)
1-361
: 建议优化文档导入方式以提高性能。当前实现方式会导入所有语言的文档,建议考虑按需导入以减小打包体积。可以使用动态导入(dynamic import)来实现懒加载。
示例实现:
-import ButtonzhTW from '@/packages/button/doc.zh-TW.md?raw'; -import Buttontaro from '@/packages/button/doc.taro.md?raw'; +const loadButtonDocs = (locale: string) => { + switch(locale) { + case 'zh-TW': + return import('@/packages/button/doc.zh-TW.md?raw'); + case 'taro': + return import('@/packages/button/doc.taro.md?raw'); + // ... other cases + } +};src/sites/sites-react/doc/docs/react/international-react.md (1)
1-44
: 文档结构清晰,内容完整。文档包含了必要的国际化使用说明,示例代码清晰,支持的语言列表完整。
建议补充语言包的具体使用场景。
建议添加更多实际使用场景的示例,比如动态切换语言、自定义语言包等。
示例内容:
### 动态切换语言 ```jsx const [locale, setLocale] = useState(zhCN); const changeLang = () => { setLocale(locale.lang === 'zh-CN' ? enUS : zhCN); }; return ( <ConfigProvider locale={locale}> <Button onClick={changeLang}>切换语言</Button> <App /> </ConfigProvider> );</blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/international-react.md (1)</summary><blockquote> `1-44`: **文档内容与 React 版本保持一致,便于维护。** Taro 版本的国际化文档结构清晰,与 React 版本保持一致,便于用户理解和使用。 **建议补充 Taro 环境下的特殊使用说明。** 建议添加在 Taro 环境下可能遇到的特殊情况说明,如小程序环境的限制等。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/international-react.en-US.md (1)</summary><blockquote> `1-43`: **英文文档翻译准确,结构完整。** 英文版本的国际化文档翻译准确,保持了与中文版本相同的结构和示例。 **建议统一文档中的技术术语。** 建议在文档中统一使用技术术语的翻译,并考虑添加术语表。例如: - language pack / locale - internationalization / i18n </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/international-react.en-US.md (1)</summary><blockquote> `38-42`: **常见问题说明简洁有效。** 此部分告知用户若缺少语言包可提交 PR,内容简明扼要。可考虑增加指向更多帮助信息的链接以便快速定位。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/components/issue/issue.scss (2)</summary><blockquote> `2-4`: **关于注释的定位样式。** 注释掉的绝对定位及背景颜色设置如果确认不再使用,建议直接删除这些代码,以保持样式文件的整洁。 Also applies to: 10-10 --- `15-21`: **检查重复的样式定义。** 在 `.issue-item` 内部,多次出现 `display: flex;` 和 `align-items: center;`,建议合并重复声明,从而提高代码的可维护性。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/theme-react.md (2)</summary><blockquote> `17-27`: **方式二第一步说明详尽。** 讲解了如何新建自定义 SCSS 文件 `custom_theme.scss` 来覆盖默认变量,示例代码清晰,若能补充完整代码示例将更有助于理解。 --- `29-52`: **方式二第二步配置说明准确。** 示例代码展示了在 Taro 项目中通过修改 webpack 或 vite 配置全局覆盖 SCSS 文件的方法。 特别建议: - 检查文档中 [ConfigProvider 组件] 的链接是否指向正确资源; - 行 50 出现硬制表符,建议替换为标准空格以符合 markdownlint 要求。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 51-51: Hard tabs Column: 1 (MD010, no-hard-tabs) </details> </details> </blockquote></details> <details> <summary>src/sites/sites-react/doc/components/search/search.scss (1)</summary><blockquote> `6-19`: **搜索输入框样式可进一步优化。** 在 `.search-input` 内部,第 9 行和第 14 行均定义了 `font-size: 14px`,建议合并为单一声明,避免冗余。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/theme-react.md (2)</summary><blockquote> `1-9`: **主题定制文档简介清晰** 文档开头部分很好地概述了 NutUI-React 提供的主题定制功能,通过对 CSS Variables 和 Sass 变量两种方式的介绍,能够帮助用户快速理解核心思路。建议尽量使用 Markdown 原生段落(空行分隔)替代 `<br />` 标签,这样可以提高文档的可维护性。 --- `23-29`: **SCSS 示例代码完备** 示例代码中展示了主色调变量的定义,并通过 `...` 略去其他变量定义。建议在完整文档中补充或说明“...”部分的实际内容,避免用户产生疑惑。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/intro-react.en-US.md (1)</summary><blockquote> `23-28`: **Version 表格信息明确** 版本和兼容性信息通过表格详细罗列,但建议考虑将 "React 17\18" 更改为 "React 17,18" 或采用其他分隔符,以防止渲染时出现问题。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/intro-react.en-US.md (1)</summary><blockquote> `22-28`: **Compatibility 环境说明清晰** 通过表格介绍了版本、支持框架以及兼容性要求,信息明确。建议考虑将 "React 17\18" 替换为更标准的分隔符,如逗号,以防潜在的排版问题。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/theme-react.en-US.md (2)</summary><blockquote> `12-19`: **修正 Markdown 链接格式** 文中链接目前写作 `[CSS Vars] (https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties)`,建议去除链接文本与括号之间的空格,改为 `[CSS Vars](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties)`,以符合 Markdown 语法标准。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 12-12: Bare URL used null (MD034, no-bare-urls) --- 15-15: Link fragments should be valid null (MD051, link-fragments) --- 18-18: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `21-24`: **调整标题层级** 当前“#### Step 1: Create a custom variable SCSS file”的标题层级较低,建议将其修改为 “### Step 1: Create a custom variable SCSS file”,确保标题层级递进符合最佳实践。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 22-22: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) </details> </details> </blockquote></details> <details> <summary>src/sites/sites-react/doc/components/nav/nav.scss (2)</summary><blockquote> `75-78`: **链接悬停状态样式优化** 在链接 (`a`) 的悬停状态下使用 `$doc-default-color !important` 强调交互反馈,但建议审视 `!important` 是否必要,以免影响后续样式的灵活覆盖。 --- `56-56`: **避免硬制表符** 静态分析提示在背景设置处可能存在硬制表符问题,建议统一采用空格缩进,确保代码风格的一致性。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/theme-react.en-US.md (2)</summary><blockquote> `12-19`: **修正 Markdown 链接格式** 建议调整链接格式,将 `[CSS Vars] (https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties)` 改为 `[CSS Vars](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties)`,以符合 Markdown 标准。 --- `21-24`: **调整标题层级** 建议将 “#### Step 1: Create a custom variable SCSS file” 修改为 “### Step 1: Create a custom variable SCSS file”,确保标题层级递进符合预期。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/migrate-from-v1.en-US.md (1)</summary><blockquote> `73-73`: **删除翻译广告** 文档末尾标注 “Translated with DeepL.com (free version)” 不太符合专业文档风格,建议移除该广告信息,或将翻译说明放入附录中。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/migrate-from-v2.en-US.md (1)</summary><blockquote> `74-77`: **建议移除翻译工具广告信息。** 第74至77行末尾出现 “Translated with DeepL.com (free version)” 提示,这可能会分散注意力或显得不够专业。如果广告信息无实际用途,建议将其移除。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [inconsistency] ~77-~77: Do you want to remove this advertisement? Context: ... light operation of paging on mobile). Translated with DeepL.com (free version) (DEEPL_AD) </details> </details> </blockquote></details> <details> <summary>src/packages/popup/doc.taro.md (1)</summary><blockquote> `105-105`: **建议修正 Props 表格中的格式问题。** 在第105行,`portal` 属性的类型描述使用了重复的反引号:
HTMLElement` \| `(() => HTMLElement)` \| null
建议将其改为:
HTMLElement | (() => HTMLElement) | null
以确保在文档中正确显示。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/contributing-react.md (2)</summary><blockquote> `11-11`: **建议检查措辞以符合中文表达习惯。** 第11行的表述“营造舒适的开发氛围”可考虑调整为“营造舒适地开发氛围”,不过当前写法在中文中也较为常用,请根据团队风格决定是否修改。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发 Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co... (wb4) </details> </details> --- `47-49`: **建议避免使用裸露 URL。** 在第47至49行,文中使用了直接链接的 URL。为符合 markdownlint 规范,建议统一使用链接语法或将裸露的 URL 用尖括号包裹(例如 `<https://github.com/jdf2e/nutui-react/discussions/348>`)。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/contributing-react.md (2)</summary><blockquote> `11-11`: **建议检查措辞以符合中文表达习惯。** 第11行“营造舒适的开发氛围”处,可考虑改为“营造舒适地开发氛围”,但目前用法也符合常见表达,请根据团队习惯决定是否修改。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发 Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co... (wb4) </details> </details> --- `47-49`: **建议避免使用裸露 URL。** 请确保文档中所有 URL 均采用完整链接语法或用尖括号包裹,以满足 markdownlint 的要求,防止在展示时出现格式问题。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/start-react.en-US.md (4)</summary><blockquote> `20-26`: **建议调整标题层级** 目前“#### 1. Use the command to create a Taro project:”及“#### 2、Refer to the operation below to select the NutUI React template”采用 h4 层级,但前面的标题为 h2。建议将这两个标题调整为 h3,以确保标题层次连续一致。 --- `54-63`: **建议统一标题层级** “#### 1. Install NutUI React”以及紧随其后的“#### 2、Taro”均为 h4 层级。为保持逻辑层次清晰,建议改为 h3。 --- `148-164`: **建议调整注意事项标题层级** 在“#### 1. Check if Taro is successfully installed”、“#### 2. Saas-related errors occurred during the installation of Taro”和“#### 3. When the applet project is running, the error message …”中,标题目前为 h4。建议统一调整为 h3,以保持与上层 h2 标题的递增关系。 --- `31-33`: **建议格式化裸露 URL** 在 “Need help? Go and open issue: https://tls.jd.com/taro-issue-helper” 中直接展示 URL,建议使用 Markdown 超链接格式,例如 `[Go and open issue](https://tls.jd.com/taro-issue-helper)`,以提高文档的可读性。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/start-react.md (4)</summary><blockquote> `9-18`: **建议调整标题层级** “#### 1. 通过 NPM 安装”采用了 h4 层级,建议修改为 h3 以保持与前面 h2 层级的自然递增。 --- `20-25`: **建议调整标题层级** “#### 2. 通过 CDN 安装及使用”当前为 h4 层级,建议改为 h3,使标题结构更加清晰。 --- `73-89`: **建议调整标题层级** “#### 方法一、常规用法:全量引入样式”建议从 h4 降为 h3,与前面 “## 组件使用”保持层级一致。 --- `93-103`: **建议调整标题层级** “#### 方法二、按需引入样式”采用 h4 层级,建议修改为 h3,以确保整体标题层次连贯。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/start-react.en-US.md (4)</summary><blockquote> `9-18`: **建议调整标题层级** “#### 1. Install via NPM”当前为 h4 层级,建议改为 h3,使其与上层标题形成递增关系。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 9-9: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) </details> </details> --- `20-25`: **建议调整标题层级** “#### 2. Install and use via CDN”采用 h4 层级,建议调整为 h3,以确保标题层次一致。 --- `73-89`: **建议调整标题层级** “#### Method 1, Conventional usage: Full import of styles”层级建议由 h4 调整为 h3,确保与其他部分标题风格一致。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 73-73: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) </details> </details> --- `93-103`: **建议调整标题层级** “#### Method 2, import styles on demand”当前采用 h4 层级,建议调整为 h3,以保持标题层次一致性。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/App.scss (2)</summary><blockquote> `73-78`: **消除重复属性声明** 在 `.doc-content-contributors img` 选择器中,连续声明了两次 `height: 26px;`,建议删除重复的声明以保持代码简洁。 --- `101-104`: **确认颜色值是否正确** 在 `.doc-content-contributors-gap` 中使用的颜色值 `#eeeaea` 较为少见,请确认是否为预期效果,或考虑使用更常见的颜色代码。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/contributing-react.en-US.md (4)</summary><blockquote> `7-8`: **建议简化贡献指南介绍语句** 当前引导语略显冗长,建议精简描述,使读者快速聚焦在关键贡献流程上。 --- `25-29`: **调整逗号使用以优化语句流畅度** 在说明中“...provide all the development information as much as possible, because the more comprehensive the information, …”中建议去掉“because”前的逗号,从而使语句更加连贯。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause. Context: ...elopment information as much as possible, because the more comprehensive the information,... (COMMA_BEFORE_BECAUSE) </details> </details> --- `33-36`: **修正冠词错误** 在描述中“to submit a issue of adding new features”应改为“to submit an issue”,因为“issue”以元音音素开头。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ... (EN_A_VS_AN) </details> </details> --- `57-60`: **增加缺失介词以完善描述** 在“4. The PR information should include which component has been modified, which problem has been solved, and associated the corresponding issue link on github”中,建议补全表述,例如改为“... and include the corresponding issue link on github”,以使语句完整。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~59-~59: Possible missing preposition found. Context: ...problem has been solved, and associated the corresponding issue link on github ## ... (AI_HYDRA_LEO_MISSING_TO) </details> </details> </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/react/contributing-react.en-US.md (13)</summary><blockquote> `1-4`: **标题与引言部分清晰明了** 该部分已正确地引入了贡献指南,但建议统一英文标题的大小写(例如将 "code of conduct" 调整为 "Code of Conduct"),并检查标点符号的使用是否符合项目的写作规范。 --- `9-12`: **“Code of Conduct” 部分建议** 当前说明已完整,但建议将标题格式统一为大写模式,以提高视觉一致性。此外,可适当精简冗长语句,避免因过于啰嗦而影响阅读体验。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [style] ~10-~10: Consider a shorter alternative to avoid wordiness. Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c... (IN_ORDER_TO_PREMIUM) </details> </details> --- `13-16`: **分支管理说明简洁明确** 这一部分已说明主分支的维护规则,但建议增加一些指向详细说明或使用示例的链接,以便开发者更好地理解如何贡献代码。 --- `19-20`: **关于官网更新说明的格式问题** 在描述官网更新时,请检查链接中括号与括号之间是否存在多余空格,例如 `[NutUI - React release cycle] (https://github.com/jdf2e/nutui-react/releases)` 建议改为 `[NutUI - React release cycle](https://github.com/jdf2e/nutui-react/releases)`。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 19-19: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `23-24`: **问题报告模板链接格式建议** 建议将 “If submit Bug reports” 更改为 “If submitting bug reports” 以保持语法一致性,同时确保链接内的空格和标点符号正确。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 23-23: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `27-28`: **Bugs 部分的描述优化建议** 建议使用更一致的符号和标点,例如对逗号和连词的使用进行检查,使语句更通顺。另外,可考虑用内联代码块标识链接文本以增强可读性。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause. Context: ...elopment information as much as possible, because the more comprehensive the information,... (COMMA_BEFORE_BECAUSE) </details> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 27-27: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `29-32`: **Bug提交前的检查说明** 说明内容已较为明确,建议将 “search had existing” 修改为 “have searched for existing” 以提高语义准确性,并检查说明语句的语法。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 31-31: Bare URL used null (MD034, no-bare-urls) --- 31-31: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `47-50`: **参与贡献部分与参考链接** 内容整体完整,但建议为代码示例及链接提供适当的格式化(例如为代码块指定语言),以便于阅读并符合 Markdown 规范。 --- `70-75`: **Git 克隆与安装命令代码块格式改进** 建议为 git clone 和 npm install 的代码块添加 shell 语言标识,以便获得正确的语法高亮,同时检查占位符 `{github username}` 是否可以用示例文本替换来指导用户。 --- `77-83`: **Git 分支切换代码块建议** 同样建议为代码块指定正确的语言标识,同时确保示例命令清晰易懂。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 79-79: Fenced code blocks should have a language specified null (MD040, fenced-code-language) </details> </details> --- `91-97`: **测试与构建命令代码块提示** 建议在此代码块中添加 shell 语言标识,并考虑将注释部分(例如 “// node v17”)用适当的 Markdown 格式处理,以保持文档整洁。 --- `103-111`: **知识共享部分及裸露链接问题** 建议对裸露的 URL 采用 Markdown 链接语法(例如 `[use case](https://nutui.jd.com/#/zh-CN/case)`),从而增强文档的专业度和美观度。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 107-107: Bare URL used null (MD034, no-bare-urls) </details> </details> --- `123-130`: **致谢部分的图片链接建议** 感谢致谢部分格式整齐,但建议确认图片链接的有效性,并确保 HTML 标签内的属性值使用成对的引号。此外,可考虑将此部分使用 Markdown 图片语法呈现。 </blockquote></details> <details> <summary>src/packages/uploader/doc.en-US.md (3)</summary><blockquote> `105-105`: **capture 属性说明更新** 该属性的描述清晰,链接格式正确。建议确认描述中 “直接 bring up the camera” 是否可以统一使用中文描述以保持一致性(如“直接调用摄像头”)。 --- `116-117`: **beforeUpload 与 beforeDelete 的函数签名** 建议确认内嵌代码块的格式是否正确(使用三反引号包裹代码),同时检查转义字符在 Promise 类型声明中是否完备。 --- `120-123`: **上传状态相关回调函数签名** 建议检查所有新增回调函数的代码块格式是否统一,并确保每个函数签名中的类型描述、转义字符及标点符号准确无误。 </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/migrate-from-v1.md (4)</summary><blockquote> `7-12`: **H5 环境安装命令示例** 为 H5 环境提供的安装命令较为清晰,建议为代码块添加 `shell` 语言标识来获得正确的语法高亮,同时确认命令能在目标环境中正常执行。 --- `13-18`: **Taro 环境安装命令示例** 同样建议为代码块指定 `shell` 语言,确保与 H5 部分保持一致,并验证命令示例具备可操作性。 --- `33-68`: **按需引入 CSS/SCSS 配置说明** 提供的 H5 与 Taro 的 Babel 配置示例较详细,建议为 JSON 格式的代码块添加 `json` 语言标识,并检查示例配置中的各项属性是否符合最新的构建要求。 --- `90-889`: **总体内容与格式优化建议** 整个迁移指南内容详尽,覆盖了从环境安装、配置、各组件 API 调整到具体示例代码等众多细节。建议对部分长段落进行分段和排版优化,例如利用列表、表格或分级标题来划分不同主题。此外,确保所有代码块都明确标注了语言(如 shell、json 等),并对裸露链接进行标准化处理,从而提升整体文档的专业性和可读性。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名 Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路... (wb4) </details> </details> </blockquote></details> <details> <summary>src/sites/sites-react/doc/docs/taro/migrate-from-v2.md (4)</summary><blockquote> `19-24`: **不兼容更新指导清晰。** 这一部分提醒用户注意从 1.x 到 2.x 的不兼容更改,并介绍了 codemod CLI 工具的使用。建议可以补充提示“请先备份代码或提交所有本地修改”以增强风险提示。 --- `25-27`: **主题变量更名说明到位。** 详细说明了例如将 primary-color 更名为 color‐primary 的变化,建议增加实际示例帮助开发者理解如何在自定义主题中应用这些变更。 --- `85-90`: **语言表达优化建议。** 请注意“关于 Icon 的相关 Props”这种表达,当介词短语位于句中时建议调整为“对于 Icon 的相关 Props”以符合中文语法要求。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。 Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon... (wb2) </details> </details> --- `127-127`: **语言细节建议。** 建议检查文中部分动词修饰表达,考虑采用“形容词(或副词)+地+动词”的结构以提高语言准确性。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名 Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路... (wb4) </details> </details> </blockquote></details> <details> <summary>src/sites/sites-react/doc/components/header/header.scss (2)</summary><blockquote> `40-90`: **Logo 部分的样式需谨慎。** 1. 在 `.logo-link` 内使用了 `!important` 来强制设置宽度,建议仅在必要时使用,不然可能影响样式灵活性; 2. 部分元素采用了负边距(如 `margin-left: -30px`),请确认这在各种分辨率下都能正常显示。 --- `952-960`: **业务数据指南样式。** `.guid-data-business` 提供了业务信息展示的样式,整体设计简约。注意检查可能使用到的 `!important` 标记,确保后续维护时不会引入样式覆盖问题。 </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 3a8ad9b40421db092900e6751c167f5b3c89b1f6 and 3301a0f013d229dff03838266d2498cbcd3335dc. </details> <details> <summary>📒 Files selected for processing (60)</summary> * `.gitignore` (1 hunks) * `index.html` (1 hunks) * `package.json` (2 hunks) * `src/packages/popup/doc.taro.md` (1 hunks) * `src/packages/uploader/doc.en-US.md` (1 hunks) * `src/sites/assets/styles/variables.scss` (3 hunks) * `src/sites/config/env.ts` (2 hunks) * `src/sites/doc/components/demo-preview/index.ts` (0 hunks) * `src/sites/doc/components/header/index.ts` (0 hunks) * `src/sites/doc/components/nav/index.ts` (0 hunks) * `src/sites/sites-react/doc/App.scss` (1 hunks) * `src/sites/sites-react/doc/App.tsx` (1 hunks) * `src/sites/sites-react/doc/components/demo-preview/index.ts` (1 hunks) * `src/sites/sites-react/doc/components/demoblock/codeblock.tsx` (2 hunks) * `src/sites/sites-react/doc/components/demoblock/demoblock.tsx` (1 hunks) * `src/sites/sites-react/doc/components/header/header.scss` (1 hunks) * `src/sites/sites-react/doc/components/header/header.tsx` (1 hunks) * `src/sites/sites-react/doc/components/header/index.ts` (1 hunks) * `src/sites/sites-react/doc/components/issue/issue.scss` (2 hunks) * `src/sites/sites-react/doc/components/issue/issue.tsx` (2 hunks) * `src/sites/sites-react/doc/components/nav/index.ts` (1 hunks) * `src/sites/sites-react/doc/components/nav/nav.scss` (5 hunks) * `src/sites/sites-react/doc/components/nav/nav.tsx` (1 hunks) * `src/sites/sites-react/doc/components/search/search.scss` (1 hunks) * `src/sites/sites-react/doc/components/search/search.tsx` (1 hunks) * `src/sites/sites-react/doc/docs.taro.ts` (1 hunks) * `src/sites/sites-react/doc/docs.ts` (1 hunks) * `src/sites/sites-react/doc/docs/react/contributing-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/contributing-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/international-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/international-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/intro-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/intro-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/migrate-from-v1.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/migrate-from-v2.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/official-theme-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/official-theme-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/start-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/start-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/theme-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/react/theme-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/contributing-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/contributing-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/international-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/international-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/intro-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/intro-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/migrate-from-v1.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/migrate-from-v2.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/official-theme-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/official-theme-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/start-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/start-react.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/theme-react.en-US.md` (1 hunks) * `src/sites/sites-react/doc/docs/taro/theme-react.md` (1 hunks) * `src/sites/sites-react/doc/main.tsx` (1 hunks) * `src/sites/sites-react/doc/router.ts` (1 hunks) * `src/sites/theme/components/header/header.scss` (2 hunks) * `vite.config.demo.ts` (1 hunks) * `vite.config.site.ts` (3 hunks) </details> <details> <summary>💤 Files with no reviewable changes (3)</summary> * src/sites/doc/components/demo-preview/index.ts * src/sites/doc/components/nav/index.ts * src/sites/doc/components/header/index.ts </details> <details> <summary>✅ Files skipped from review due to trivial changes (5)</summary> * src/sites/sites-react/doc/components/demo-preview/index.ts * .gitignore * src/sites/sites-react/doc/components/nav/index.ts * src/sites/sites-react/doc/components/header/index.ts * src/sites/sites-react/doc/components/demoblock/demoblock.tsx </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary> * src/sites/config/env.ts * src/sites/assets/styles/variables.scss </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> <details> <summary>src/sites/sites-react/doc/docs/taro/official-theme-react.en-US.md</summary> 7-7: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) --- 12-12: Spaces inside code span elements null (MD038, no-space-in-code) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/theme-react.en-US.md</summary> 12-12: Bare URL used null (MD034, no-bare-urls) --- 15-15: Link fragments should be valid null (MD051, link-fragments) --- 18-18: Bare URL used null (MD034, no-bare-urls) --- 22-22: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) --- 35-35: Spaces inside emphasis markers null (MD037, no-space-in-emphasis) --- 56-56: Hard tabs Column: 1 (MD010, no-hard-tabs) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/contributing-react.md</summary> 67-67: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 75-75: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 84-84: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 99-99: Bare URL used null (MD034, no-bare-urls) --- 105-105: Bare URL used null (MD034, no-bare-urls) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/theme-react.md</summary> 13-13: Link fragments should be valid null (MD051, link-fragments) --- 51-51: Hard tabs Column: 1 (MD010, no-hard-tabs) </details> <details> <summary>src/sites/sites-react/doc/docs/react/start-react.en-US.md</summary> 9-9: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) --- 73-73: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) --- 184-184: Bare URL used null (MD034, no-bare-urls) </details> <details> <summary>src/sites/sites-react/doc/docs/react/theme-react.md</summary> 15-15: Link fragments should be valid null (MD051, link-fragments) </details> <details> <summary>src/sites/sites-react/doc/docs/react/contributing-react.en-US.md</summary> 19-19: Bare URL used null (MD034, no-bare-urls) --- 23-23: Bare URL used null (MD034, no-bare-urls) --- 27-27: Bare URL used null (MD034, no-bare-urls) --- 31-31: Bare URL used null (MD034, no-bare-urls) --- 31-31: Bare URL used null (MD034, no-bare-urls) --- 35-35: Bare URL used null (MD034, no-bare-urls) --- 39-39: Bare URL used null (MD034, no-bare-urls) --- 69-69: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 79-79: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 90-90: Fenced code blocks should have a language specified null (MD040, fenced-code-language) --- 107-107: Bare URL used null (MD034, no-bare-urls) --- 113-113: Bare URL used null (MD034, no-bare-urls) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/intro-react.md</summary> 27-27: Images should have alternate text (alt text) null (MD045, no-alt-text) </details> </details> <details> <summary>🪛 LanguageTool</summary> <details> <summary>src/sites/sites-react/doc/docs/taro/intro-react.en-US.md</summary> [uncategorized] ~3-~3: You might be missing the article “the” here. Context: ... component library, based on Taro, uses React technology stack to develop applet appl... (AI_EN_LECTOR_MISSING_DETERMINER_THE) </details> <details> <summary>src/sites/sites-react/doc/docs/react/contributing-react.md</summary> [uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发 Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co... (wb4) </details> <details> <summary>src/sites/sites-react/doc/docs/react/migrate-from-v2.en-US.md</summary> [inconsistency] ~77-~77: Do you want to remove this advertisement? Context: ... light operation of paging on mobile). Translated with DeepL.com (free version) (DEEPL_AD) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/contributing-react.en-US.md</summary> [style] ~10-~10: Consider a shorter alternative to avoid wordiness. Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c... (IN_ORDER_TO_PREMIUM) --- [formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause. Context: ...elopment information as much as possible, because the more comprehensive the information,... (COMMA_BEFORE_BECAUSE) --- [misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ... (EN_A_VS_AN) --- [uncategorized] ~59-~59: Possible missing preposition found. Context: ...problem has been solved, and associated the corresponding issue link on github ## ... (AI_HYDRA_LEO_MISSING_TO) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/contributing-react.md</summary> [uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发 Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co... (wb4) </details> <details> <summary>src/packages/uploader/doc.en-US.md</summary> [grammar] ~109-~109: This is a non-standard phrase. Did you mean “whether or not”? Context: ...`scale-down` | `cover` | | clearInput | If or not you want to clear the `input` content, ... (IF_OR_NOT) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/migrate-from-v2.md</summary> [uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。 Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon... (wb2) --- [uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名 Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路... (wb4) </details> <details> <summary>src/sites/sites-react/doc/docs/taro/migrate-from-v1.md</summary> [uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。 Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon... (wb2) --- [uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名 Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路... (wb4) </details> <details> <summary>src/sites/sites-react/doc/docs/react/contributing-react.en-US.md</summary> [style] ~10-~10: Consider a shorter alternative to avoid wordiness. Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c... (IN_ORDER_TO_PREMIUM) --- [formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause. Context: ...elopment information as much as possible, because the more comprehensive the information,... (COMMA_BEFORE_BECAUSE) --- [misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ... (EN_A_VS_AN) --- [uncategorized] ~59-~59: Possible missing preposition found. Context: ...problem has been solved, and associated the corresponding issue link on github ## ... (AI_HYDRA_LEO_MISSING_TO) </details> <details> <summary>src/sites/sites-react/doc/docs/react/migrate-from-v1.en-US.md</summary> [inconsistency] ~72-~72: Do you want to remove this advertisement? Context: ...at `Menu` is mainly used as a filter); Translated with DeepL.com (free version) (DEEPL_AD) </details> </details> <details> <summary>🪛 Biome (1.9.4)</summary> <details> <summary>src/sites/sites-react/doc/components/nav/nav.tsx</summary> [error] 55-65: Avoid using unnecessary Fragment. A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment. Unsafe fix: Remove the Fragment (lint/complexity/noUselessFragments) </details> <details> <summary>src/sites/sites-react/doc/components/search/search.tsx</summary> [error] 32-34: Change to an optional chain. Unsafe fix: Change to an optional chain. (lint/complexity/useOptionalChain) </details> </details> </details> <details> <summary>🔇 Additional comments (112)</summary><blockquote> <details> <summary>src/sites/sites-react/doc/docs/react/official-theme-react.en-US.md (2)</summary> `14-14`: **图片标签配置正确** 图片标签设置了适当的宽度和描述,符合文档最佳实践,无需修改。 --- `16-20`: **文档使用指南清晰** “How to use” 部分对如何修改本地项目(Vite 或 Webpack)的配置描述清晰,并提供了实用示例,能够帮助用户快速上手。 </details> <details> <summary>src/sites/sites-react/doc/docs/taro/official-theme-react.en-US.md (1)</summary> `1-66`: **新文档总体良好** 该文档新增官方主题说明,结构清晰,示例代码和配置说明详尽,能够有效指导用户如何在 Vite 或 Webpack 配置中引入对应 SCSS 文件。 <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 7-7: Heading levels should only increment by one level at a time Expected: h3; Actual: h4 (MD001, heading-increment) --- 12-12: Spaces inside code span elements null (MD038, no-space-in-code) </details> </details> </details> <details> <summary>vite.config.site.ts (5)</summary> `3-7`: **引入新插件很好,注意命名一致性。** 使用 `@vitejs/plugin-react` 并通过 `reactRefresh()` 启动 React 刷新功能没有问题,但请确认项目中其它地方也与该插件的常见用法和命名保持一致,以免后续维护时产生混淆。 --- `20-22`: **动态导入 MDX 插件。** 异步加载 MDX、`remarkGfm`、`remarkDirective` 可以节省初始加载性能,当前实现方式可行。后续若插件数量更多,可考虑相关依赖是否需要“懒加载”或拆分业务场景,以优化构建体积和启动速度。 --- `24-36`: **代理配置请再次确认。** 新的 `server` 设置包含对 `/devServer` 的代理。若外部域名或路径变更,需要同步更新此处并验证是否有跨域问题或敏感信息泄漏风险。 --- `143-153`: **测试配置与 Happy DOM 集成可行。** 使用 `happy-dom` 作为测试环境与 Vite 集成通常比较稳定,这里无需额外改动,后续若需要 E2E 测试再决定是否引入其它解决方案。 --- `155-165`: **自定义打包路径与文件名。** 目前基于版本号与随机后缀生成资源目录,可有效区分不同构建,但可能增加部署与缓存复杂度。若生产环境有较高缓存需求,可考虑采用可追溯又相对固定的方式(如 Git 提交哈希)。 </details> <details> <summary>src/sites/sites-react/doc/main.tsx (1)</summary> `3-3`: **相对路径导入的更新无问题。** 切换到相对路径有助于降低对别名的依赖,请确保其它文件里引用 `isMobile` 的方式也已同步更新。 </details> <details> <summary>src/sites/sites-react/doc/components/demoblock/codeblock.tsx (2)</summary> `7-7`: **扩大 glob 匹配范围可提升复用性。** 由 `@/packages/**/demos/h5/*.tsx` 改为 `@/packages/**/demos/**/*.tsx` 可以更灵活加载各级目录的示例文件,但需确保不会误导入与演示无关的其他脚本。 --- `26-26`: **异常捕获格式化属于小改动。** `catch (e)` 书写更具可读性,功能无实质变动,认可该风格调整。 </details> <details> <summary>vite.config.demo.ts (1)</summary> `20-20`: _:hammer_and_wrench: Refactor suggestion_ **建议使用更安全的路径构建方式** 当前的 base 路径构建方式可能存在安全隐患。建议使用 `path.join()` 来构建路径,并对 `projectID` 进行清理和验证。 ```diff -base: `/h5/react/${projectID === 'jmapp' ? 'jdesign' : '3x'}`, +base: path.join('/h5/react', projectID === 'jmapp' ? 'jdesign' : '3x'),
Likely invalid or redundant comment.
src/sites/sites-react/doc/docs.taro.ts (1)
362-363
: 导出的常量结构清晰,便于维护。
routers
和raws
的设计合理,方便统一管理组件文档。src/sites/sites-react/doc/docs/taro/international-react.en-US.md (3)
1-8
: 文档标题和引言部分清晰。
该部分使用 “# Internationalization” 作为标题,并说明 NutUI-React 支持多语言,整体表述简单明了。
9-23
: 示例代码演示正确。
演示代码展示了如何使用ConfigProvider
切换语言,代码逻辑正确,且示例内容清晰。建议开发者在实际环境中验证该实现。
25-37
: 支持语言表格完整。
表格中列出了各语言的文件名和版本,格式规范,信息完备。建议后续版本更新时保持同步。src/sites/sites-react/doc/docs/react/intro-react.md (5)
1-4
: 文档标题和引言部分清晰。
文件开头用 “# NutUI-React” 标题强调了组件库定位,简短的介绍准确描述了其用途和优势。
5-17
: 特性列表表达精炼。
通过多个项目符号清晰列出系统特性,包括组件数量、视觉规范、SSR 支持等,内容覆盖全面,可帮助用户快速了解产品亮点。
18-21
: 扫码体验部分良好。
提供了效果展示图片,直观呈现了 NutUI-React 的用户界面,增强了文档的吸引力。
22-30
: 兼容情况说明详细。
通过表格展示支持的框架、视觉规范及兼容性信息,附加了对于低版本浏览器的建议,内容详实。
32-43
: 贡献者及开源协议部分内容合理。
贡献者名单和开源协议声明均展示清楚,链接正确,能让用户明确项目许可证及参与者信息。src/sites/sites-react/doc/components/issue/issue.scss (3)
22-24
: 内边距和字体大小的调整。
内边距由5px 8px
改为5px 9px
,字体大小调整为14px
,这显示出设计上的细节修改,请确认这些改动符合整体视觉规划。
29-44
: 图标样式定义清晰。
.icon
内部针对不同状态(issue、open、closed)设置了背景图像,使图标在不同状态下能够直观区分,样式设置合理。
46-53
: 悬停状态样式合理。
对于.nut-icon
和.issue-item:hover
的样式定义能有效提供用户反馈,保证交互效果。src/sites/sites-react/doc/docs/taro/theme-react.md (2)
1-7
: 主题定制介绍部分表述清晰。
文档开头介绍了 NutUI-React 在样式定制上灵活性及新引入 CSS 变量的优势,说明详细且易于理解。
9-16
: 方式一:CSS Variables 部分说明明确。
详细描述了利用 CSS 自定义属性实现主题配置的方法,并提供参考链接。建议检查链接的有效性,确保用户能正常访问相关文档。🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
13-13: Link fragments should be valid
null(MD051, link-fragments)
src/sites/sites-react/doc/components/search/search.scss (5)
1-5
: 搜索框容器样式合理。
.search-box
使用相对定位、设定了最小宽度及固定高度,能满足搜索框布局和定位需求。
20-24
: 占位符样式设置正确。
为.search-input::placeholder
指定了颜色,并保留了注释供参考,样式明确。
26-34
: 搜索列表容器样式定义完善。
.search-list
采用了绝对定位和固定宽度,同时设置了边框及较高的 z-index,确保展示效果与搜索框匹配。
35-53
: 列表项和悬停效果样式合理。
li
内部及其超链接(a)的样式定义清晰,并在悬停状态下提供了良好的视觉反馈。
55-68
: 当前选中项样式清晰。
.cur
类及其内部和悬停时的样式设置能有效突出当前选中项,确保用户视觉识别度良好。src/sites/sites-react/doc/docs/react/theme-react.md (4)
10-16
: CSS Variables 配置说明明确
说明部分详细介绍了如何使用 CSS Variables 进行主题定制,并提供了 ConfigProvider 组件的链接供用户体验,此处内容清晰且具有指导性。🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
15-15: Link fragments should be valid
null(MD051, link-fragments)
17-22
: Sass 变量定制方案描述清楚
文档清晰地介绍了如何通过新建自定义 SCSS 文件来进行主题定制,示例代码展示合理,有助于用户快速入门。
30-34
: 配置说明步骤清晰
文档接下来的部分对如何修改 Vite 或 Webpack 配置文件做了概述,步骤明确且易于理解,有助于用户快速应用。
36-48
: Vite 配置示例准确
示例代码展示了如何在 Vite 配置中通过additionalData
选项导入 NutUI-React 的 SCSS 变量文件和自定义主题文件。建议用户确认路径./your/custom_theme.scss
与项目实际文件结构一致。src/sites/sites-react/doc/docs/react/official-theme-react.md (5)
1-9
: 官方主题文档内容简明扼要
文档前半部分通过标题和表格形式介绍了 NutUI 提供的官方主题以及相应的 SCSS 文件名称,内容结构清晰。
10-15
: 主题展示图直观规范
内嵌图片能够直观反映主题定制效果。建议确认图片链接的长期稳定性以及加载性能。
16-21
: 使用方式说明详细
文档详细说明了如何修改项目中 sass-loader 的配置以使用官方主题,对 Vite 和 Webpack 两种方式都做了说明,步骤明确。
22-42
: Vite 配置示例详细
代码示例准确展示了使用additionalData
选项导入 SCSS 文件,明确区分了默认主题与其他主题的使用。建议检查实际项目中主题文件的路径是否与示例一致。
44-65
: Webpack 配置示例正确
Webpack 配置示例通过data
选项展示了如何导入主题 SCSS 文件。文中也提醒了用户注意不同版本 sass-loader 的选项命名问题,说明到位。src/sites/sites-react/doc/docs/taro/intro-react.en-US.md (5)
1-4
: Library Introduction 描述清晰
文档开头部分简洁介绍了 NutUI-React 的定位,明确使用 Taro 与 React 技术栈构建小程序应用,能够帮助国际用户快速理解项目核心。🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: You might be missing the article “the” here.
Context: ... component library, based on Taro, uses React technology stack to develop applet appl...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
5-18
: Features 列表全面
功能列表涵盖了组件数量、视觉规范、技术支持等多个关键点,帮助用户全面了解组件库优势。建议在后续维护中确保组件数量与描述保持一致。
19-22
: Examples 部分展示合适
图片示例部分直观展示了库的界面效果,图片尺寸适中且包含 alt 信息,有利于增强文档的可访问性。
29-31
: 浏览器兼容性建议明确
针对部分老旧浏览器,文档建议使用 polyfill 与 @babel/preset-env 解决兼容性问题,说明充分且具有指导意义。
32-39
: Contributors 与 LICENSE 信息齐全
项目贡献者信息和许可协议部分符合开源项目要求,能够激励社区参与。src/sites/sites-react/doc/docs/taro/official-theme-react.md (6)
1-9
: 官方主题介绍部分良好
文档前半部分清晰描述了 NutUI 官方主题的概况,并通过表格展示了对应的 SCSS 文件名称,内容结构合理。
10-15
: 主题图片展示正常
图片有效展示了主题样式,用户可直观感受主题效果。建议验证图片在各种设备上的显示效果。
16-21
: 使用方式说明详细
详细介绍了如何修改本地配置文件以使用官方主题,对 Vite 与 Webpack 两种构建工具都做了说明,指导性明确。
22-42
: Vite 配置示例完善
代码示例准确展示了如何在 Vite 中通过additionalData
导入 SCSS 文件,说明清晰,建议用户核对路径。
44-65
: Webpack 配置示例准确
Webpack 示例通过data
选项导入主题变量文件,内容详尽。提醒用户留意不同 sass-loader 版本下选项名称的变化。
67-86
: vue-cli 配置示例详尽
文档为 vue/cli 3 以上版本提供了修改 vue.config.js 的示例,使用prependData
选项导入 SCSS 文件,代码清晰。建议用户根据实际使用的 sass-loader 版本验证选项名称。src/sites/sites-react/doc/docs/react/intro-react.en-US.md (5)
1-4
: Introduction 部分描述清晰
文档开头对 NutUI-React 的定位进行了简洁明了的描述,指出其适用于 H5 应用并基于 React 技术栈,非常适合国际化用户。
5-17
: Features 列表完整
列举了库的主要功能特性,如高质量组件、TypeScript 支持、SSR(Next.js)、定制主题等,内容全面且重点突出。
18-21
: Examples 部分展示恰当
示例图片展示了 NutUI-React 的 UI 效果,图片尺寸及 alt 属性设置合理,有助于提高文档的直观性。
29-31
: 浏览器兼容性建议明确
针对老旧浏览器的兼容性,文档提出了使用 @babel/preset-env 及 postcss-var-replace 的建议,对用户有重要参考价值。
32-39
: Contributors 与 LICENSE 部分符合开源规范
贡献者信息及 MIT 许可协议部分完整,信息透明,有助于社区参与和规范使用。src/sites/sites-react/doc/docs/taro/theme-react.en-US.md (1)
1-9
: 引言部分结构清晰
文档开头成功传达了主题定制相关的功能与方法,内容表达清楚,整体结构合理。src/sites/sites-react/doc/components/nav/nav.scss (7)
13-14
: 新增顶部内边距
在.doc-nav
内增加padding-top: 35px;
有助于提升内容与边界的间距,建议确认该数值与整体页面布局风格保持一致。
16-19
: 固定导航的顶部内边距调整
在固定导航(.doc-nav.fixed
)中设置padding-top: 15px;
,此调整意在减少顶部空白,请与设计稿核对确认是否符合预期。
35-42
: 列表项字体加粗设置
在普通列表项中应用font-weight: bold;
能够使内容更加醒目。请确认此样式在整体文档导航中的效果与其他文本风格一致。
43-48
: 活动状态样式调整
针对活动列表项,明确设置font-weight: bold;
与文本颜色为$doc-default-color
,同时前置伪元素中背景图片的 URL 用单引号包裹,提升了代码一致性。建议测试在不同浏览器下背景图片的显示效果。
62-67
: 嵌套列表项样式更新
为嵌套列表项添加height: 100%;
和font-weight: bold;
,确保层级结构中每个项的高度和字体表现均与整体风格保持一致,建议在不同设备上验证该样式。
85-88
: 链接默认与已访问状态颜色设定
将链接在未激活与已访问状态下的颜色设为#1a1a1a
有助于保证良好的内容可读性,请确认该配色与整体设计方案吻合。
96-100
: 内部 div 悬停状态样式
为列表项内部div
添加悬停时改变颜色的效果,确保用户鼠标经过时获得明确的视觉反馈,建议在实际环境中测试该效果。src/sites/sites-react/doc/docs/react/theme-react.en-US.md (1)
1-9
: 文档介绍部分清晰
文档有效地阐释了 NutUI-React 主题定制的两种方法,结构清晰,内容表达准确。index.html (1)
52-52
: 更新脚本引用路径
将<script type="module" src="/src/sites/sites-react/doc/main.tsx"></script>
的引用路径更新后,有助于确保新目录结构下正确加载入口模块。请确认新文件路径与项目结构一致。src/sites/sites-react/doc/docs/react/migrate-from-v1.en-US.md (1)
1-4
: 升级指南整体介绍清晰
文档开头部分明确指出了从 NutUI React 1.x 升级到 2.x 的关键步骤,为用户提供了全面而具体的升级指导。src/sites/sites-react/doc/docs/react/migrate-from-v2.en-US.md (1)
36-50
: 建议检查 Babel 插件配置示例的格式问题。
在第36至50行的代码示例中,关于 babel-import-plugin 的配置存在格式不规范和重复定义(例如重复的libraryDirectory
字段和多余的{
字符),同时使用的引号为非标准的全角符号,可能会导致用户复制后出错。建议核对并提供一个经过验证的正确配置示例。src/sites/sites-react/doc/docs/taro/start-react.md (1)
1-192
: 文档整体结构清晰且说明详细。
该文档详细介绍了 NutUI-React 与 Taro 的安装与配置步骤,各种安装命令和配置示例均已标明语言,便于读者理解和复制。请保持这种清晰的结构,并在后续版本中考虑在示例代码中增加必要的注释。src/sites/sites-react/doc/docs/react/contributing-react.md (1)
1-122
: 整体贡献指南文档详尽且结构良好。
内容涵盖了行为准则、分支管理、 Issue 与 PR 提交流程等方面,为贡献者提供了明确的操作指引。请继续保持文档的详细程度,必要时可以酌情调整部分措辞以进一步提高专业度。🧰 Tools
🪛 LanguageTool
[uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发
Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co...(wb4)
src/sites/sites-react/doc/docs/taro/contributing-react.md (1)
1-122
: 贡献指南文档内容完备且层次清晰。
文档详细说明了贡献流程、 Issue 提交规范、 PR 流程及知识分享内容等,能够很好地指导贡献者参与项目开发。建议保留现有细致说明,并根据后续反馈逐步完善。🧰 Tools
🪛 LanguageTool
[uncategorized] ~11-~11: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:舒适"地"开发
Context: ...是符合规范并且能帮助到社区。 ## 行为准则 为保证良好的网络环境,营造舒适的开发氛围,希望所有的贡献者都能遵守这份[行为准则](https://www.co...(wb4)
🪛 markdownlint-cli2 (0.17.2)
67-67: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
75-75: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
84-84: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
99-99: Bare URL used
null(MD034, no-bare-urls)
105-105: Bare URL used
null(MD034, no-bare-urls)
src/sites/sites-react/doc/docs/taro/start-react.en-US.md (1)
1-186
: 整体文档结构良好
该文档详细介绍了 NutUI-React Taro 的快速上手、安装 CLI、项目创建、组件使用及注意事项,条理清晰。请根据以上建议调整标题层级和格式细节以进一步提升文档质量。src/sites/sites-react/doc/docs/react/start-react.md (1)
1-191
: 整体文档内容与结构良好
文档详细说明了 NutUI React 的安装方法、组件使用示例以及注意事项,示例代码清晰易懂。src/sites/sites-react/doc/docs/react/start-react.en-US.md (1)
1-153
: 整体文档评价良好
该文档清晰介绍了 NutUI React 的安装步骤、示例及注意事项,语言简洁明了。🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
9-9: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4(MD001, heading-increment)
73-73: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4(MD001, heading-increment)
src/sites/sites-react/doc/App.scss (1)
1-255
: 整体 SCSS 文件结构清晰
使用嵌套命名与变量提高了整体代码的可维护性,各部分样式划分明确。请参考以上建议修正细节问题。src/sites/sites-react/doc/docs/taro/contributing-react.en-US.md (1)
1-130
: 整体贡献指南文档结构清晰
文档系统地介绍了贡献流程、提交标准、PR 流程及知识分享等内容,覆盖面较广。请根据以上建议调整部分语言和标点使用,使文档更加严谨和易读。🧰 Tools
🪛 LanguageTool
[style] ~10-~10: Consider a shorter alternative to avoid wordiness.
Context: ...elp the community. ## code of conduct In order to ensure a good network environment and c...(IN_ORDER_TO_PREMIUM)
[formatting] ~27-~27: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...elopment information as much as possible, because the more comprehensive the information,...(COMMA_BEFORE_BECAUSE)
[misspelling] ~35-~35: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...lper/?repo=jdf2e/nutui-react) to submit a issue of adding new features. ...(EN_A_VS_AN)
[uncategorized] ~59-~59: Possible missing preposition found.
Context: ...problem has been solved, and associated the corresponding issue link on github ## ...(AI_HYDRA_LEO_MISSING_TO)
src/packages/uploader/doc.en-US.md (2)
110-110
: accept 属性链接格式检查
说明已更新,但请确定链接文本格式符合 Markdown 标准,如无误可忽略此建议。
118-118
: onOversize 属性函数签名
描述与类型定义符合预期,请确认函数参数在组件中使用时能够满足需求。package.json (6)
55-55
: 新增开发脚本 "dev:site:taro" 检查
此脚本通过 tsc 编译及使用 vite 指定 Taro 配置进行开发构建,请验证该命令在当前项目目录下能否正确执行,并确保依赖配置无误。
68-69
: 新增构建脚本 "build:demo" 与 "build:demo:jmapp"
构建命令已增加检查步骤及环境变量传递。建议确认 vite.config.demo.ts 是否存在且配置正确,同时核查 VITE_APP_PROJECT_ID 环境变量的传递。
70-70
: 新增构建脚本 "build:taro:demo"
该脚本包含多个子命令(更新 Taro 入口、检查、生成页面等)。请核实各子命令的执行顺序及相互依赖性,避免因命令顺序错误导致构建失败。
71-71
: 新增 "build:site" 构建脚本
使用 vite.build 指定 vite.config.site.ts,请确保该配置文件已更新并符合最新项目需求。
72-72
: 新增 "build:taro:site" 构建脚本
此命令指定 vite.config.site.taro.ts 进行构建,建议验证配置是否与当前项目结构匹配。
73-75
: 新增 JMAPP 环境相关构建脚本
这三条命令分别为 JD/Taro 和 JMAPP 项目环境定制的 demo 构建脚本,建议仔细检查各命令中的环境变量(如 VITE_APP_PROJECT_ID、JD 标志)及路径是否正确,确保在不同环境下均能正常构建。src/sites/theme/components/header/header.scss (2)
211-218
: 红色主题下下拉选择背景图路径调整
将背景图片路径修改为相对路径"../../../assets/images/icon-select-white-down.png"
及对应的向上状态路径已更新,请确认调整后的路径在项目目录结构中正确无误,并确保图片资源加载正常。
368-377
: 黑色主题下下拉选择背景图路径调整
与红色主题类似,黑色主题部分背景图的路径已由原路径调整为"../../../assets/images/icon-select-white-down.png"
和"../../../assets/images/icon-select-white-up.png"
,建议验证在当前主题下图片是否能正确显示。src/sites/sites-react/doc/docs/taro/migrate-from-v1.md (1)
1-4
: 迁移指南标题部分
文档标题“从 v1 升级到 v2”明确表达了升级目标。建议检查语言流畅性,必要时可优化部分表达以便更好地指导开发者。src/sites/sites-react/doc/docs/taro/migrate-from-v2.md (8)
1-4
: 标题与介绍部分清晰。
文档开头以“从 v2 升级到 v3”为标题,并简明说明升级目的与范围,能让开发者快速了解文档意图。
5-11
: H5 安装步骤说明明确。
列出的第 1 步提供了 npm 安装命令,内容简洁且易于理解,指导性良好。
13-17
: Taro 安装指令说明。
文档展示了 Taro 环境下安装 NutUI React 的命令,代码块格式正确,无歧义。
28-33
: 组件样式处理及按需引入支持。
讲解了如何利用 Babel 插件实现按需载入 css 和 scss 文件,对 H5 端配置做了说明。建议核对配置与最新文档是否一致。
34-50
: H5 配置示例有效。
代码块中展示的 Babel 插件配置逻辑清楚,格式规范。请确认 JSON 配置项符合项目所需且文档中的注释描述与实际行为一致。
52-68
: Taro 配置示例完整。
展示了 Taro 下同样的按需引入配置,格式与 H5 示例保持一致,便于开发者参考。
70-80
: 类型导出与组件分类调整描述丰富。
关于更完善类型导出及对组件分类做出的说明,文字描述结构清晰,不过建议核对各组件的命名和分类是否与最新代码保持一致。
1-1000
: 总体评价。
这份升级指南详细介绍了所有关键步骤、配置示例和潜在的不兼容变化,对开发者升级至 NutUI React 3.x 提供了充分的信息。建议对部分语言表达做细微调整,以进一步提升文档的可读性和专业度。🧰 Tools
🪛 LanguageTool
[uncategorized] ~86-~86: “关于”组成的介词短语必需位于句首,或请改用"对于"代替。
Context: ...cons-react-taro) ,使其可以进行按需加载使用。 因此一些组件之前关于 Icon 的相关 Props 将被移除,需要使用插槽或者传递一个 Compon...(wb2)
[uncategorized] ~127-~127: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"命名
Context: ...0 版本中,我们重点对组件 API 进行了评审和修订,使属性和方法命名更贴合常用的命名习惯及 React 语言规范,目标希望开发者在使用组件时得心应手。我们的思路...(wb4)
src/sites/sites-react/doc/components/header/header.scss (11)
1-21
: Banner 样式良好。
.v3-banner
部分利用固定定位和渐变背景实现了醒目的顶部横幅,整体样式明确。建议在移动设备上验证该布局的适配性。
22-38
: Doc Header 样式合理。
通过嵌套和 SCSS 变量(如$doc-header-height
)实现了文档头部的布局,提升了样式的可维护性。请确保相关变量已在全局正确定义。
91-156
: 导航部分样式设计优秀。
采用 Flex 布局对导航项进行对齐,层次结构分明,样式明确。建议统一使用的长度单位,并在不同浏览器下进行充分测试。
157-197
: Header Select 组件样式清晰。
.header-select
相关样式分区合理,能够清晰管理下拉选择组件的各个状态。建议留意 hover 及激活后的交互反馈。
199-265
: 红色主题样式配置。
针对红色主题的.doc-header-red
配置,通过 SCSS 变量管理背景和文字颜色,使得主题风格统一。请确认所有变量(如$theme-red-header-bg
、$theme-red-word
)与系统其他部分一致。
405-407
: 白色主题样式设置。
白色主题部分利用全局变量定义背景、文字及边框颜色,配置清晰。建议检查这些变量在项目中的定义与更新。
609-812
: 黑色主题样式配置。
黑色主题采用严谨的变量配置和图片地址设定,整体风格符合预期。建议核实各个 URL 与变量(如$theme-black-select-hover
)的正确性并测试在深色环境下的显示效果。
813-841
: 转场动画效果设置。
Fade 动画类定义清晰,过渡时间设定合理。建议根据实际使用场景调整动画持续时间以获得更平滑的效果。
842-951
: 站点指南数据样式配置。
.site-guid-data
部分通过详细的内边距、边框及响应式定位设置,实现了指南数据区域的视觉展示。建议关注在不同屏幕尺寸下的显示效果,确保响应式设计无遗漏。
961-975
: 导航与标题文本样式。
.nav-item-title
和.header
部分通过 Flex 布局有效对齐文本,风格整洁。建议在多种浏览器中检查对齐效果,并保持统一的字体权重和大小。
975-997
: 辅助类及文本样式。
.plat
、.list
和.content
类定义了辅助布局和文本细节,语义明确。建议关注与其它模块在全局样式中可能存在的冲突,并考虑使用自动前缀工具。src/sites/sites-react/doc/docs/taro/intro-react.md (6)
1-4
: 文档标题与介绍部分。
文档开头简明扼要地介绍了 NutUI-React 组件库的定位及优势,有助于读者迅速理解项目核心价值。
5-18
: 特性列表详尽。
通过图标和简洁的条目列举出组件库的主要特性,能够直观传达产品卖点。建议定期核对特性描述,确保与最新产品功能保持一致。
19-22
: 扫码体验部分。
包含的二维码图片已设置合适的 alt 文本,有利于无障碍访问。建议在不同分辨率下检查图像显示效果。
23-28
: 版本说明信息完善。
版本信息表格清晰展示了支持的框架和兼容性,帮助用户快速了解使用条件。建议确认徽章和链接均为最新状态。🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
27-27: Images should have alternate text (alt text)
null(MD045, no-alt-text)
29-36
: 贡献者显示良好。
通过链接展示贡献者列表,既提升了透明度又激励社区参与,建议保持此模块的动态更新。
37-40
: 开源协议说明。
对 MIT 协议的说明简洁明确,使开源条款清晰易懂,符合业内常见的开源文档规范。
], | ||
}), | ||
], | ||
plugins: [atImport({ path: join(__dirname, 'src`') })], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修复 path: join(__dirname, 'src
')` 中的字符串不完整问题。
这里的 'src\`` 带有多余的反引号,可能导致路径拼接出错。建议改为
'src'`:
- plugins: [atImport({ path: join(__dirname, 'src`') })],
+ plugins: [atImport({ path: join(__dirname, 'src') })],
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
plugins: [atImport({ path: join(__dirname, 'src`') })], | |
plugins: [atImport({ path: join(__dirname, 'src') })], |
plugins: [ | ||
{ | ||
enforce: 'pre', | ||
...mdx.default({ | ||
providerImportSource: '@mdx-js/react', | ||
mdExtensions: [], | ||
mdxExtensions: ['.md'], | ||
remarkPlugins: [remarkGfm.default, remarkDirective.default], | ||
}), | ||
}, | ||
{ | ||
name: 'test', | ||
apply: 'serve', | ||
async load(id: string) { | ||
if (id.endsWith('.scss')) { | ||
// 移除 @import 语句 | ||
const filePath = resolve(process.cwd(), id) | ||
const scssCode = await readFileSync(filePath, 'utf-8') | ||
const modifiedCode = scssCode.replace( | ||
/@import\s+['"](\.{2}?\/)[^'".]+(.s?css)['"];/g, | ||
'' | ||
) | ||
return modifiedCode | ||
} | ||
}, | ||
}, | ||
|
||
reactRefresh(), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除 await
修饰符并确保同步读文件操作可接受。
readFileSync
为同步方法,不返回 Promise。使用 await
无效果,且同步操作可能在大量文件被加载时阻塞服务。可考虑使用 fs/promises
异步读文件方式,或确认此处对性能影响可接受:
const scssCode = readFileSync(filePath, 'utf-8')
若后续项目扩容,可优化为异步方案并加入缓存。
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
plugins: [ | |
{ | |
enforce: 'pre', | |
...mdx.default({ | |
providerImportSource: '@mdx-js/react', | |
mdExtensions: [], | |
mdxExtensions: ['.md'], | |
remarkPlugins: [remarkGfm.default, remarkDirective.default], | |
}), | |
}, | |
{ | |
name: 'test', | |
apply: 'serve', | |
async load(id: string) { | |
if (id.endsWith('.scss')) { | |
// 移除 @import 语句 | |
const filePath = resolve(process.cwd(), id) | |
const scssCode = await readFileSync(filePath, 'utf-8') | |
const modifiedCode = scssCode.replace( | |
/@import\s+['"](\.{2}?\/)[^'".]+(.s?css)['"];/g, | |
'' | |
) | |
return modifiedCode | |
} | |
}, | |
}, | |
reactRefresh(), | |
], | |
plugins: [ | |
{ | |
enforce: 'pre', | |
...mdx.default({ | |
providerImportSource: '@mdx-js/react', | |
mdExtensions: [], | |
mdxExtensions: ['.md'], | |
remarkPlugins: [remarkGfm.default, remarkDirective.default], | |
}), | |
}, | |
{ | |
name: 'test', | |
apply: 'serve', | |
async load(id: string) { | |
if (id.endsWith('.scss')) { | |
// 移除 @import 语句 | |
const filePath = resolve(process.cwd(), id) | |
- const scssCode = await readFileSync(filePath, 'utf-8') | |
+ const scssCode = readFileSync(filePath, 'utf-8') | |
const modifiedCode = scssCode.replace( | |
/@import\s+['"](\.{2}?\/)[^'".]+(.s?css)['"];/g, | |
'' | |
) | |
return modifiedCode | |
} | |
}, | |
}, | |
reactRefresh(), | |
], |
style={{ display: searchList.length > 0 ? 'block' : 'none' }} | ||
> | ||
{searchList.map((item: any, index) => { | ||
console.log(item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
移除生产环境中的 console.log
建议移除渲染方法中的 console.log 语句,避免在生产环境中输出调试信息。
- console.log(item)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
console.log(item) |
const guideTaroRoutes: any[] = [] | ||
const guideEnTaroRoutes: any[] = [] | ||
for (const path in modulesPage) { | ||
let name = (/packages\/(.*)\/doc\.md/.exec(path) as any[])[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
改进类型安全性
多处使用 as any[]
进行类型断言可能导致运行时错误。建议使用更严格的类型定义或正则表达式捕获组类型。
- let name = (/packages\/(.*)\/doc\.md/.exec(path) as any[])[1]
+ const match = /packages\/(.*)\/doc\.md/.exec(path)
+ if (!match) throw new Error(`Invalid path format: ${path}`)
+ const name = match[1]
Also applies to: 26-26, 37-37, 52-52, 62-62, 71-71, 80-80
<li key={Math.random()}> | ||
<NavLink | ||
key={Math.random()} | ||
className={({ isActive, isPending }) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
避免使用随机值作为 key
在列表渲染中使用 Math.random()
作为 key 可能会导致不必要的重渲染和性能问题。建议使用稳定的唯一标识符。
- <li key={Math.random()}>
+ <li key={cp.name}>
<NavLink
- key={Math.random()}
+ key={`${cp.name}-link`}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<li key={Math.random()}> | |
<NavLink | |
key={Math.random()} | |
className={({ isActive, isPending }) => | |
<li key={cp.name}> | |
<NavLink | |
key={`${cp.name}-link`} | |
className={({ isActive, isPending }) => |
```json | ||
// Webpack .babelrc or babel.config.js configuration | ||
plugins: [ | ||
[ | ||
“import”. | ||
{ | ||
libraryName: “@nutui/nutui-react”, libraryDirectory: “dist/esm”, { | ||
libraryDirectory: “dist/esm”, { | ||
style: 'css', | ||
camel2DashComponentName: false, | ||
}. | ||
“nutui-react”. | ||
] | ||
] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON 配置示例存在格式问题
在 Webpack 配置示例中出现了非标准引号(如“和”)以及重复的对象结构,建议改为标准 JSON 格式,例如使用双引号 ("") 包裹字符串,并移除多余的结构,以便用户能够直接复制使用。
```json | ||
// Configured in Webpack .babelrc or babel.config.js | ||
plugins: [ | ||
[ | ||
“import”. | ||
{ | ||
libraryName: “@nutui/nutui-react-taro”, libraryDirectory: “dist/esm”, { | ||
libraryDirectory: “dist/esm”, { | ||
style: 'css', | ||
camel2DashComponentName: false, | ||
}. | ||
“nutui-react-taro”. | ||
] | ||
] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taro 配置示例建议核对
Taro 配置示例中也存在引号及格式问题,同时注释部分提到的 “ass-loader” 应为 “sass-loader”。建议统一格式,并核对配置示例确保其可直接应用。
| ||
|
||
If you want to help develop new features and components, Can scan [qr code] (HTTP: / / https://img13.360buyimg.com/imagetools/s300x300_jfs/t1/187308/9/29678/349561/634fa983E93012590/a641089fdfed5911 .png) join our community co-building group. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新功能部分中 QR 码链接需修正
该部分建议展示贡献新功能的方式,但当前 QR code 链接中存在多余空格(例如 “HTTP: / / https://... .png”),请修正为正确的 URL 格式,确保链接可以正常访问。
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
39-39: Bare URL used
null
(MD034, no-bare-urls)
3. 处理不兼容更新 | ||
|
||
从 NutUI React 1.x 到 NutUI React 2.x 存在一些不兼容更新,需要仔细阅读不兼容更新内容,并依次处理。 | ||
|
||
你可以手动对照下面的列表逐条检查代码进行修改,另外,我们也提供了一个 codemod cli 工具 @nutui/nutui-react-codemod 以帮助你快速升级到 v2 版本。在运行 codemod cli 前,请先提交你的本地代码修改。 | ||
|
||
4. 主题变量更名: | ||
如,primary-color 更名为 color-primary;注意在使用自定义主题,特别是使用 ConfigProvider 组件的情况下,有没有使用 `nutuiBrandColor`,这时记得更名为 `nutuiColorPrimary` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
处理不兼容更新与主题变量更名说明
此部分内容详细说明了升级步骤和主题变量名称的变更,建议适当增加示例代码或对变化项进行分组描述,以减轻阅读负担,并确保每个步骤的描述清晰具体。
站点迁移
Summary by CodeRabbit