Provide usage examples
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
調査の方向性
issue の TypeScript の例から始め、ライブラリの公開されている parse、modify、applyEdits のエントリポイントを確認します。JSONC ファイルの読み込み、パース、書き込みをカバーする、いくつかの分かりやすい例を追加し、示されているフォーマットと編集のフローも含めれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Already asked in https://github.com/microsoft/node-jsonc-parser/issues/74, but it was closed by the author.
The request still stands, it would be great to have a few examples to use the library to load/parse/write JSONC files.
I shouldn't need to ask LLMs how to use something, but thankfully it helped. Here's my tsconfig.json reference sorter:
import { readFile, writeFile } from "node:fs/promises";
import * as jsonc from "jsonc-parser";
const editsOptions = {
formattingOptions: { tabSize: 2, insertSpaces: true },
};
async function sortReferences(filePath) {
const contents = await readFile(filePath, "utf8");
const json = jsonc.parse(contents);
if (!json.references) {
return;
}
json.references.sort((a, b) => a.path.localeCompare(b.path));
const edits = jsonc.modify(
contents,
["references"],
json.references,
editsOptions,
);
const newContents = jsonc.applyEdits(contents, edits);
if (contents !== newContents) {
await writeFile(filePath, newContents);
console.log(`Sorted: ${filePath}`);
}
}
for (const filePath of process.argv.slice(2)) {
void sortReferences(filePath).catch((error) => {
throw new Error(`Error sorting references in ${filePath}`, {
cause: error,
});
});
}
- 主要言語
- TypeScript
- スター
- 759
- フォーク
- 66
- 平均マージ
- 5日 10時間
- マージ済み PR(30日)
- 7
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/node-jsonc-parser のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
microsoft/node-jsonc-parser#125 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
microsoft/node-jsonc-parser#105 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoft/node-jsonc-parser#103 · コメント 2 件 · リアクション 8 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/node-jsonc-parser#95 · リアクション 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
microsoft/node-jsonc-parser の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
area:tools bug good first issue help wanted priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
newrelic-experimental/preflight#793 · コメント 1 件 ·
-
bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BasedHardware/omi#15320 ·