eslint-plugin-traceability 1.1.0 → 1.1.2

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 (152) hide show
  1. package/lib/src/index.d.ts +80 -0
  2. package/lib/src/index.js +58 -0
  3. package/lib/src/maintenance/batch.d.ts +16 -0
  4. package/lib/src/maintenance/batch.js +28 -0
  5. package/lib/src/maintenance/detect.d.ts +6 -0
  6. package/lib/src/maintenance/detect.js +69 -0
  7. package/lib/src/maintenance/index.js +22 -0
  8. package/lib/src/maintenance/report.d.ts +7 -0
  9. package/lib/src/maintenance/report.js +17 -0
  10. package/lib/src/maintenance/update.d.ts +6 -0
  11. package/lib/src/maintenance/update.js +67 -0
  12. package/lib/src/maintenance/utils.d.ts +6 -0
  13. package/lib/src/maintenance/utils.js +64 -0
  14. package/lib/src/rules/require-branch-annotation.d.ts +7 -0
  15. package/lib/src/rules/require-branch-annotation.js +111 -0
  16. package/lib/src/rules/require-req-annotation.d.ts +7 -0
  17. package/lib/src/rules/require-req-annotation.js +38 -0
  18. package/lib/src/rules/require-story-annotation.d.ts +7 -0
  19. package/lib/src/rules/require-story-annotation.js +50 -0
  20. package/lib/src/rules/valid-annotation-format.d.ts +10 -0
  21. package/lib/src/rules/valid-annotation-format.js +60 -0
  22. package/lib/src/rules/valid-req-reference.d.ts +3 -0
  23. package/lib/src/rules/valid-req-reference.js +104 -0
  24. package/lib/src/rules/valid-story-reference.d.ts +3 -0
  25. package/lib/src/rules/valid-story-reference.js +168 -0
  26. package/lib/tests/fixtures/stale/example.d.ts +0 -0
  27. package/{tests/fixtures/stale/example.ts → lib/tests/fixtures/stale/example.js} +1 -0
  28. package/lib/tests/fixtures/update/example.d.ts +0 -0
  29. package/{tests/fixtures/update/example.ts → lib/tests/fixtures/update/example.js} +1 -0
  30. package/lib/tests/fixtures/valid-annotations/example.d.ts +0 -0
  31. package/{tests/fixtures/valid-annotations/example.ts → lib/tests/fixtures/valid-annotations/example.js} +1 -0
  32. package/lib/tests/maintenance/batch.test.d.ts +1 -0
  33. package/lib/tests/maintenance/batch.test.js +79 -0
  34. package/lib/tests/maintenance/detect-isolated.test.d.ts +1 -0
  35. package/lib/tests/maintenance/detect-isolated.test.js +95 -0
  36. package/lib/tests/maintenance/detect.test.d.ts +1 -0
  37. package/lib/tests/maintenance/detect.test.js +23 -0
  38. package/lib/tests/maintenance/report.test.d.ts +1 -0
  39. package/lib/tests/maintenance/report.test.js +67 -0
  40. package/lib/tests/maintenance/update-isolated.test.d.ts +1 -0
  41. package/lib/tests/maintenance/update-isolated.test.js +66 -0
  42. package/lib/tests/maintenance/update.test.d.ts +1 -0
  43. package/lib/tests/maintenance/update.test.js +26 -0
  44. package/lib/tests/plugin-default-export-and-configs.test.d.ts +1 -0
  45. package/lib/tests/plugin-default-export-and-configs.test.js +72 -0
  46. package/lib/tests/plugin-setup.test.d.ts +1 -0
  47. package/lib/tests/plugin-setup.test.js +51 -0
  48. package/lib/tests/rules/require-branch-annotation.test.d.ts +1 -0
  49. package/lib/tests/rules/require-branch-annotation.test.js +253 -0
  50. package/lib/tests/rules/require-req-annotation.test.d.ts +1 -0
  51. package/lib/tests/rules/require-req-annotation.test.js +41 -0
  52. package/lib/tests/rules/require-story-annotation.test.d.ts +1 -0
  53. package/lib/tests/rules/require-story-annotation.test.js +36 -0
  54. package/lib/tests/rules/valid-annotation-format.test.d.ts +1 -0
  55. package/lib/tests/rules/valid-annotation-format.test.js +58 -0
  56. package/lib/tests/rules/valid-req-reference.test.d.ts +1 -0
  57. package/lib/tests/rules/valid-req-reference.test.js +87 -0
  58. package/lib/tests/rules/valid-story-reference.test.d.ts +1 -0
  59. package/lib/tests/rules/valid-story-reference.test.js +69 -0
  60. package/package.json +6 -1
  61. package/.env.example +0 -6
  62. package/.github/workflows/ci-cd.yml +0 -107
  63. package/.husky/pre-commit +0 -1
  64. package/.husky/pre-push +0 -1
  65. package/.prettierignore +0 -27
  66. package/.prettierrc +0 -4
  67. package/.releaserc.json +0 -15
  68. package/.voder/history.md +0 -162
  69. package/.voder/implementation-progress.md +0 -144
  70. package/.voder/last-action.md +0 -83
  71. package/.voder/plan.md +0 -12
  72. package/.voder/progress-chart.png +0 -0
  73. package/.voder/progress-log-areas.csv +0 -39
  74. package/.voder/progress-log.csv +0 -38
  75. package/.voder/traceability/docs-stories-001.0-DEV-PLUGIN-SETUP.story.xml +0 -17
  76. package/.voder/traceability/docs-stories-002.0-DEV-ESLINT-CONFIG.story.xml +0 -13
  77. package/.voder/traceability/docs-stories-003.0-DEV-FUNCTION-ANNOTATIONS.story.xml +0 -9
  78. package/.voder/traceability/docs-stories-004.0-DEV-BRANCH-ANNOTATIONS.story.xml +0 -9
  79. package/.voder/traceability/docs-stories-005.0-DEV-ANNOTATION-VALIDATION.story.xml +0 -9
  80. package/.voder/traceability/docs-stories-006.0-DEV-FILE-VALIDATION.story.xml +0 -9
  81. package/.voder/traceability/docs-stories-007.0-DEV-ERROR-REPORTING.story.xml +0 -9
  82. package/.voder/traceability/docs-stories-008.0-DEV-AUTO-FIX.story.xml +0 -9
  83. package/.voder/traceability/docs-stories-009.0-DEV-MAINTENANCE-TOOLS.story.xml +0 -16
  84. package/.voder/traceability/docs-stories-010.0-DEV-DEEP-VALIDATION.story.xml +0 -11
  85. package/CHANGELOG.md +0 -57
  86. package/CONTRIBUTING.md +0 -99
  87. package/cli-integration.js +0 -103
  88. package/docs/cli-integration.md +0 -105
  89. package/docs/config-presets.md +0 -38
  90. package/docs/conventional-commits-guide.md +0 -185
  91. package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +0 -111
  92. package/docs/decisions/002-jest-for-eslint-testing.accepted.md +0 -137
  93. package/docs/decisions/003-code-quality-ratcheting-plan.md +0 -48
  94. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +0 -196
  95. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +0 -144
  96. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +0 -227
  97. package/docs/eslint-9-setup-guide.md +0 -517
  98. package/docs/eslint-plugin-development-guide.md +0 -483
  99. package/docs/jest-testing-guide.md +0 -100
  100. package/docs/rules/require-branch-annotation.md +0 -34
  101. package/docs/rules/require-req-annotation.md +0 -39
  102. package/docs/rules/require-story-annotation.md +0 -36
  103. package/docs/rules/valid-annotation-format.md +0 -52
  104. package/docs/rules/valid-req-reference.md +0 -58
  105. package/docs/rules/valid-story-reference.md +0 -47
  106. package/docs/security-incidents/unresolved-vulnerabilities.md +0 -11
  107. package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +0 -82
  108. package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +0 -82
  109. package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +0 -85
  110. package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +0 -107
  111. package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +0 -119
  112. package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +0 -127
  113. package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +0 -89
  114. package/docs/stories/008.0-DEV-AUTO-FIX.story.md +0 -104
  115. package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +0 -104
  116. package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +0 -110
  117. package/docs/stories/developer-story.map.md +0 -118
  118. package/eslint.config.js +0 -146
  119. package/jest.config.js +0 -21
  120. package/scripts/smoke-test.sh +0 -45
  121. package/src/index.ts +0 -56
  122. package/src/maintenance/batch.ts +0 -29
  123. package/src/maintenance/detect.ts +0 -42
  124. package/src/maintenance/report.ts +0 -15
  125. package/src/maintenance/update.ts +0 -40
  126. package/src/maintenance/utils.ts +0 -28
  127. package/src/rules/require-branch-annotation.ts +0 -114
  128. package/src/rules/require-req-annotation.ts +0 -36
  129. package/src/rules/require-story-annotation.ts +0 -52
  130. package/src/rules/valid-annotation-format.ts +0 -62
  131. package/src/rules/valid-req-reference.ts +0 -114
  132. package/src/rules/valid-story-reference.ts +0 -213
  133. package/tests/fixtures/story_bullet.md +0 -6
  134. package/tests/maintenance/batch.test.ts +0 -55
  135. package/tests/maintenance/detect-isolated.test.ts +0 -65
  136. package/tests/maintenance/detect.test.ts +0 -19
  137. package/tests/maintenance/report.test.ts +0 -37
  138. package/tests/maintenance/update-isolated.test.ts +0 -39
  139. package/tests/maintenance/update.test.ts +0 -21
  140. package/tests/plugin-default-export-and-configs.test.ts +0 -50
  141. package/tests/plugin-setup.test.ts +0 -17
  142. package/tests/rules/require-branch-annotation.test.ts +0 -250
  143. package/tests/rules/require-req-annotation.test.ts +0 -38
  144. package/tests/rules/require-story-annotation.test.ts +0 -33
  145. package/tests/rules/valid-annotation-format.test.ts +0 -55
  146. package/tests/rules/valid-req-reference.test.ts +0 -85
  147. package/tests/rules/valid-story-reference.test.ts +0 -66
  148. package/tsconfig.json +0 -15
  149. package/user-docs/api-reference.md +0 -135
  150. package/user-docs/examples.md +0 -73
  151. package/user-docs/migration-guide.md +0 -71
  152. /package/{src/maintenance/index.ts → lib/src/maintenance/index.d.ts} +0 -0
