spaced-comment我的配置中有ESLint强制注释中的间距,但无法确定如何将 VSCode 的折叠区域注释添加到exceptions数组中。
ESLint 配置:
"spaced-comment": [ "error", "always", {
"line": {
"exceptions": ["#region", "#endregion", "region", "endregion"]
}
}]
Run Code Online (Sandbox Code Playgroud)
源代码
//#region My region
//#endregion My region
or
//region My region
//endregion My region
Run Code Online (Sandbox Code Playgroud)
来自 ESLint 的消息:
Expected exception block, space or tab after '//' in comment.
Run Code Online (Sandbox Code Playgroud)
期望:ESLint 应该允许我使用带注释的 VSCode 折叠区域,而不必强迫我在//和之间添加空格#region。
您可以通过使用markers而不是解决此问题exceptions:
"spaced-comment": [ "error", "always", {
"line": {
"markers": ["#region", "#endregion", "region", "endregion"]
}
}]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4147 次 |
| 最近记录: |