Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Handling non-js files with prettier

オープン
#183 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, typescript
領域
frontend, tooling

調査の方向性

現在のprettierの機能とindex.htmlから始め、その後、関連する機能強化についての議論を確認するためにissue #176を確認します。ファイル拡張子でparserを選択し、サポートされていないファイルではボタンを非表示にし、黙って失敗するのではなくformatting-failed状態を公開できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug improvement

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:

  1. 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)
  2. Less sure of this one: Keep prettier and the babel/babylon parser loaded (but via 'async') in the head of index.html as they'll be used a lot.
  3. Hide the prettier button if we're in a file with an extension that we cannot prettify
  4. In addition to formatting and done state, add a formatting failed state 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FormidableLabs/runpkg のほかの issue

FormidableLabs/runpkg の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。