Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Prettier enhancements: feedback/state & options

未关闭
#176 1 条评论 0 个 reaction 已指派 3 人 在 GitHub 查看

@kiraarghy 已经在做这个了。

开始于 2020年1月13日。

评估

这个 Issue 还没有评估数据。

描述

I think it would be useful to have some discussion about the prettier functionality on runpkg. Some points to start with:

  1. Button press feedback
  2. Undo option
  3. Basic config options

1: button press feedback and state

Currently it can be hard to tell that any formatting has taken place. Although this function (prettier.format) isn't async, I think some state handling (including start & finish state) in the UI would be helpful. In my mind, possible states to alert the user to are:

  • start format
  • finish/successful format
  • finished format with no change (prettier.format(fileData.code, opts) === fileData.code)
  • error
  • format reverted (see point number 2)

These states could be signified with text, icons and/or toast messages. Preferences? I would lean towards (accessibly) icons possibly enhanced with toast messages.

2: undo format

I think it would be useful to be able to revert the code formatting without having to refresh the page. I'm happy to implement it in a PR. Any objections? Any opinions on how to represent this has successfully run in the context of point number 1 (above)?

3: basic config

This is a trickier and more subjective feature IMO: one one hand, prettier is supposed to be opinionated, but - on the other - it does provide certain config options (quotes, semi...) for a reason. Do we want to allow users to select basic config options? E.g. currently we use the default options which include singleQuote: false which means that something like lodash-es/add only changes on format due to single -> double quotes rather than any major formatting issues.

主要语言
JavaScript
星标
307
派生
9
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FormidableLabs/runpkg 的其他 Issue

查看 FormidableLabs/runpkg 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。