microsoft / microsoft/node-jsonc-parser
insertSpaces formatting option doesn't always work
オープン
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 759
- フォーク
- 66
- 平均マージ
- 5日 10時間
- マージ済み PR(30日)
- 7
説明
Steps to reproduce. Run the following program using ts-node or similar.
import { format, applyEdits } from 'jsonc-parser';
const JSONString = `{"hello": \t"\tworld"}`;
const edit = format(JSONString, undefined, { insertSpaces: true});
const res = applyEdits(JSONString, edit);
console.log(res);
We would expect the following output
{
"hello": " world"
}
But we actually get
{
"hello": " world"
}
Interestingly, if we remove the tab inside the quotes, the tab outside is removed as expected. This seems like an error since formatting should only care about tabs outside quotes.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された ts-node の再現コードを実行し、format と applyEdits のエントリポイントを追跡します。引用符で囲まれた値の内部にあるタブと、インデント用のタブが併存するケースを対象としたリグレッションテストを追加し、フォーマットによって引用符の外側にあるタブだけが削除されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100