Add types for `require.context`
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, typescript
调研方向
首先阅读链接的 Metro-Context-Modules-Demo 仓库中 types/metroRequire.d.ts 的类型声明,然后找到 Metro 现有的内置类型定义。添加 require.context 定义,使其参数获得补全、错误检查和重构支持。当 Metro 用户报告的 NodeRequire 错误得到解决时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Do you want to request a feature or report a bug?
Feature request
Currently, Metro supports require.context, added in this PR, but it lacks built-in type definitions. This makes it more challenging to use require.context effectively as there's no code completion, error checking, or refactoring support for its arguments.
Property 'context' does not exist on type 'NodeRequire'.
Right now, I have to create a types file and add the following content from @EvanBacon's Metro-Context-Modules-Demo repo, having them included by default in Metro would be a great improvement.
Including type definitions for require.context would significantly improve the developer experience by enabling these features and making code using require.context more robust and maintainable.
- 主要语言
- JavaScript
- 星标
- 5.7k
- 派生
- 706
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 65
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react/metro 的其他 Issue
-
constant-folding-plugin emits 0/0 (NaN) for arithmetic on destructured bindings可能已有人在做 @cpruijsen 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 2 天内回复
-
难度 4/5 1-2 天 新手友好度 35/100
维护者通常 2 天内回复
-
[0.83.x] Backport micromatch removal and dotfile/multipart watcher fix together可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 2 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#4115 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
outline/outline#14348 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
area:install bug needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复