eslint-plugin-traceability 1.1.1 → 1.1.3

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 (96) hide show
  1. package/package.json +6 -1
  2. package/.env.example +0 -6
  3. package/.github/workflows/ci-cd.yml +0 -110
  4. package/.husky/pre-commit +0 -1
  5. package/.husky/pre-push +0 -1
  6. package/.prettierignore +0 -27
  7. package/.prettierrc +0 -4
  8. package/.releaserc.json +0 -20
  9. package/.voder/history.md +0 -162
  10. package/.voder/implementation-progress.md +0 -144
  11. package/.voder/last-action.md +0 -83
  12. package/.voder/plan.md +0 -12
  13. package/.voder/progress-chart.png +0 -0
  14. package/.voder/progress-log-areas.csv +0 -39
  15. package/.voder/progress-log.csv +0 -38
  16. package/.voder/traceability/docs-stories-001.0-DEV-PLUGIN-SETUP.story.xml +0 -17
  17. package/.voder/traceability/docs-stories-002.0-DEV-ESLINT-CONFIG.story.xml +0 -13
  18. package/.voder/traceability/docs-stories-003.0-DEV-FUNCTION-ANNOTATIONS.story.xml +0 -9
  19. package/.voder/traceability/docs-stories-004.0-DEV-BRANCH-ANNOTATIONS.story.xml +0 -9
  20. package/.voder/traceability/docs-stories-005.0-DEV-ANNOTATION-VALIDATION.story.xml +0 -9
  21. package/.voder/traceability/docs-stories-006.0-DEV-FILE-VALIDATION.story.xml +0 -9
  22. package/.voder/traceability/docs-stories-007.0-DEV-ERROR-REPORTING.story.xml +0 -9
  23. package/.voder/traceability/docs-stories-008.0-DEV-AUTO-FIX.story.xml +0 -9
  24. package/.voder/traceability/docs-stories-009.0-DEV-MAINTENANCE-TOOLS.story.xml +0 -16
  25. package/.voder/traceability/docs-stories-010.0-DEV-DEEP-VALIDATION.story.xml +0 -11
  26. package/CHANGELOG.md +0 -58
  27. package/CONTRIBUTING.md +0 -99
  28. package/cli-integration.js +0 -103
  29. package/docs/cli-integration.md +0 -105
  30. package/docs/config-presets.md +0 -38
  31. package/docs/conventional-commits-guide.md +0 -185
  32. package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +0 -111
  33. package/docs/decisions/002-jest-for-eslint-testing.accepted.md +0 -137
  34. package/docs/decisions/003-code-quality-ratcheting-plan.md +0 -48
  35. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +0 -196
  36. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +0 -144
  37. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +0 -227
  38. package/docs/eslint-9-setup-guide.md +0 -517
  39. package/docs/eslint-plugin-development-guide.md +0 -483
  40. package/docs/jest-testing-guide.md +0 -100
  41. package/docs/rules/require-branch-annotation.md +0 -34
  42. package/docs/rules/require-req-annotation.md +0 -39
  43. package/docs/rules/require-story-annotation.md +0 -36
  44. package/docs/rules/valid-annotation-format.md +0 -52
  45. package/docs/rules/valid-req-reference.md +0 -58
  46. package/docs/rules/valid-story-reference.md +0 -47
  47. package/docs/security-incidents/unresolved-vulnerabilities.md +0 -11
  48. package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +0 -82
  49. package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +0 -82
  50. package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +0 -85
  51. package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +0 -107
  52. package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +0 -119
  53. package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +0 -127
  54. package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +0 -89
  55. package/docs/stories/008.0-DEV-AUTO-FIX.story.md +0 -104
  56. package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +0 -104
  57. package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +0 -110
  58. package/docs/stories/developer-story.map.md +0 -118
  59. package/eslint.config.js +0 -146
  60. package/jest.config.js +0 -21
  61. package/scripts/smoke-test.sh +0 -51
  62. package/src/index.ts +0 -56
  63. package/src/maintenance/batch.ts +0 -29
  64. package/src/maintenance/detect.ts +0 -42
  65. package/src/maintenance/index.ts +0 -14
  66. package/src/maintenance/report.ts +0 -15
  67. package/src/maintenance/update.ts +0 -40
  68. package/src/maintenance/utils.ts +0 -28
  69. package/src/rules/require-branch-annotation.ts +0 -114
  70. package/src/rules/require-req-annotation.ts +0 -36
  71. package/src/rules/require-story-annotation.ts +0 -52
  72. package/src/rules/valid-annotation-format.ts +0 -62
  73. package/src/rules/valid-req-reference.ts +0 -114
  74. package/src/rules/valid-story-reference.ts +0 -213
  75. package/tests/fixtures/stale/example.ts +0 -2
  76. package/tests/fixtures/story_bullet.md +0 -6
  77. package/tests/fixtures/update/example.ts +0 -2
  78. package/tests/fixtures/valid-annotations/example.ts +0 -2
  79. package/tests/maintenance/batch.test.ts +0 -55
  80. package/tests/maintenance/detect-isolated.test.ts +0 -65
  81. package/tests/maintenance/detect.test.ts +0 -19
  82. package/tests/maintenance/report.test.ts +0 -37
  83. package/tests/maintenance/update-isolated.test.ts +0 -39
  84. package/tests/maintenance/update.test.ts +0 -21
  85. package/tests/plugin-default-export-and-configs.test.ts +0 -50
  86. package/tests/plugin-setup.test.ts +0 -17
  87. package/tests/rules/require-branch-annotation.test.ts +0 -250
  88. package/tests/rules/require-req-annotation.test.ts +0 -38
  89. package/tests/rules/require-story-annotation.test.ts +0 -33
  90. package/tests/rules/valid-annotation-format.test.ts +0 -55
  91. package/tests/rules/valid-req-reference.test.ts +0 -85
  92. package/tests/rules/valid-story-reference.test.ts +0 -66
  93. package/tsconfig.json +0 -15
  94. package/user-docs/api-reference.md +0 -135
  95. package/user-docs/examples.md +0 -73
  96. package/user-docs/migration-guide.md +0 -71