@@ -1,73 +0,0 @@
1
- # Examples
2
-
3
- Created autonomously by [voder.ai](https://voder.ai).
4
-
5
- This document provides runnable examples demonstrating how to use the `eslint-plugin-traceability` plugin in real-world scenarios.
6
-
7
- ## 1. ESLint Flat Config with Recommended Preset
8
-
9
- Create an ESLint config file (`eslint.config.js`) at your project root:
10
-
11
- ```javascript
12
- // eslint.config.js
13
- import js from "@eslint/js";
14
- import traceability from "eslint-plugin-traceability";
15
-
16
- export default [js.configs.recommended, traceability.configs.recommended];
17
- ```
18
-
19
- Then run ESLint on your source files:
20
-
21
- ```bash
22
- npx eslint "src/**/*.ts"
23
- ```
24
-
25
- ## 2. Using the Strict Preset
26
-
27
- If you want to enforce all traceability rules (strict mode), update your config:
28
-
29
- ```javascript
30
- // eslint.config.js
31
- import js from "@eslint/js";
32
- import traceability from "eslint-plugin-traceability";
33
-
34
- export default [js.configs.recommended, traceability.configs.strict];
35
- ```
36
-
37
- Run ESLint the same way:
38
-
39
- ```bash
40
- npx eslint "src/**/*.js"
41
- ```
42
-
43
- ## 3. CLI Invocation Example
44
-
45
- You can use the plugin without a config file by specifying rules inline:
46
-
47
- ```bash
48
- npx eslint --no-eslintrc \
49
- --rule "traceability/require-story-annotation:error" \
50
- --rule "traceability/require-req-annotation:error" \
51
- sample.js
52
- ```
53
-
54
- - `--no-eslintrc` tells ESLint to ignore user configs.
55
- - `--rule` options enable the traceability rules you need.
56
-
57
- Replace `sample.js` with your JavaScript or TypeScript file.
58
-
59
- ## 4. Linting a Specific Directory
60
-
61
- Add an npm script in your `package.json`:
62
-
63
- ```json
64
- "scripts": {
65
- "lint:trace": "eslint \"src/**/*.{js,ts}\" --config eslint.config.js"
66
- }
67
- ```
68
-
69
- Then run:
70
-
71
- ```bash
72
- npm run lint:trace
73
- ```
@@ -1,71 +0,0 @@
1
- # Migration Guide from v0.x to v1.x
2
-
3
- Created autonomously by [voder.ai](https://voder.ai)
4
-
5
- This guide helps you migrate from versions 0.x of `eslint-plugin-traceability` to 1.x.
6
-
7
- ## 1. Update Dependency
8
-
9
- Update your development dependency to the latest 1.x release:
10
-
11
- ```bash
12
- npm install --save-dev eslint-plugin-traceability@^1.0.0
13
- ```
14
-
15
- Or with Yarn:
16
-
17
- ```bash
18
- yarn add --dev eslint-plugin-traceability@^1.0.0
19
- ```
20
-
21
- ## 2. ESLint Configuration Changes
22
-
23
- - Version 1.x uses ESLint v9 flat config by default. If you currently use `.eslintrc.js`, you can continue using it, but consider migrating to the new flat config format for future upgrades.
24
- - Update your ESLint config to load the plugin’s recommended settings:
25
-
26
- ```js
27
- // eslint.config.js (ESLint v9 flat config)
28
- import traceability from "eslint-plugin-traceability";
29
-
30
- export default [traceability.configs.recommended];
31
- ```
32
-
33
- ## 3. New and Updated Rules
34
-
35
- - `valid-story-reference` now enforces `.story.md` extensions strictly.
36
- - `valid-req-reference` rejects path traversal (`../`) and absolute paths (`/etc/passwd`).
37
- - `valid-annotation-format` enforces correct JSDoc traceability annotation syntax (`@story` and `@req` tags).
38
-
39
- Review and update your existing annotations accordingly:
40
-
41
- ```diff
42
- - /** @story docs/stories/001.0-DEV-PLUGIN-SETUP.md */
43
- + /** @story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md */
44
- ```
45
-
46
- ## 4. CLI Integration Script
47
-
48
- Version 1.x includes a new `cli-integration.js` script at the project root to run end-to-end CLI integration tests:
49
-
50
- ```bash
51
- node ./cli-integration.js
52
- ```
53
-
54
- ## 5. Test and Validate
55
-
56
- Run your test suite and the new CLI integration script to confirm everything passes:
57
-
58
- ```bash
59
- npm test
60
- npm run lint -- --max-warnings=0
61
- npm run format:check
62
- node ./cli-integration.js
63
- ```
64
-
65
- ## 6. Update Documentation
66
-
67
- If you have custom documentation or examples that reference old rule names or file paths, update them to match the new conventions introduced in v1.x.
68
-
69
- ---
70
-
71
- If you encounter any issues during migration, please file an issue at https://github.com/voder-ai/eslint-plugin-traceability/issues.