I have spaced-comment in my configuration for ESLint to enforce spacing in comments but cannot determine how to add VSCode's folding regions comments to the exceptions array.
ESLint config:
"spaced-comment": [ "error", "always", {
"line": {
"exceptions": ["#region", "#endregion", "region", "endregion"]
}
}]
Source code
//#region My region
//#endregion My region
or
//region My region
//endregion My region
Message from ESLint:
Expected exception block, space or tab after '//' in comment.
Expectation: ESLint should allow me to use commented VSCode folding regions without forcing me to add a space between // and #region.
You can solve this by using markers instead of exceptions:
"spaced-comment": [ "error", "always", {
"line": {
"markers": ["#region", "#endregion", "region", "endregion"]
}
}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With