eslint-plugin-comment-policy 0.1.1 → 0.2.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/AGENTS.md +1 -2
- package/README.md +1 -9
- package/README.ru.md +1 -9
- package/dist/index.cjs +1 -25
- package/dist/index.mjs +1 -25
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -20,8 +20,7 @@ Five ESLint 9 (flat-config) rules enforcing a comment policy, namespace
|
|
|
20
20
|
export default [commentPolicy.configs.recommended];
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`recommended` turns **all five rules on at `error`** with defaults.
|
|
24
|
-
adds default `protectedPatterns` for spec-driven projects.
|
|
23
|
+
`recommended` turns **all five rules on at `error`** with defaults.
|
|
25
24
|
|
|
26
25
|
## Rule behavior an agent must know
|
|
27
26
|
|
package/README.md
CHANGED
|
@@ -40,15 +40,7 @@ import commentPolicy from "eslint-plugin-comment-policy";
|
|
|
40
40
|
export default [commentPolicy.configs.recommended];
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
`recommended` turns all five rules on at `error` with defaults.
|
|
44
|
-
`sdd` config that ships default `protectedPatterns` for spec-driven projects
|
|
45
|
-
(anchors `partition:TYPE-NNN`, `@covers`, short ids, milestones):
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
import commentPolicy from "eslint-plugin-comment-policy";
|
|
49
|
-
|
|
50
|
-
export default [commentPolicy.configs.sdd];
|
|
51
|
-
```
|
|
43
|
+
`recommended` turns all five rules on at `error` with defaults.
|
|
52
44
|
|
|
53
45
|
Or register the plugin and enable rules explicitly:
|
|
54
46
|
|
package/README.ru.md
CHANGED
|
@@ -40,15 +40,7 @@ import commentPolicy from "eslint-plugin-comment-policy";
|
|
|
40
40
|
export default [commentPolicy.configs.recommended];
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
`recommended` включает все пять правил на `error` с дефолтами.
|
|
44
|
-
`sdd` с дефолтными `protectedPatterns` для spec-driven проектов (анкоры
|
|
45
|
-
`partition:TYPE-NNN`, `@covers`, short-id, milestone):
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
import commentPolicy from "eslint-plugin-comment-policy";
|
|
49
|
-
|
|
50
|
-
export default [commentPolicy.configs.sdd];
|
|
51
|
-
```
|
|
43
|
+
`recommended` включает все пять правил на `error` с дефолтами.
|
|
52
44
|
|
|
53
45
|
Либо подключить плагин и включить правила вручную:
|
|
54
46
|
|
package/dist/index.cjs
CHANGED
|
@@ -389,21 +389,12 @@ const rule = {
|
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
391
|
//#endregion
|
|
392
|
-
//#region src/lib/sdd-patterns.ts
|
|
393
|
-
const TYPES = "BL|SUR|CON|INV|POL|DEL|DLT|NFR|REQ|MIG|CST|SCN|LCN|GAR|EXT";
|
|
394
|
-
const SDD_PROTECTED_PATTERNS = [
|
|
395
|
-
"@covers\\s+\\S+(?:\\s+\\w+=\\S+)*",
|
|
396
|
-
`\\b[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?::[a-z0-9]+(?:-[a-z0-9]+)*)*:(?:${TYPES})-\\d+\\b`,
|
|
397
|
-
`\\b(?:${TYPES})-\\d+\\b`,
|
|
398
|
-
"\\bM\\d+[A-Z]+-\\d+\\b"
|
|
399
|
-
];
|
|
400
|
-
//#endregion
|
|
401
392
|
//#region src/index.ts
|
|
402
393
|
const configs = {};
|
|
403
394
|
const plugin = {
|
|
404
395
|
meta: {
|
|
405
396
|
name: "cyberash",
|
|
406
|
-
version: "0.
|
|
397
|
+
version: "0.2.0"
|
|
407
398
|
},
|
|
408
399
|
rules: {
|
|
409
400
|
"max-comment-lines": rule$4,
|
|
@@ -427,20 +418,5 @@ configs.recommended = {
|
|
|
427
418
|
"comment-policy/no-line-comment": ["error"]
|
|
428
419
|
}
|
|
429
420
|
};
|
|
430
|
-
const sddProtected = [...SDD_PROTECTED_PATTERNS];
|
|
431
|
-
configs.sdd = {
|
|
432
|
-
plugins: { "comment-policy": plugin },
|
|
433
|
-
rules: {
|
|
434
|
-
"comment-policy/max-comment-lines": ["error", {
|
|
435
|
-
max: 4,
|
|
436
|
-
anchoredMax: 3,
|
|
437
|
-
protectedPatterns: sddProtected
|
|
438
|
-
}],
|
|
439
|
-
"comment-policy/no-comment-narrative": ["error", { protectedPatterns: sddProtected }],
|
|
440
|
-
"comment-policy/no-comment-code-snippet": ["error", { protectedPatterns: sddProtected }],
|
|
441
|
-
"comment-policy/no-decorative-comment": ["error", { protectedPatterns: sddProtected }],
|
|
442
|
-
"comment-policy/no-line-comment": ["error", { protectedPatterns: sddProtected }]
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
421
|
//#endregion
|
|
446
422
|
module.exports = plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -389,21 +389,12 @@ const rule = {
|
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
391
|
//#endregion
|
|
392
|
-
//#region src/lib/sdd-patterns.ts
|
|
393
|
-
const TYPES = "BL|SUR|CON|INV|POL|DEL|DLT|NFR|REQ|MIG|CST|SCN|LCN|GAR|EXT";
|
|
394
|
-
const SDD_PROTECTED_PATTERNS = [
|
|
395
|
-
"@covers\\s+\\S+(?:\\s+\\w+=\\S+)*",
|
|
396
|
-
`\\b[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?::[a-z0-9]+(?:-[a-z0-9]+)*)*:(?:${TYPES})-\\d+\\b`,
|
|
397
|
-
`\\b(?:${TYPES})-\\d+\\b`,
|
|
398
|
-
"\\bM\\d+[A-Z]+-\\d+\\b"
|
|
399
|
-
];
|
|
400
|
-
//#endregion
|
|
401
392
|
//#region src/index.ts
|
|
402
393
|
const configs = {};
|
|
403
394
|
const plugin = {
|
|
404
395
|
meta: {
|
|
405
396
|
name: "cyberash",
|
|
406
|
-
version: "0.
|
|
397
|
+
version: "0.2.0"
|
|
407
398
|
},
|
|
408
399
|
rules: {
|
|
409
400
|
"max-comment-lines": rule$4,
|
|
@@ -427,20 +418,5 @@ configs.recommended = {
|
|
|
427
418
|
"comment-policy/no-line-comment": ["error"]
|
|
428
419
|
}
|
|
429
420
|
};
|
|
430
|
-
const sddProtected = [...SDD_PROTECTED_PATTERNS];
|
|
431
|
-
configs.sdd = {
|
|
432
|
-
plugins: { "comment-policy": plugin },
|
|
433
|
-
rules: {
|
|
434
|
-
"comment-policy/max-comment-lines": ["error", {
|
|
435
|
-
max: 4,
|
|
436
|
-
anchoredMax: 3,
|
|
437
|
-
protectedPatterns: sddProtected
|
|
438
|
-
}],
|
|
439
|
-
"comment-policy/no-comment-narrative": ["error", { protectedPatterns: sddProtected }],
|
|
440
|
-
"comment-policy/no-comment-code-snippet": ["error", { protectedPatterns: sddProtected }],
|
|
441
|
-
"comment-policy/no-decorative-comment": ["error", { protectedPatterns: sddProtected }],
|
|
442
|
-
"comment-policy/no-line-comment": ["error", { protectedPatterns: sddProtected }]
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
421
|
//#endregion
|
|
446
422
|
export { plugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-comment-policy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|