我在spaced-comment
中有此ESLint
配置,可以在注释中添加空格,但不能在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.
我的期望:ESLint允许我注释VSCode折叠区域,并停止迫使我在//
和#region
之间添加空格。
答案 0 :(得分:1)
您可以使用markers
代替exceptions
来解决此问题:
"spaced-comment": [ "error", "always", {
"line": {
"markers": ["#region", "#endregion", "region", "endregion"]
}
}]