eslint-plugin-comment-policy 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Namespace: `comment-policy/`. Plugin scope (`meta.name`): `cyberash`.
|
|
|
17
17
|
| `comment-policy/no-comment-narrative` | change-narrative / history prose (`renamed from`, `previously`, `v1.2`, bare ISO dates, …) | no |
|
|
18
18
|
| `comment-policy/no-comment-code-snippet` | a code snippet (usage example) inside a comment | yes (only when the block is entirely code) |
|
|
19
19
|
| `comment-policy/no-consecutive-comments` | several stand-alone comments stacked one after another (more than `max`) | no |
|
|
20
|
-
| `comment-policy/no-decorative-comment` | decorative / section markers (`=====`, `#region`, `===text
|
|
20
|
+
| `comment-policy/no-decorative-comment` | decorative / section markers, ASCII and Unicode (`=====`, `#region`, `===text===`, `────`, `══ text ══`) | yes |
|
|
21
21
|
| `comment-policy/no-line-comment` | any `//` comment; requires `/* */` | yes (converts and merges runs of `//`) |
|
|
22
22
|
|
|
23
23
|
A **comment block** is a run of consecutive full-line `//` comments separated
|
|
@@ -129,7 +129,9 @@ when its prose contains `*/` (which would terminate the block early).
|
|
|
129
129
|
## Notes
|
|
130
130
|
|
|
131
131
|
- `no-decorative-comment` detects markers by content in both `//` and `/* */`
|
|
132
|
-
comment forms.
|
|
132
|
+
comment forms. The divider charset covers ASCII (`= * # _ - ~`) and Unicode
|
|
133
|
+
box-drawing / dash runs (`─ ━ ═ │ ┃ ║`, en/em-dash), so banners like
|
|
134
|
+
`/* ── Section ────── */` are caught; a single such glyph inside prose is not.
|
|
133
135
|
- ESLint applies non-overlapping fixes per pass and re-lints, so a block that is
|
|
134
136
|
both a code snippet and a line comment is resolved across passes.
|
|
135
137
|
|
package/dist/index.cjs
CHANGED
|
@@ -358,10 +358,11 @@ const rule$2 = {
|
|
|
358
358
|
};
|
|
359
359
|
//#endregion
|
|
360
360
|
//#region src/lib/decorative.ts
|
|
361
|
+
const DIV = "=*#_~\\-\\u2013\\u2014\\u2500-\\u257F";
|
|
361
362
|
const DECORATIVE = [
|
|
362
|
-
|
|
363
|
+
new RegExp(`^[${DIV}]{3,}$`),
|
|
363
364
|
/^#?\s*(?:region|endregion)\b/i,
|
|
364
|
-
|
|
365
|
+
new RegExp(`^[${DIV}]{2,}.*[${DIV}]{2,}$`)
|
|
365
366
|
];
|
|
366
367
|
function isDecorativeLine(content) {
|
|
367
368
|
return content.length > 0 && DECORATIVE.some((re) => re.test(content));
|
package/dist/index.mjs
CHANGED
|
@@ -358,10 +358,11 @@ const rule$2 = {
|
|
|
358
358
|
};
|
|
359
359
|
//#endregion
|
|
360
360
|
//#region src/lib/decorative.ts
|
|
361
|
+
const DIV = "=*#_~\\-\\u2013\\u2014\\u2500-\\u257F";
|
|
361
362
|
const DECORATIVE = [
|
|
362
|
-
|
|
363
|
+
new RegExp(`^[${DIV}]{3,}$`),
|
|
363
364
|
/^#?\s*(?:region|endregion)\b/i,
|
|
364
|
-
|
|
365
|
+
new RegExp(`^[${DIV}]{2,}.*[${DIV}]{2,}$`)
|
|
365
366
|
];
|
|
366
367
|
function isDecorativeLine(content) {
|
|
367
368
|
return content.length > 0 && DECORATIVE.some((re) => re.test(content));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-comment-policy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "ESLint rules enforcing a per-file comment policy: prose-line caps, no change-narrative, no code snippets, no decorative markers, block comments only (JS + TS).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|