From b630efaa99622394bb3d48c119f68bf8d83f61d5 Mon Sep 17 00:00:00 2001 From: Oleg Artene Date: Tue, 26 Mar 2019 23:04:44 +0200 Subject: [PATCH 1/2] Skip `//region` (without `#`) --- src/rules/commentFormatRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/commentFormatRule.ts b/src/rules/commentFormatRule.ts index 5665678897e..08d1fbc510d 100644 --- a/src/rules/commentFormatRule.ts +++ b/src/rules/commentFormatRule.ts @@ -181,7 +181,7 @@ function walk(ctx: Lint.WalkContext) { } const commentText = fullText.slice(start, end); // whitelist //#region and //#endregion and JetBrains IDEs' "//noinspection ..." - if (/^(?:#(?:end)?region|noinspection\s)/.test(commentText)) { + if (/^(?:#?(?:end)?region|noinspection\s)/.test(commentText)) { return; } From c541ec5bf56e9221583fd949356ff94488a1aae4 Mon Sep 17 00:00:00 2001 From: Oleg Artene Date: Wed, 27 Mar 2019 00:03:51 +0200 Subject: [PATCH 2/2] Update info comment about JetBrains //region --- src/rules/commentFormatRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/commentFormatRule.ts b/src/rules/commentFormatRule.ts index 08d1fbc510d..47ade09cd9f 100644 --- a/src/rules/commentFormatRule.ts +++ b/src/rules/commentFormatRule.ts @@ -180,7 +180,7 @@ function walk(ctx: Lint.WalkContext) { return; } const commentText = fullText.slice(start, end); - // whitelist //#region and //#endregion and JetBrains IDEs' "//noinspection ..." + // whitelist //#region and //#endregion and JetBrains IDEs' "//noinspection ...", "//region", "//endregion" if (/^(?:#?(?:end)?region|noinspection\s)/.test(commentText)) { return; }