eslint-plugin-traceability 1.7.0 → 1.8.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/CHANGELOG.md +82 -0
- package/README.md +73 -32
- package/docs/ci-cd-pipeline.md +224 -0
- package/docs/cli-integration.md +22 -0
- package/docs/code-quality-refactor-opportunities-2025-12-03.md +78 -0
- package/docs/config-presets.md +38 -0
- package/docs/conventional-commits-guide.md +185 -0
- package/docs/custom-rules-development-guide.md +659 -0
- package/docs/decisions/0001-allow-dynamic-require-for-built-plugins.md +26 -0
- package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +111 -0
- package/docs/decisions/002-jest-for-eslint-testing.accepted.md +137 -0
- package/docs/decisions/003-code-quality-ratcheting-plan.md +48 -0
- package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +196 -0
- package/docs/decisions/005-github-actions-validation-tooling.accepted.md +144 -0
- package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +227 -0
- package/docs/decisions/007-github-releases-over-changelog.accepted.md +216 -0
- package/docs/decisions/008-ci-audit-flags.accepted.md +60 -0
- package/docs/decisions/009-security-focused-lint-rules.accepted.md +64 -0
- package/docs/decisions/010-implements-annotation-for-multi-story-requirements.proposed.md +184 -0
- package/docs/decisions/adr-0001-console-usage-for-cli-guards.md +190 -0
- package/docs/decisions/adr-accept-dev-dep-risk-glob.md +40 -0
- package/docs/decisions/adr-commit-branch-tests.md +54 -0
- package/docs/decisions/adr-maintenance-cli-interface.md +140 -0
- package/docs/decisions/adr-pre-push-parity.md +112 -0
- package/docs/decisions/code-quality-ratcheting-plan.md +53 -0
- package/docs/dependency-health.md +238 -0
- package/docs/eslint-9-setup-guide.md +517 -0
- package/docs/eslint-plugin-development-guide.md +487 -0
- package/docs/functionality-coverage-2025-12-03.md +250 -0
- package/docs/jest-testing-guide.md +100 -0
- package/docs/rules/prefer-implements-annotation.md +219 -0
- package/docs/rules/require-branch-annotation.md +71 -0
- package/docs/rules/require-req-annotation.md +203 -0
- package/docs/rules/require-story-annotation.md +159 -0
- package/docs/rules/valid-annotation-format.md +418 -0
- package/docs/rules/valid-req-reference.md +153 -0
- package/docs/rules/valid-story-reference.md +120 -0
- package/docs/security-incidents/2025-11-17-glob-cli-incident.md +45 -0
- package/docs/security-incidents/2025-11-18-brace-expansion-redos.md +45 -0
- package/docs/security-incidents/2025-11-18-bundled-dev-deps-accepted-risk.md +93 -0
- package/docs/security-incidents/2025-11-18-tar-race-condition.md +43 -0
- package/docs/security-incidents/2025-12-03-dependency-health-review.md +58 -0
- package/docs/security-incidents/SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md +104 -0
- package/docs/security-incidents/SECURITY-INCIDENT-TEMPLATE.md +37 -0
- package/docs/security-incidents/dependency-override-rationale.md +57 -0
- package/docs/security-incidents/dev-deps-high.json +116 -0
- package/docs/security-incidents/handling-procedure.md +54 -0
- package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +92 -0
- package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +82 -0
- package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +112 -0
- package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +153 -0
- package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +138 -0
- package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +144 -0
- package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +163 -0
- package/docs/stories/008.0-DEV-AUTO-FIX.story.md +150 -0
- package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +117 -0
- package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +124 -0
- package/docs/stories/010.1-DEV-CONFIGURABLE-PATTERNS.story.md +149 -0
- package/docs/stories/010.2-DEV-MULTI-STORY-SUPPORT.story.md +216 -0
- package/docs/stories/010.3-DEV-MIGRATE-TO-IMPLEMENTS.story.md +236 -0
- package/docs/stories/developer-story.map.md +120 -0
- package/docs/ts-jest-presets-guide.md +548 -0
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js +2 -0
- package/lib/src/maintenance/batch.d.ts +5 -0
- package/lib/src/maintenance/batch.js +5 -0
- package/lib/src/maintenance/cli.js +34 -212
- package/lib/src/maintenance/commands.d.ts +32 -0
- package/lib/src/maintenance/commands.js +139 -0
- package/lib/src/maintenance/detect.d.ts +2 -0
- package/lib/src/maintenance/detect.js +4 -0
- package/lib/src/maintenance/flags.d.ts +99 -0
- package/lib/src/maintenance/flags.js +121 -0
- package/lib/src/maintenance/report.d.ts +2 -0
- package/lib/src/maintenance/report.js +2 -0
- package/lib/src/maintenance/update.d.ts +4 -0
- package/lib/src/maintenance/update.js +4 -0
- package/lib/src/rules/helpers/require-story-io.d.ts +3 -0
- package/lib/src/rules/helpers/require-story-io.js +20 -6
- package/lib/src/rules/helpers/valid-annotation-format-internal.d.ts +30 -0
- package/lib/src/rules/helpers/valid-annotation-format-internal.js +36 -0
- package/lib/src/rules/helpers/valid-annotation-options.js +15 -4
- package/lib/src/rules/helpers/valid-annotation-utils.js +5 -0
- package/lib/src/rules/helpers/valid-implements-utils.d.ts +75 -0
- package/lib/src/rules/helpers/valid-implements-utils.js +149 -0
- package/lib/src/rules/helpers/valid-story-reference-helpers.d.ts +3 -4
- package/lib/src/rules/prefer-implements-annotation.d.ts +39 -0
- package/lib/src/rules/prefer-implements-annotation.js +276 -0
- package/lib/src/rules/valid-annotation-format.js +87 -28
- package/lib/src/rules/valid-req-reference.js +71 -0
- package/lib/src/utils/reqAnnotationDetection.d.ts +4 -1
- package/lib/src/utils/reqAnnotationDetection.js +43 -15
- package/lib/tests/maintenance/cli.test.js +89 -0
- package/lib/tests/plugin-default-export-and-configs.test.js +3 -0
- package/lib/tests/rules/prefer-implements-annotation.test.d.ts +1 -0
- package/lib/tests/rules/prefer-implements-annotation.test.js +84 -0
- package/lib/tests/rules/require-req-annotation.test.js +8 -1
- package/lib/tests/rules/require-story-annotation.test.js +9 -4
- package/lib/tests/rules/valid-annotation-format.test.js +78 -0
- package/lib/tests/rules/valid-req-reference.test.js +34 -0
- package/lib/tests/utils/ts-language-options.d.ts +1 -7
- package/lib/tests/utils/ts-language-options.js +8 -5
- package/package.json +7 -3
- package/user-docs/api-reference.md +507 -0
- package/user-docs/eslint-9-setup-guide.md +639 -0
- package/user-docs/examples.md +74 -0
- package/user-docs/migration-guide.md +158 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Conventional Commits Guide
|
|
2
|
+
|
|
3
|
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) to enable automated semantic versioning and changelog generation through semantic-release.
|
|
4
|
+
|
|
5
|
+
## Commit Message Format
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
<type>[optional scope]: <description>
|
|
9
|
+
|
|
10
|
+
[optional body]
|
|
11
|
+
|
|
12
|
+
[optional footer(s)]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Types and Version Impact
|
|
16
|
+
|
|
17
|
+
### `feat`: New Features (Minor Version)
|
|
18
|
+
|
|
19
|
+
- Adds new functionality
|
|
20
|
+
- Results in a **minor** version increment (e.g., 1.0.0 → 1.1.0)
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
feat: add new validation rule for story references
|
|
26
|
+
feat(rules): implement require-branch-annotation rule
|
|
27
|
+
feat: add CLI integration for batch processing
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### `fix`: Bug Fixes (Patch Version)
|
|
31
|
+
|
|
32
|
+
- Fixes existing functionality
|
|
33
|
+
- Results in a **patch** version increment (e.g., 1.0.0 → 1.0.1)
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
fix: resolve annotation parsing for multiline comments
|
|
39
|
+
fix(validation): handle edge case in reference checking
|
|
40
|
+
fix: prevent false positives in story reference detection
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Breaking Changes (Major Version)
|
|
44
|
+
|
|
45
|
+
- Any commit with `!` after the type or `BREAKING CHANGE:` in footer
|
|
46
|
+
- Results in a **major** version increment (e.g., 1.0.0 → 2.0.0)
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
feat!: change API interface for rule configuration
|
|
52
|
+
fix!: remove deprecated annotation format support
|
|
53
|
+
|
|
54
|
+
feat: add new validation options
|
|
55
|
+
|
|
56
|
+
BREAKING CHANGE: The `allowUnresolved` option has been removed.
|
|
57
|
+
Use `strict: false` instead.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Other Types (No Version Change)
|
|
61
|
+
|
|
62
|
+
These don't trigger releases but appear in changelog:
|
|
63
|
+
|
|
64
|
+
- `docs`: Documentation changes
|
|
65
|
+
- `style`: Code style changes (formatting, etc.)
|
|
66
|
+
- `refactor`: Code refactoring without functional changes
|
|
67
|
+
- `test`: Adding or updating tests
|
|
68
|
+
- `chore`: Build process, auxiliary tools, or maintenance
|
|
69
|
+
- `perf`: Performance improvements
|
|
70
|
+
- `ci`: CI/CD configuration changes
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
docs: update README with installation instructions
|
|
76
|
+
test: add unit tests for validation rules
|
|
77
|
+
chore: update dependencies to latest versions
|
|
78
|
+
ci: configure semantic-release for automated publishing
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Scopes (Optional)
|
|
82
|
+
|
|
83
|
+
Use scopes to specify what part of the codebase is affected:
|
|
84
|
+
|
|
85
|
+
- `rules`: ESLint rule implementations
|
|
86
|
+
- `maintenance`: Maintenance scripts and utilities
|
|
87
|
+
- `cli`: Command-line integration tools
|
|
88
|
+
- `config`: Configuration and setup files
|
|
89
|
+
- `deps`: Dependency updates
|
|
90
|
+
|
|
91
|
+
Examples:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
feat(rules): add valid-annotation-format rule
|
|
95
|
+
fix(maintenance): resolve batch processing memory leak
|
|
96
|
+
docs(config): add ESLint 9 setup guide
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Best Practices
|
|
100
|
+
|
|
101
|
+
### Commit Message Guidelines
|
|
102
|
+
|
|
103
|
+
1. **Use imperative mood**: "add feature" not "added feature"
|
|
104
|
+
2. **Keep subject under 50 characters**: For better git log readability
|
|
105
|
+
3. **Capitalize the subject line**: Start with capital letter
|
|
106
|
+
4. **No period at the end**: Of the subject line
|
|
107
|
+
5. **Explain what and why**: In the body, not how
|
|
108
|
+
|
|
109
|
+
### When to Use Each Type
|
|
110
|
+
|
|
111
|
+
**Use `feat` when:**
|
|
112
|
+
|
|
113
|
+
- Adding new ESLint rules
|
|
114
|
+
- Adding new maintenance utilities
|
|
115
|
+
- Adding new configuration options
|
|
116
|
+
- Adding new CLI commands or features
|
|
117
|
+
|
|
118
|
+
**Use `fix` when:**
|
|
119
|
+
|
|
120
|
+
- Fixing rule logic or false positives/negatives
|
|
121
|
+
- Fixing crashes or runtime errors
|
|
122
|
+
- Fixing configuration issues
|
|
123
|
+
- Fixing documentation errors
|
|
124
|
+
|
|
125
|
+
**Use `refactor` when:**
|
|
126
|
+
|
|
127
|
+
- Improving code structure without changing behavior
|
|
128
|
+
- Renaming variables or functions
|
|
129
|
+
- Extracting common functionality
|
|
130
|
+
- Simplifying complex logic
|
|
131
|
+
|
|
132
|
+
**Use `docs` when:**
|
|
133
|
+
|
|
134
|
+
- Updating README, guides, or API documentation
|
|
135
|
+
- Adding code comments or JSDoc
|
|
136
|
+
- Updating examples or migration guides
|
|
137
|
+
|
|
138
|
+
### Example Workflow
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# New feature
|
|
142
|
+
git commit -m "feat(rules): add require-story-annotation rule
|
|
143
|
+
|
|
144
|
+
Implements validation to ensure all functions have @story annotations
|
|
145
|
+
linking them to user stories for traceability.
|
|
146
|
+
|
|
147
|
+
Resolves: #123"
|
|
148
|
+
|
|
149
|
+
# Bug fix
|
|
150
|
+
git commit -m "fix: resolve false positive in annotation parsing
|
|
151
|
+
|
|
152
|
+
The regex pattern was incorrectly matching inline comments.
|
|
153
|
+
Updated to only match block comments that start at beginning of line."
|
|
154
|
+
|
|
155
|
+
# Breaking change
|
|
156
|
+
git commit -m "feat!: change rule configuration schema
|
|
157
|
+
|
|
158
|
+
BREAKING CHANGE: Rule options now use 'patterns' instead of 'pattern'.
|
|
159
|
+
Update your ESLint config:
|
|
160
|
+
- Before: { "pattern": "REQ-*" }
|
|
161
|
+
+ After: { "patterns": ["REQ-*"] }"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Integration with semantic-release
|
|
165
|
+
|
|
166
|
+
semantic-release analyzes commit messages to:
|
|
167
|
+
|
|
168
|
+
1. **Determine version bump**: Based on feat/fix/breaking change types
|
|
169
|
+
2. **Generate changelog**: From commit messages and pull request information
|
|
170
|
+
3. **Create git tags**: For each release
|
|
171
|
+
4. **Publish to npm**: Only when changes warrant a release
|
|
172
|
+
|
|
173
|
+
## Validation
|
|
174
|
+
|
|
175
|
+
Pre-commit hooks will validate your commit messages follow the conventional format. If you need to bypass validation temporarily (not recommended), use:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
git commit --no-verify -m "your message"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Resources
|
|
182
|
+
|
|
183
|
+
- [Conventional Commits Specification](https://www.conventionalcommits.org/)
|
|
184
|
+
- [semantic-release Documentation](https://semantic-release.gitbook.io/)
|
|
185
|
+
- [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format)
|