Handling non-js files with prettier
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, typescript
调研方向
先从当前的 prettier 功能和 index.html 开始,然后查看 issue #176,了解相关增强功能的讨论。完成的标准是根据文件扩展名选择 parser、对不支持的文件隐藏按钮,并公开 formatting-failed 状态,而不是静默失败。
由索引模型根据 Issue 内容生成。
描述
Relates to issue #176 (prettier enhancements)
Currently our prettier functionality only handles JS files as it always uses babylon (which should now be babel, I believe). Formatting for json, typescript and more just fails silently. I'm working on prettier enhancements which will address this issue. See below for an outline of how I'm tackling the issue. Open for discussion now and/or when my PR comes in.
Current plan:
- Check current file extension and use that to set a valid non-custom parser option by updating the parser name and loading the necessary script on click (loaded from this list of prettier parsers)
- Less sure of this one: Keep prettier and the babel/babylon parser loaded (but via 'async') in the head of
index.htmlas they'll be used a lot. - Hide the prettier button if we're in a file with an extension that we cannot prettify
- In addition to
formattinganddonestate, add aformatting failedstate to the prettier button (current state changes in a local branch on my machine. Relates to discussion in #176 )
- 主要语言
- JavaScript
- 星标
- 307
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FormidableLabs/runpkg 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
FormidableLabs/runpkg#209 · 4 条评论 ·
-
improvement
难度 4/5 3-5 天 新手友好度 35/100
FormidableLabs/runpkg#181 ·
-
Prettier enhancements: feedback/state & options可能重新可做 @kiraarghy 于 2472 天前认领,目前没有进行中的 PR。 未关闭
FormidableLabs/runpkg#176 · 1 条评论 · 已指派 3 人 ·
-
"Contributing" doc可能重新可做 @kiraarghy 于 2472 天前认领,目前没有进行中的 PR。 未关闭
FormidableLabs/runpkg#174 · 1 条评论 · 已指派 2 人 ·
-
难度 3/5 1-2 天 新手友好度 35/100
FormidableLabs/runpkg#172 · 1 条评论 ·
查看 FormidableLabs/runpkg 的全部 Issue
相似的 Issue
-
good first issue
难度 2/5 1-3 小时 新手友好度 86/100
Riloox/hostkind-open#45 ·
-
Request: semgrep未关闭new icon permissions in review
难度 2/5 1-3 小时 新手友好度 72/100
simple-icons/simple-icons#15093 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
module-federation/core#5205 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
aikido security:critical
难度 1/5 1 小时以内 新手友好度 76/100
dequelabs/monitor-utility#63 ·