-
Notifications
You must be signed in to change notification settings - Fork 7
chore: forbid rc deep imports #54
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,20 +35,22 @@ | |
| "tsc": "tsc --noEmit" | ||
| }, | ||
| "dependencies": { | ||
| "@rc-component/util": "^1.3.0" | ||
| "@rc-component/util": "^1.11.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@rc-component/father-plugin": "^2.0.2", | ||
| "@rc-component/father-plugin": "^2.2.0", | ||
| "@rc-component/np": "^1.0.4", | ||
| "@types/jest": "^29.5.0", | ||
| "@types/node": "^24.5.2", | ||
| "@types/react": "^18.0.0", | ||
| "@types/react-dom": "^18.0.0", | ||
| "@types/warning": "^3.0.0", | ||
| "@typescript-eslint/eslint-plugin": "^5.62.0", | ||
| "@typescript-eslint/parser": "^5.62.0", | ||
|
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# 验证 ESLint 配置是否能正常加载和解析
# 测试 ESLint 能否成功解析配置文件
npx eslint --print-config .eslintrc.js > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "✓ ESLint 配置加载成功"
else
echo "✗ ESLint 配置加载失败"
npx eslint --print-config .eslintrc.js
fiRepository: react-component/context Length of output: 456 🏁 Script executed: cat -n package.json | sed -n '40,60p'Repository: react-component/context Length of output: 859 🏁 Script executed: cat -n .eslintrc.jsRepository: react-component/context Length of output: 1023 🏁 Script executed: rg "prettier|eslint-config" package.jsonRepository: react-component/context Length of output: 49 🏁 Script executed: rg "eslint-config-prettier|prettier" . -t js -t json --max-count=5Repository: react-component/context Length of output: 49 🏁 Script executed: # 检查 `@umijs/fabric` 的实际依赖
npm info `@umijs/fabric`@4.0.0 peerDependencies 2>/dev/null || echo "检查package-lock或yarn.lock"Repository: react-component/context Length of output: 92 🏁 Script executed: # 检查是否存在 package-lock.json 或 yarn.lock
ls -la package-lock.json yarn.lock 2>/dev/null || echo "No lock files found"Repository: react-component/context Length of output: 87 ESLint 配置加载失败,原因为缺少 ESLint 配置无法加载,错误信息指出缺少 "prettier" 配置。 🤖 Prompt for AI Agents |
||
| "@umijs/fabric": "^4.0.0", | ||
| "dumi": "^2.0.15", | ||
| "eslint": "^8.54.0", | ||
| "eslint-plugin-jest": "^28.2.0", | ||
| "eslint-plugin-jest": "^27.9.0", | ||
| "eslint-plugin-unicorn": "^52.0.0", | ||
| "father": "^4.0.0", | ||
| "rc-test": "^7.0.14", | ||
|
|
@@ -57,7 +59,7 @@ | |
| "typescript": "^5.0.2" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": ">=16.9.0", | ||
| "react-dom": ">=16.9.0" | ||
| "react": ">=18.0.0", | ||
| "react-dom": ">=18.0.0" | ||
|
Comment on lines
+62
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| } | ||
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.
🧩 Analysis chain
🌐 Web query:
Does@rc-component/utilversion 1.11.0 export supportRef, isEqual, useEvent, and useLayoutEffect from the package root?💡 Result:
No,
@rc-component/utildoes not export supportRef, isEqual, useEvent, or useLayoutEffect directly from the package root [1][2]. These utilities are located within subdirectories of the package and must be imported via specific paths [1][2][3]. Based on the package structure, they are typically found under the lib/hooks/ or lib/Dom/ directories [1][2]. For example: - useEvent and useLayoutEffect are located in lib/hooks/ [1][2]. - Other utilities like supportRef or isEqual are similarly nested within the package's internal structure rather than being exposed at the top level [1][2]. To use these utilities, you should use path-based imports, such as: import { useEvent } from '@rc-component/util/lib/hooks/useEvent'; import { useLayoutEffect } from '@rc-component/util/lib/hooks/useLayoutEffect'; Note that as of May 15, 2026, the latest stable version of@rc-component/utilis 1.10.0 [4][5]. Version 1.11.0 has not been released [1][4].Citations:
@rc-component/util版本 1.11.0 不存在,且导出结构不支持从根路径导入。@rc-component/util的最新稳定版本为 1.10.0(截至 2026 年 5 月),版本 1.11.0 尚未发布。此外,supportRef、isEqual、useEvent和useLayoutEffect不是从包根路径导出的,而是位于嵌套目录中,需要通过特定的路径导入,例如:@rc-component/util/lib/hooks/useEvent和@rc-component/util/lib/hooks/useLayoutEffect。请更正依赖版本并根据实际包结构调整导入路径。🤖 Prompt for AI Agents