eslint-plugin-traceability 1.0.4 → 1.0.5

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.
Files changed (69) hide show
  1. package/.github/workflows/ci-cd.yml +26 -18
  2. package/.husky/pre-commit +1 -1
  3. package/.releaserc.json +15 -0
  4. package/CHANGELOG.md +8 -1
  5. package/CONTRIBUTING.md +15 -13
  6. package/docs/conventional-commits-guide.md +185 -0
  7. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +3 -1
  8. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +227 -0
  9. package/package.json +7 -2
  10. package/lib/src/index.d.ts +0 -80
  11. package/lib/src/index.js +0 -58
  12. package/lib/src/maintenance/batch.d.ts +0 -16
  13. package/lib/src/maintenance/batch.js +0 -28
  14. package/lib/src/maintenance/detect.d.ts +0 -6
  15. package/lib/src/maintenance/detect.js +0 -69
  16. package/lib/src/maintenance/index.d.ts +0 -14
  17. package/lib/src/maintenance/index.js +0 -22
  18. package/lib/src/maintenance/report.d.ts +0 -7
  19. package/lib/src/maintenance/report.js +0 -17
  20. package/lib/src/maintenance/update.d.ts +0 -6
  21. package/lib/src/maintenance/update.js +0 -67
  22. package/lib/src/maintenance/utils.d.ts +0 -6
  23. package/lib/src/maintenance/utils.js +0 -64
  24. package/lib/src/rules/require-branch-annotation.d.ts +0 -7
  25. package/lib/src/rules/require-branch-annotation.js +0 -111
  26. package/lib/src/rules/require-req-annotation.d.ts +0 -7
  27. package/lib/src/rules/require-req-annotation.js +0 -38
  28. package/lib/src/rules/require-story-annotation.d.ts +0 -7
  29. package/lib/src/rules/require-story-annotation.js +0 -50
  30. package/lib/src/rules/valid-annotation-format.d.ts +0 -10
  31. package/lib/src/rules/valid-annotation-format.js +0 -60
  32. package/lib/src/rules/valid-req-reference.d.ts +0 -3
  33. package/lib/src/rules/valid-req-reference.js +0 -104
  34. package/lib/src/rules/valid-story-reference.d.ts +0 -3
  35. package/lib/src/rules/valid-story-reference.js +0 -168
  36. package/lib/tests/fixtures/stale/example.d.ts +0 -0
  37. package/lib/tests/fixtures/stale/example.js +0 -3
  38. package/lib/tests/fixtures/update/example.d.ts +0 -0
  39. package/lib/tests/fixtures/update/example.js +0 -3
  40. package/lib/tests/fixtures/valid-annotations/example.d.ts +0 -0
  41. package/lib/tests/fixtures/valid-annotations/example.js +0 -3
  42. package/lib/tests/maintenance/batch.test.d.ts +0 -1
  43. package/lib/tests/maintenance/batch.test.js +0 -79
  44. package/lib/tests/maintenance/detect-isolated.test.d.ts +0 -1
  45. package/lib/tests/maintenance/detect-isolated.test.js +0 -95
  46. package/lib/tests/maintenance/detect.test.d.ts +0 -1
  47. package/lib/tests/maintenance/detect.test.js +0 -23
  48. package/lib/tests/maintenance/report.test.d.ts +0 -1
  49. package/lib/tests/maintenance/report.test.js +0 -67
  50. package/lib/tests/maintenance/update-isolated.test.d.ts +0 -1
  51. package/lib/tests/maintenance/update-isolated.test.js +0 -66
  52. package/lib/tests/maintenance/update.test.d.ts +0 -1
  53. package/lib/tests/maintenance/update.test.js +0 -26
  54. package/lib/tests/plugin-default-export-and-configs.test.d.ts +0 -1
  55. package/lib/tests/plugin-default-export-and-configs.test.js +0 -72
  56. package/lib/tests/plugin-setup.test.d.ts +0 -1
  57. package/lib/tests/plugin-setup.test.js +0 -51
  58. package/lib/tests/rules/require-branch-annotation.test.d.ts +0 -1
  59. package/lib/tests/rules/require-branch-annotation.test.js +0 -253
  60. package/lib/tests/rules/require-req-annotation.test.d.ts +0 -1
  61. package/lib/tests/rules/require-req-annotation.test.js +0 -41
  62. package/lib/tests/rules/require-story-annotation.test.d.ts +0 -1
  63. package/lib/tests/rules/require-story-annotation.test.js +0 -36
  64. package/lib/tests/rules/valid-annotation-format.test.d.ts +0 -1
  65. package/lib/tests/rules/valid-annotation-format.test.js +0 -58
  66. package/lib/tests/rules/valid-req-reference.test.d.ts +0 -1
  67. package/lib/tests/rules/valid-req-reference.test.js +0 -87
  68. package/lib/tests/rules/valid-story-reference.test.d.ts +0 -1
  69. package/lib/tests/rules/valid-story-reference.test.js +0 -69
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /**
7
- * Tests for: docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md
8
- * @story docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md
9
- * @req REQ-FORMAT-SPECIFICATION - Verify valid-annotation-format rule enforces annotation format syntax
10
- */
11
- const eslint_1 = require("eslint");
12
- const valid_annotation_format_1 = __importDefault(require("../../src/rules/valid-annotation-format"));
13
- const ruleTester = new eslint_1.RuleTester({
14
- languageOptions: { parserOptions: { ecmaVersion: 2020 } },
15
- });
16
- describe("Valid Annotation Format Rule (Story 005.0-DEV-ANNOTATION-VALIDATION)", () => {
17
- ruleTester.run("valid-annotation-format", valid_annotation_format_1.default, {
18
- valid: [
19
- {
20
- name: "[REQ-PATH-FORMAT] valid story annotation format",
21
- code: `// @story docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md`,
22
- },
23
- {
24
- name: "[REQ-REQ-FORMAT] valid req annotation format",
25
- code: `// @req REQ-EXAMPLE`,
26
- },
27
- {
28
- name: "[REQ-FORMAT-SPECIFICATION] valid block annotations",
29
- code: `/**
30
- * @story docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md
31
- * @req REQ-VALID-EXAMPLE
32
- */`,
33
- },
34
- ],
35
- invalid: [
36
- {
37
- name: "[REQ-PATH-FORMAT] missing story path",
38
- code: `// @story`,
39
- errors: [{ messageId: "invalidStoryFormat" }],
40
- },
41
- {
42
- name: "[REQ-PATH-FORMAT] invalid story file extension",
43
- code: `// @story docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story`,
44
- errors: [{ messageId: "invalidStoryFormat" }],
45
- },
46
- {
47
- name: "[REQ-REQ-FORMAT] missing req id",
48
- code: `// @req`,
49
- errors: [{ messageId: "invalidReqFormat" }],
50
- },
51
- {
52
- name: "[REQ-REQ-FORMAT] invalid req id format",
53
- code: `// @req invalid-format`,
54
- errors: [{ messageId: "invalidReqFormat" }],
55
- },
56
- ],
57
- });
58
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /**
7
- * Tests for: docs/stories/010.0-DEV-DEEP-VALIDATION.story.md
8
- * @story docs/stories/010.0-DEV-DEEP-VALIDATION.story.md
9
- * @req REQ-DEEP-PARSE - Verify valid-req-reference rule enforces existing requirement content
10
- */
11
- const eslint_1 = require("eslint");
12
- const valid_req_reference_1 = __importDefault(require("../../src/rules/valid-req-reference"));
13
- const ruleTester = new eslint_1.RuleTester({
14
- languageOptions: { parserOptions: { ecmaVersion: 2020 } },
15
- });
16
- describe("Valid Req Reference Rule (Story 010.0-DEV-DEEP-VALIDATION)", () => {
17
- ruleTester.run("valid-req-reference", valid_req_reference_1.default, {
18
- valid: [
19
- {
20
- name: "[REQ-DEEP-PARSE] valid requirement reference existing in story file",
21
- code: `// @story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
22
- // @req REQ-PLUGIN-STRUCTURE`,
23
- },
24
- {
25
- name: "[REQ-DEEP-BULLET] valid bullet list requirement existing in bullet story fixture",
26
- code: `// @story tests/fixtures/story_bullet.md
27
- // @req REQ-BULLET-LIST`,
28
- },
29
- ],
30
- invalid: [
31
- {
32
- name: "[REQ-DEEP-MATCH] missing requirement in story file",
33
- code: `// @story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
34
- // @req REQ-NON-EXISTENT`,
35
- errors: [
36
- {
37
- messageId: "reqMissing",
38
- data: {
39
- reqId: "REQ-NON-EXISTENT",
40
- storyPath: "docs/stories/001.0-DEV-PLUGIN-SETUP.story.md",
41
- },
42
- },
43
- ],
44
- },
45
- {
46
- name: "[REQ-DEEP-PARSE] disallow path traversal in story path",
47
- code: `// @story ../docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
48
- // @req REQ-PLUGIN-STRUCTURE`,
49
- errors: [
50
- {
51
- messageId: "invalidPath",
52
- data: {
53
- storyPath: "../docs/stories/001.0-DEV-PLUGIN-SETUP.story.md",
54
- },
55
- },
56
- ],
57
- },
58
- {
59
- name: "[REQ-DEEP-PARSE] disallow absolute path in story path",
60
- code: `// @story /absolute/path/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
61
- // @req REQ-PLUGIN-STRUCTURE`,
62
- errors: [
63
- {
64
- messageId: "invalidPath",
65
- data: {
66
- storyPath: "/absolute/path/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md",
67
- },
68
- },
69
- ],
70
- },
71
- {
72
- name: "[REQ-DEEP-BULLET] missing bullet list requirement in bullet story fixture",
73
- code: `// @story tests/fixtures/story_bullet.md
74
- // @req REQ-MISSING-BULLET`,
75
- errors: [
76
- {
77
- messageId: "reqMissing",
78
- data: {
79
- reqId: "REQ-MISSING-BULLET",
80
- storyPath: "tests/fixtures/story_bullet.md",
81
- },
82
- },
83
- ],
84
- },
85
- ],
86
- });
87
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /**
7
- * Tests for: docs/stories/006.0-DEV-FILE-VALIDATION.story.md
8
- * @story docs/stories/006.0-DEV-FILE-VALIDATION.story.md
9
- * @req REQ-FILE-EXISTENCE - Verify valid-story-reference rule enforces existing .story.md files
10
- */
11
- const eslint_1 = require("eslint");
12
- const valid_story_reference_1 = __importDefault(require("../../src/rules/valid-story-reference"));
13
- const ruleTester = new eslint_1.RuleTester({
14
- languageOptions: { parserOptions: { ecmaVersion: 2020 } },
15
- });
16
- describe("Valid Story Reference Rule (Story 006.0-DEV-FILE-VALIDATION)", () => {
17
- ruleTester.run("valid-story-reference", valid_story_reference_1.default, {
18
- valid: [
19
- {
20
- name: "[REQ-FILE-EXISTENCE] valid story file reference",
21
- code: `// @story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md`,
22
- },
23
- {
24
- name: "[REQ-EXTENSION] valid .story.md extension",
25
- code: `// @story docs/stories/002.0-DEV-ESLINT-CONFIG.story.md`,
26
- },
27
- {
28
- name: "[REQ-PATH-RESOLUTION] valid relative path with ./ prefix",
29
- code: `// @story ./docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md`,
30
- },
31
- ],
32
- invalid: [
33
- {
34
- name: "[REQ-PATH-RESOLUTION] missing file",
35
- code: `// @story docs/stories/missing-file.story.md`,
36
- errors: [
37
- {
38
- messageId: "fileMissing",
39
- data: { path: "docs/stories/missing-file.story.md" },
40
- },
41
- ],
42
- },
43
- {
44
- name: "[REQ-EXTENSION] invalid extension",
45
- code: `// @story docs/stories/001.0-DEV-PLUGIN-SETUP.md`,
46
- errors: [
47
- {
48
- messageId: "invalidExtension",
49
- data: { path: "docs/stories/001.0-DEV-PLUGIN-SETUP.md" },
50
- },
51
- ],
52
- },
53
- {
54
- name: "[REQ-PATH-SECURITY] path traversal",
55
- code: `// @story ../outside.story.md`,
56
- errors: [
57
- { messageId: "invalidPath", data: { path: "../outside.story.md" } },
58
- ],
59
- },
60
- {
61
- name: "[REQ-ABSOLUTE-PATH] absolute path not allowed",
62
- code: `// @story /etc/passwd.story.md`,
63
- errors: [
64
- { messageId: "invalidPath", data: { path: "/etc/passwd.story.md" } },
65
- ],
66
- },
67
- ],
68
- });
69
- });