@@ -1,144 +0,0 @@
1
- ---
2
- status: "accepted"
3
- date: 2025-11-17
4
- decision-makers: [Development Team]
5
- consulted:
6
- [
7
- GitHub Actions Documentation,
8
- Super-Linter Community,
9
- actionlint Documentation,
10
- ]
11
- informed: [Project Contributors, CI/CD Pipeline Maintainers]
12
- ---
13
-
14
- # GitHub Actions Validation Tooling Selection
15
-
16
- ## Context and Problem Statement
17
-
18
- The project uses GitHub Actions for CI/CD workflows defined in `.github/workflows/`. To prevent broken GitHub Actions files from being pushed to the repository, we need to implement pre-commit validation for GitHub Actions YAML files. This validation should catch syntax errors, invalid action references, and misconfigured job dependencies before they are committed, as broken workflow files could prevent CI/CD from running at all.
19
-
20
- ## Decision Drivers
21
-
22
- - Need for pre-commit validation to prevent broken GitHub Actions files from being pushed
23
- - Performance requirements for fast local development workflows
24
- - Prevention of workflow files that would break CI/CD execution
25
- - Integration with existing development tools and pre-commit hooks
26
- - Maintainability and configuration simplicity
27
- - Resource efficiency for local development environments
28
-
29
- ## Considered Options
30
-
31
- - actionlint for pre-commit hooks only
32
- - actionlint for both pre-commit and CI/CD
33
- - Super-Linter for pre-commit hooks
34
- - GitHub's built-in validation only
35
-
36
- ## Decision Outcome
37
-
38
- Chosen option: "actionlint for pre-commit hooks only", because it prevents broken GitHub Actions files from being pushed while maintaining fast local development workflow. Once files reach CI/CD, if the workflow runs successfully, the files are valid by definition.
39
-
40
- ### Consequences
41
-
42
- - Good, because actionlint provides fast pre-commit validation without container overhead
43
- - Good, because prevents broken GitHub Actions files from being pushed
44
- - Good, because specifically designed for GitHub Actions validation
45
- - Good, because simple configuration and maintenance
46
- - Good, because no Docker dependencies for local development
47
- - Good, because excellent performance for pre-commit hooks
48
- - Good, because integrates seamlessly with existing Husky-based pre-commit hooks
49
- - Neutral, because CI/CD validation is unnecessary if workflows execute successfully
50
- - Bad, because limited to GitHub Actions validation only
51
- - Bad, because no security vulnerability detection in pre-commit phase
52
-
53
- ### Confirmation
54
-
55
- Implementation compliance will be confirmed through:
56
-
57
- - actionlint added to Husky pre-commit hook in `.husky/pre-commit`
58
- - Pre-commit hook blocks commits with GitHub Actions validation errors
59
- - actionlint configured to validate files in `.github/workflows/`
60
- - Documentation updated to explain Husky-based pre-commit validation approach
61
-
62
- ### Implementation Approach
63
-
64
- actionlint will be integrated into existing Husky-based pre-commit hooks by:
65
-
66
- - Installing actionlint as a development dependency
67
- - Adding actionlint validation to `.husky/pre-commit` hook
68
- - Configuring actionlint to check `.github/workflows/*.yml` files
69
- - Documenting the validation process for contributors
70
-
71
- ## Pros and Cons of the Options
72
-
73
- ### actionlint for pre-commit hooks only
74
-
75
- Lightweight, focused pre-commit validation to prevent broken GitHub Actions files.
76
-
77
- - Good, because fast execution without container overhead
78
- - Good, because specifically designed for GitHub Actions validation
79
- - Good, because no Docker dependencies for local development
80
- - Good, because simple configuration and maintenance
81
- - Good, because excellent performance for pre-commit hooks
82
- - Good, because prevents broken workflow files from being pushed
83
- - Good, because minimal tooling - only runs where validation is needed
84
- - Neutral, because focused scope reduces complexity
85
- - Neutral, because CI/CD validation unnecessary if workflows execute successfully
86
- - Bad, because limited to GitHub Actions validation only
87
- - Bad, because no security vulnerability detection in pre-commit phase
88
-
89
- ### actionlint for both pre-commit and CI/CD
90
-
91
- Validation in both development and CI/CD environments.
92
-
93
- - Good, because fast execution in all environments
94
- - Good, because specifically designed for GitHub Actions
95
- - Good, because consistent validation across environments
96
- - Neutral, because focused scope reduces complexity
97
- - Bad, because unnecessary duplication - CI/CD execution validates workflow correctness
98
- - Bad, because adds CI/CD overhead for validation that's already proven by execution
99
- - Bad, because limited to GitHub Actions validation only
100
-
101
- ### Super-Linter for pre-commit hooks
102
-
103
- Comprehensive linting solution for pre-commit validation.
104
-
105
- - Good, because comprehensive validation including security checks
106
- - Good, because validates multiple file types beyond GitHub Actions
107
- - Neutral, because well-maintained and widely adopted
108
- - Bad, because container overhead makes pre-commit hooks slow
109
- - Bad, because heavy resource usage for simple syntax checking
110
- - Bad, because Docker dependency required for local development
111
- - Bad, because not optimized for frequent pre-commit execution
112
- - Bad, because overkill for the specific problem of preventing broken workflow files
113
-
114
- ### GitHub's built-in validation only
115
-
116
- Rely solely on GitHub's native workflow validation.
117
-
118
- - Good, because no additional tooling or configuration required
119
- - Good, because automatically available in GitHub interface
120
- - Good, because validated by the same system that executes workflows
121
- - Neutral, because basic validation is always performed
122
- - Bad, because no pre-commit validation for early error detection
123
- - Bad, because broken files can be pushed, preventing CI/CD execution
124
- - Bad, because errors only discovered after push to repository
125
- - Bad, because no local development feedback
126
-
127
- ## More Information
128
-
129
- This decision focuses on solving the specific problem of preventing broken GitHub Actions files from being pushed to the repository. If CI/CD workflows execute successfully, the files are validated by definition - there's no need for redundant validation in the CI/CD pipeline itself.
130
-
131
- actionlint configuration should be added to the existing Husky pre-commit hook in `.husky/pre-commit`, targeting `.github/workflows/*.yml` files to catch syntax and configuration errors before commit.
132
-
133
- The decision should be re-evaluated if:
134
-
135
- - Security vulnerability detection becomes a requirement for pre-commit validation
136
- - Comprehensive multi-language linting becomes necessary for pre-commit
137
- - Alternative tools with better GitHub Actions-specific features emerge
138
- - The problem scope expands beyond preventing broken workflow files
139
-
140
- Related resources:
141
-
142
- - [actionlint Documentation](https://github.com/rhymond/actionlint)
143
- - [GitHub Actions Workflow Syntax](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions)
144
- - [Husky Documentation](https://typicode.github.io/husky/)
@@ -1,227 +0,0 @@
1
- ---
2
- status: "accepted"
3
- date: 2025-11-17
4
- decision-makers: [Development Team]
5
- consulted:
6
- [
7
- semantic-release Documentation,
8
- Conventional Commits Specification,
9
- GitHub Actions Best Practices,
10
- npm Publishing Guidelines,
11
- ]
12
- informed: [Project Stakeholders, CI/CD Pipeline Maintainers]
13
- ---
14
-
15
- # Semantic Release for Automated Publishing
16
-
17
- ## Context and Problem Statement
18
-
19
- The current automated version bumping strategy (ADR 004) has several limitations that impact maintainability and developer experience:
20
-
21
- 1. **Single Increment Logic**: The CI/CD pipeline only increments the version once, requiring complex loop logic to handle cases where multiple increments are needed (e.g., when both 1.0.3 and 1.0.4 already exist on npm)
22
-
23
- 2. **No Semantic Version Determination**: The system only performs patch increments and cannot automatically determine when minor or major version bumps are appropriate based on the nature of changes
24
-
25
- 3. **Missing Release Management**: No automatic git tagging, release notes, or CHANGELOG.md generation, reducing traceability and release visibility
26
-
27
- 4. **Workflow Complexity**: The custom version increment logic in GitHub Actions is becoming complex and error-prone, potentially violating workflow validation best practices established in ADR 005
28
-
29
- 5. **Package.json/npm Version Drift**: The package.json version in the repository can lag behind the published npm version, creating confusion about the actual release state
30
-
31
- The current approach was designed as a temporary solution to prevent npm publish failures, but its limitations suggest that a more comprehensive release automation strategy is needed.
32
-
33
- ## Decision Drivers
34
-
35
- - Need for proper semantic version determination based on change significance
36
- - Automatic generation of release notes and changelog maintenance
37
- - Git tag creation for release tracking and traceability
38
- - Elimination of complex custom version increment logic in CI/CD workflows
39
- - Integration with conventional commit standards for automated version type detection
40
- - Prevention of unnecessary publishing when no changes warrant a release
41
- - Alignment with npm ecosystem best practices for release management
42
- - Simplification of GitHub Actions workflow to improve maintainability and validation compliance
43
-
44
- ## Considered Options
45
-
46
- - Enhance current in-memory version increment approach with loop logic
47
- - Implement semantic-release with conventional commits
48
- - Switch to git write-back approach with automated tagging
49
- - Implement manual release workflow with GitHub releases
50
-
51
- ## Decision Outcome
52
-
53
- Chosen option: "semantic-release with conventional commits", because it provides comprehensive release automation, proper semantic versioning, automated changelog generation, and eliminates the need for complex custom version logic while following industry standards.
54
-
55
- ### Implementation Strategy
56
-
57
- 1. **Install and Configure semantic-release**:
58
- - Add `semantic-release` and related plugins as development dependencies
59
- - Configure semantic-release with conventional commits preset
60
- - Set up plugins for npm publishing, git tagging, and changelog generation
61
-
62
- 2. **Establish Conventional Commit Standards**:
63
- - Adopt conventional commit message format for semantic version determination
64
- - Configure semantic-release to analyze commit messages for version impact
65
- - Document commit message guidelines for contributors
66
-
67
- 3. **Update CI/CD Pipeline**:
68
- - Replace custom version increment logic with semantic-release execution
69
- - Configure semantic-release to run on main branch pushes
70
- - Set up proper npm registry authentication and git permissions
71
-
72
- 4. **Configure Release Automation**:
73
- - Automatic CHANGELOG.md generation and maintenance
74
- - Git tag creation for each release
75
- - GitHub release creation with release notes
76
- - Conditional publishing (only when changes warrant a release)
77
-
78
- ### Consequences
79
-
80
- - Good, because eliminates complex custom version increment logic from CI/CD workflows
81
- - Good, because provides proper semantic version determination based on commit analysis
82
- - Good, because automatically generates and maintains CHANGELOG.md with release notes
83
- - Good, because creates proper git tags and GitHub releases for traceability
84
- - Good, because follows conventional commits standard adopted widely in open source
85
- - Good, because only publishes when changes actually warrant a new release
86
- - Good, because avoids package.json version drift by using git tags as source of truth
87
- - Good, because simplifies GitHub Actions workflow, improving validation compliance
88
- - Good, because provides comprehensive release management with minimal configuration
89
- - Good, because prevents infinite CI loops from version commits
90
- - Neutral, because requires team adoption of conventional commit message format
91
- - Neutral, because package.json version in repository may lag behind published version (git tags are source of truth)
92
- - Bad, because introduces dependency on semantic-release tool and its ecosystem
93
- - Bad, because may require learning curve for conventional commit message format
94
-
95
- ### Confirmation
96
-
97
- Implementation compliance will be confirmed through:
98
-
99
- - semantic-release successfully analyzes commits and determines appropriate version increments
100
- - Automatic CHANGELOG.md generation and git tag creation on releases
101
- - CI/CD pipeline publishes to npm only when semantic-release determines a release is warranted
102
- - No npm publish failures due to version conflicts or unnecessary publishing attempts
103
- - Package.json version remains synchronized with published npm version
104
- - GitHub Actions workflow simplified and validates successfully with actionlint (ADR 005)
105
- - Conventional commit message format adopted and documented for contributors
106
-
107
- ## Pros and Cons of the Options
108
-
109
- ### semantic-release with conventional commits
110
-
111
- Comprehensive automated release management based on commit message analysis.
112
-
113
- - Good, because industry standard tool with extensive ecosystem
114
- - Good, because proper semantic version determination based on commit analysis
115
- - Good, because automatic CHANGELOG.md and release notes generation
116
- - Good, because creates git tags and GitHub releases automatically
117
- - Good, because only publishes when changes warrant a release
118
- - Good, because eliminates custom version increment logic complexity
119
- - Good, because maintains git history and package.json synchronization
120
- - Good, because follows conventional commits standard
121
- - Good, because comprehensive documentation and community support
122
- - Neutral, because requires conventional commit message discipline
123
- - Neutral, because adds dependency on semantic-release ecosystem
124
- - Bad, because requires git write permissions in CI/CD
125
- - Bad, because learning curve for commit message conventions
126
-
127
- ### Enhanced in-memory version increment with loop logic
128
-
129
- Improve the current approach with better version conflict resolution.
130
-
131
- - Good, because builds on existing working foundation
132
- - Good, because no external dependencies or new tooling
133
- - Good, because maintains current simplicity of git read-only CI/CD
134
- - Neutral, because addresses immediate technical limitation
135
- - Bad, because still provides only patch-level version increments
136
- - Bad, because no semantic version determination capability
137
- - Bad, because no automatic changelog or git tag generation
138
- - Bad, because increases complexity of custom GitHub Actions logic
139
- - Bad, because doesn't address package.json/npm version synchronization
140
- - Bad, because potential for workflow validation issues with complex logic
141
-
142
- ### Git write-back approach with automated tagging
143
-
144
- Custom solution with git operations for version commits and tagging.
145
-
146
- - Good, because provides git tag creation and version history
147
- - Good, because maintains package.json synchronization
148
- - Good, because can be customized for specific project needs
149
- - Neutral, because requires git write permissions
150
- - Bad, because requires complex infinite loop prevention logic
151
- - Bad, because no semantic version determination
152
- - Bad, because no automated changelog generation
153
- - Bad, because potential race conditions in CI/CD
154
- - Bad, because increased failure modes with git operations
155
- - Bad, because custom implementation maintenance burden
156
-
157
- ### Manual release workflow with GitHub releases
158
-
159
- Manual release creation through GitHub interface with automated publishing.
160
-
161
- - Good, because provides full control over release timing and messaging
162
- - Good, because natural integration with GitHub releases interface
163
- - Good, because allows for manual changelog and release notes
164
- - Good, because no automated commit message requirements
165
- - Neutral, because requires manual intervention for releases
166
- - Bad, because breaks continuous delivery principle
167
- - Bad, because prone to human error and forgotten releases
168
- - Bad, because no automation of version determination
169
- - Bad, because workflow friction for regular development
170
- - Bad, because doesn't solve original npm publish failure problem
171
-
172
- ## More Information
173
-
174
- This decision supersedes ADR 004 "Automated Version Bumping for CI/CD Publishing", which served as a temporary solution to prevent npm publish failures but has reached its limitations in terms of semantic versioning and release management.
175
-
176
- semantic-release configuration will include:
177
-
178
- ```json
179
- {
180
- "branches": ["main"],
181
- "plugins": [
182
- "@semantic-release/commit-analyzer",
183
- "@semantic-release/release-notes-generator",
184
- "@semantic-release/changelog",
185
- "@semantic-release/npm",
186
- "@semantic-release/github"
187
- ]
188
- }
189
- ```
190
-
191
- **Note**: The `@semantic-release/git` plugin is intentionally excluded. semantic-release will manage versions through git tags only, without committing version changes back to package.json. This approach:
192
-
193
- - Prevents infinite CI loops from version commits
194
- - Follows npm ecosystem best practices where tags are the source of truth
195
- - Keeps the repository history clean of automated version bump commits
196
- - Aligns with how other projects in the ecosystem use semantic-release
197
-
198
- The published npm package will have the correct version, but package.json in the repository may not reflect the latest published version. Git tags serve as the authoritative version record.
199
-
200
- Conventional commit format examples:
201
-
202
- - `feat: add new validation rule` → minor version increment
203
- - `fix: resolve annotation parsing issue` → patch version increment
204
- - `feat!: change API interface` → major version increment
205
- - `docs: update README` → no version increment
206
-
207
- GitHub Actions workflow simplification:
208
-
209
- - Remove custom version increment logic
210
- - Replace with single `npx semantic-release` command
211
- - Configure necessary permissions (contents:write, issues:write, pull-requests:write, id-token:write)
212
- - Set HUSKY=0 environment variable to disable git hooks during release
213
- - Maintain existing quality checks and security audits
214
- - Add smoke test for published package verification
215
-
216
- This decision should be re-evaluated if:
217
-
218
- - Conventional commit discipline becomes difficult to maintain
219
- - semantic-release ecosystem introduces breaking changes or maintenance issues
220
- - Project requirements change to need custom release logic not supported by semantic-release
221
- - Team prefers different commit message standards incompatible with conventional commits
222
-
223
- Related resources:
224
-
225
- - [semantic-release Documentation](https://semantic-release.gitbook.io/)
226
- - [Conventional Commits Specification](https://www.conventionalcommits.org/)
227
- - [GitHub Actions with semantic-release](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/github-actions.md)