コードブロックの言語指定ガイドラインを追加しました#1056
Merged
Merged
Conversation
## 概要 コードブロックの言語指定について、執筆者向けガイドラインを`docs/writing/markdown.md`に追加しました。 ## 変更内容 - コードブロックは常に`ts twoslash`を使用することを明記 - TypeScriptでコンパイルエラーになるJSコードには`// @noErrors`を使用 - `@noErrors`でも回避できない場合に限り`js`を使用(最終手段) ## 背景 #733 の対応中に、JSコードのコードブロックを`js`とするか`ts`とするかが話題になりました。twoslashを使うとビルド時にTypeScriptコンパイラによるエラーチェックが行われ、サンプルコードの品質を保てるため、基本的に`ts twoslash`を使う方針としました。 Close #755
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
コードブロックの言語指定について、執筆者向けガイドラインを
docs/writing/markdown.mdに追加しました。変更内容
ts twoslashを使用することを明記// @noErrorsを使用@noErrorsでも回避できない場合に限りjsを使用(最終手段)背景
#733 の対応中に、JSコードのコードブロックを
jsとするかtsとするかが話題になりました。twoslashを使うとビルド時にTypeScriptコンパイラによるエラーチェックが行われ、サンプルコードの品質を保てるため、基本的にts twoslashを使う方針としました。Close #755
Note
Adds authoring guidelines for code block language selection in
docs/writing/markdown.md.コードブロックの言語指定section mandatingts twoslashfor all code samples (including JS) to enable TS compile-time checks// @noErrorsfor JS-valid but TS-erroring snippets, and allowingjsonly as a last resort when errors can't be avoidedWritten by Cursor Bugbot for commit 1ba9ef1. This will update automatically on new commits. Configure here.