Skip to content
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

Open
wants to merge 13 commits into
base: feat_v3.x
Choose a base branch
from

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Jan 22, 2025

站点迁移

Summary by CodeRabbit

  • 样式更新

    • 更新了多个 SCSS 文件的样式,包括 highlight.scssmd-style.scssreset.scssvariables.scss
    • 调整了颜色变量、字体、间距和布局样式
    • 新增了一些 CSS 类和选择器
  • 文档更新

    • 为 NutUI React 添加了多个新的文档文件
    • 包括快速开始、主题定制、国际化、迁移指南等文档
    • 新增了贡献指南和使用说明
  • 配置调整

    • 更新了路由配置
    • 修改了环境配置文件
    • 调整了基础配置和站点配置
  • 组件和功能增强

    • 添加了搜索组件
    • 优化了标题和导航组件
    • 改进了主题切换和语言选择功能

Copy link

coderabbitai bot commented Jan 22, 2025

概述

演练

这个拉取请求涉及 NutUI 文档站点的大规模更新,主要包括样式文件修改、配置文件调整和文档内容扩充。更新范围广泛,涵盖了 React 和 Taro 框架的文档、样式、配置和主题定制等多个方面。变更旨在提升文档的可读性、一致性和用户体验。

变更

文件路径 变更摘要
src/sites/assets/styles/* 样式文件更新,包括颜色变量、主题配置和样式规则的调整
src/sites/config/* 新增和更新站点配置,支持 React 和 Vue 框架
src/sites/doc/docs/react/* 新增和更新 React 文档,包括国际化、主题定制、迁移指南等
src/sites/doc/docs/taro/* 新增和更新 Taro 文档,内容与 React 文档类似
src/sites/doc/components/* 组件样式和交互逻辑的细微调整

可能相关的 PR

建议标签

size/XXL, 3.x

建议审阅者

xiaoyatong, oasis-cloud

诗歌

兔子的文档魔法,
样式如彩虹闪耀,
React 与 Taro 齐飞,
代码如诗歌绽放,
NutUI 的美好时代!
🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the 3.x label Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.59%. Comparing base (efc1d66) to head (3a8ad9b).
Report is 1 commits behind head on feat_v3.x.

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.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a 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: 建议优化国际化和路由处理

  1. 搜索框的占位符文本应该支持国际化,而不是硬编码的中文
  2. 组件路由路径应该通过配置或常量来管理,避免硬编码
+ 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: 建议优化图标实现方式

当前使用背景图片实现图标可能会导致以下问题:

  1. 增加额外的网络请求
  2. 不易于主题定制
  3. 图标尺寸调整不够灵活

建议考虑使用图标字体或 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 file

Also 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 file

Also 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 +bash

pnpm

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 +bash

pnpm

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:taro

Also 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: 建议优化属性定义章节的结构

当前的属性定义说明较为密集,建议:

  1. 使用表格形式展示属性命名变更示例
  2. 为每个命名规范添加明确的代码示例
  3. 将相似的变更规则分组展示

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: 建议优化文档的整体结构

为提升文档的可读性和实用性,建议:

  1. 在文档开头添加目录导航
  2. 为每个主要部分添加锚点链接
  3. 在重要的更改处添加升级示例
  4. 添加常见问题(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

📥 Commits

Reviewing files that changed from the base of the PR and between 96a4da5 and 3a8ad9b.

⛔ 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: 需要实现或移除空的事件处理函数

onfocusonblur 事件处理函数目前是空的。如果这些事件处理不是必需的,建议移除相关代码以减少不必要的复杂性。

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: 请确认隐藏滚动条的必要性

全局隐藏滚动条可能会影响用户体验,特别是在需要显示滚动位置的场景。

建议:

  1. 考虑仅在特定组件中应用此样式
  2. 为触摸设备提供滚动反馈
src/sites/doc/docs/react/theme-react.md (2)

59-60: 完善 sass-loader 配置说明

建议:

  1. 添加具体的版本对应关系说明
  2. 验证示例中的路径是否正确
✅ 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: 样式变量定义清晰合理

变量命名规范统一,颜色主题分类明确,代码结构组织良好。

src/sites/doc/components/search/search.tsx Show resolved Hide resolved
src/sites/doc/App.tsx Show resolved Hide resolved
src/sites/doc/App.tsx Show resolved Hide resolved
src/sites/doc/components/header/header.tsx Show resolved Hide resolved
src/sites/config/env.ts Show resolved Hide resolved
src/sites/doc/docs/react/start-react.en-US.md Show resolved Hide resolved
src/sites/doc/docs/taro/migrate-from-v2.md Show resolved Hide resolved
src/sites/doc/docs/react/intro-react.en-US.md Show resolved Hide resolved
src/sites/doc/docs/react/intro-react.en-US.md Show resolved Hide resolved
Copy link
Collaborator

@xiaoyatong xiaoyatong left a 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;
Copy link
Collaborator

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', '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个逻辑与现有逻辑不一致~ 修改的根目录,从h5改为 taro

@@ -14,26 +12,22 @@ type EnvConfig = {

const config: EnvConfig = {
baseUrl: '',
themeUrl: '',
isPrd: true, // 是否为线上
locales: ['zh-CN', 'zh-TW', 'en-US', 'th'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么要去掉多语言呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants