我想写一个chrome extension ,所以我需要编写manifest.json
,不幸的是,IDE无法识别注释。
It is a JSON-formatted file, with one exception: it is allowed to contain "//"-style comments.
所以我很确定添加评论是可以的。
有没有办法让编辑器识别manifest.json
的注释?
最佳答案
您可以使用以下方式,
{
"//1": "comment 1",
"//2": "comment 2",
"id": "123"
}
👆参见:https://stackoverflow.com/a/44700108/9935654
但我认为最好的方法是将识别的文件类型
更改为json5
关于json - 添加对 "manifest.json"的评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68315163/