我在ESLint
中有这个spaced-comment
配置来强制在注释中使用空格,但是它不能对VSCode的folding regions注释执行exception
。
ESLint配置:
"spaced-comment": [ "error", "always", {
"line": {
"exceptions": ["#region", "#endregion", "region", "endregion"]
}
}]
源代码
//#region My region
//#endregion My region
or
//region My region
//endregion My region
来自ESLint的消息:
Expected exception block, space or tab after '//' in comment.
My expect: ESLint允许我注释VSCode折叠区域,并停止强制我在//
和#region
之间添加空格。
发布于 2020-09-10 15:13:43
您可以使用markers
而不是exceptions
来解决此问题
"spaced-comment": [ "error", "always", {
"line": {
"markers": ["#region", "#endregion", "region", "endregion"]
}
}]
https://stackoverflow.com/questions/62469552
复制相似问题