问题
今天用工具 idea打开项目中json文件,出现一堆红色标记“JSON standard does not allow comments. Use JSMin or similar tool to remove comments before parsing.”奇怪,json串没有错但是注释却爆红了,作为一个有着强迫症的程序猿,虽然不影响使用,但是影响心情啊,本着不能有任何错误提示的态度,开始了我的处理里程
解决方法
先点击idea工具setting设置,在Editor中找到File Types,在右侧找到JSON5,新增*.json 即可如图:
查看结果
再次查看json文件,注解报错提示消失,完美解决😁😁😁