1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VSCode: JSON を開いてもエラーが出ないようにする。JSON with comments

Posted at

背景

node や TypeScript を触るようになると、設定ファイル関連で JSON ファイルをよく開くようになる

設定ファイルでもコメントが残したい。

で、残すとなると、JSON ファイルでのエラーはやっぱりうざいなぁ・・と思った

こういうやつね
image.png

既に VS Code で対応されてたので、設定いじるだけだった

結論

設定変更を以下のようにすることで
json を開く際に、JSON with comments とさせられる。

"files.associations": { "*.json": "jsonc" }

CTRL + SHIFT + P 、で、settings.json を開いて、
image.png

適当に追加して保存すると
image.png

無事消えます
image.png

以下に記載有り

設定 json について

設定を全部覚えられるか? 自分には無理。

故に、最近は初期化で全設定がコメントで定義されるようになってきてる印象

例えば、

  • tsc --init
  • api-extractor init

って・・あれ? Microsoft が推進してる?

あとがき

jsdoc で文書生成しようとしたら、typedoc の方が良さそうに思えて調べたら・・
tsdoc になって・・api-extractor・・・

技術に疎いと、どの技術を使えばいいのかを悩んで試行してる時間が無駄に感じますね・・ :cry:

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?