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.
- package/lib/src/index.d.ts +80 -0
- package/lib/src/index.js +58 -0
- package/lib/src/maintenance/batch.d.ts +16 -0
- package/lib/src/maintenance/batch.js +28 -0
- package/lib/src/maintenance/detect.d.ts +6 -0
- package/lib/src/maintenance/detect.js +69 -0
- package/lib/src/maintenance/index.js +22 -0
- package/lib/src/maintenance/report.d.ts +7 -0
- package/lib/src/maintenance/report.js +17 -0
- package/lib/src/maintenance/update.d.ts +6 -0
- package/lib/src/maintenance/update.js +67 -0
- package/lib/src/maintenance/utils.d.ts +6 -0
- package/lib/src/maintenance/utils.js +64 -0
- package/lib/src/rules/require-branch-annotation.d.ts +7 -0
- package/lib/src/rules/require-branch-annotation.js +111 -0
- package/lib/src/rules/require-req-annotation.d.ts +7 -0
- package/lib/src/rules/require-req-annotation.js +38 -0
- package/lib/src/rules/require-story-annotation.d.ts +7 -0
- package/lib/src/rules/require-story-annotation.js +50 -0
- package/lib/src/rules/valid-annotation-format.d.ts +10 -0
- package/lib/src/rules/valid-annotation-format.js +60 -0
- package/lib/src/rules/valid-req-reference.d.ts +3 -0
- package/lib/src/rules/valid-req-reference.js +104 -0
- package/lib/src/rules/valid-story-reference.d.ts +3 -0
- package/lib/src/rules/valid-story-reference.js +168 -0
- package/lib/tests/fixtures/stale/example.d.ts +0 -0
- package/{tests/fixtures/stale/example.ts → lib/tests/fixtures/stale/example.js} +1 -0
- package/lib/tests/fixtures/update/example.d.ts +0 -0
- package/{tests/fixtures/update/example.ts → lib/tests/fixtures/update/example.js} +1 -0
- package/lib/tests/fixtures/valid-annotations/example.d.ts +0 -0
- package/{tests/fixtures/valid-annotations/example.ts → lib/tests/fixtures/valid-annotations/example.js} +1 -0
- package/lib/tests/maintenance/batch.test.d.ts +1 -0
- package/lib/tests/maintenance/batch.test.js +79 -0
- package/lib/tests/maintenance/detect-isolated.test.d.ts +1 -0
- package/lib/tests/maintenance/detect-isolated.test.js +95 -0
- package/lib/tests/maintenance/detect.test.d.ts +1 -0
- package/lib/tests/maintenance/detect.test.js +23 -0
- package/lib/tests/maintenance/report.test.d.ts +1 -0
- package/lib/tests/maintenance/report.test.js +67 -0
- package/lib/tests/maintenance/update-isolated.test.d.ts +1 -0
- package/lib/tests/maintenance/update-isolated.test.js +66 -0
- package/lib/tests/maintenance/update.test.d.ts +1 -0
- package/lib/tests/maintenance/update.test.js +26 -0
- package/lib/tests/plugin-default-export-and-configs.test.d.ts +1 -0
- package/lib/tests/plugin-default-export-and-configs.test.js +72 -0
- package/lib/tests/plugin-setup.test.d.ts +1 -0
- package/lib/tests/plugin-setup.test.js +51 -0
- package/lib/tests/rules/require-branch-annotation.test.d.ts +1 -0
- package/lib/tests/rules/require-branch-annotation.test.js +253 -0
- package/lib/tests/rules/require-req-annotation.test.d.ts +1 -0
- package/lib/tests/rules/require-req-annotation.test.js +41 -0
- package/lib/tests/rules/require-story-annotation.test.d.ts +1 -0
- package/lib/tests/rules/require-story-annotation.test.js +36 -0
- package/lib/tests/rules/valid-annotation-format.test.d.ts +1 -0
- package/lib/tests/rules/valid-annotation-format.test.js +58 -0
- package/lib/tests/rules/valid-req-reference.test.d.ts +1 -0
- package/lib/tests/rules/valid-req-reference.test.js +87 -0
- package/lib/tests/rules/valid-story-reference.test.d.ts +1 -0
- package/lib/tests/rules/valid-story-reference.test.js +69 -0
- package/package.json +6 -1
- package/.env.example +0 -6
- package/.github/workflows/ci-cd.yml +0 -107
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -27
- package/.prettierrc +0 -4
- package/.releaserc.json +0 -15
- package/.voder/history.md +0 -162
- package/.voder/implementation-progress.md +0 -144
- package/.voder/last-action.md +0 -83
- package/.voder/plan.md +0 -12
- package/.voder/progress-chart.png +0 -0
- package/.voder/progress-log-areas.csv +0 -39
- package/.voder/progress-log.csv +0 -38
- package/.voder/traceability/docs-stories-001.0-DEV-PLUGIN-SETUP.story.xml +0 -17
- package/.voder/traceability/docs-stories-002.0-DEV-ESLINT-CONFIG.story.xml +0 -13
- package/.voder/traceability/docs-stories-003.0-DEV-FUNCTION-ANNOTATIONS.story.xml +0 -9
- package/.voder/traceability/docs-stories-004.0-DEV-BRANCH-ANNOTATIONS.story.xml +0 -9
- package/.voder/traceability/docs-stories-005.0-DEV-ANNOTATION-VALIDATION.story.xml +0 -9
- package/.voder/traceability/docs-stories-006.0-DEV-FILE-VALIDATION.story.xml +0 -9
- package/.voder/traceability/docs-stories-007.0-DEV-ERROR-REPORTING.story.xml +0 -9
- package/.voder/traceability/docs-stories-008.0-DEV-AUTO-FIX.story.xml +0 -9
- package/.voder/traceability/docs-stories-009.0-DEV-MAINTENANCE-TOOLS.story.xml +0 -16
- package/.voder/traceability/docs-stories-010.0-DEV-DEEP-VALIDATION.story.xml +0 -11
- package/CHANGELOG.md +0 -57
- package/CONTRIBUTING.md +0 -99
- package/cli-integration.js +0 -103
- package/docs/cli-integration.md +0 -105
- package/docs/config-presets.md +0 -38
- package/docs/conventional-commits-guide.md +0 -185
- package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +0 -111
- package/docs/decisions/002-jest-for-eslint-testing.accepted.md +0 -137
- package/docs/decisions/003-code-quality-ratcheting-plan.md +0 -48
- package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +0 -196
- package/docs/decisions/005-github-actions-validation-tooling.accepted.md +0 -144
- package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +0 -227
- package/docs/eslint-9-setup-guide.md +0 -517
- package/docs/eslint-plugin-development-guide.md +0 -483
- package/docs/jest-testing-guide.md +0 -100
- package/docs/rules/require-branch-annotation.md +0 -34
- package/docs/rules/require-req-annotation.md +0 -39
- package/docs/rules/require-story-annotation.md +0 -36
- package/docs/rules/valid-annotation-format.md +0 -52
- package/docs/rules/valid-req-reference.md +0 -58
- package/docs/rules/valid-story-reference.md +0 -47
- package/docs/security-incidents/unresolved-vulnerabilities.md +0 -11
- package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +0 -82
- package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +0 -82
- package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +0 -85
- package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +0 -107
- package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +0 -119
- package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +0 -127
- package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +0 -89
- package/docs/stories/008.0-DEV-AUTO-FIX.story.md +0 -104
- package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +0 -104
- package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +0 -110
- package/docs/stories/developer-story.map.md +0 -118
- package/eslint.config.js +0 -146
- package/jest.config.js +0 -21
- package/scripts/smoke-test.sh +0 -45
- package/src/index.ts +0 -56
- package/src/maintenance/batch.ts +0 -29
- package/src/maintenance/detect.ts +0 -42
- package/src/maintenance/report.ts +0 -15
- package/src/maintenance/update.ts +0 -40
- package/src/maintenance/utils.ts +0 -28
- package/src/rules/require-branch-annotation.ts +0 -114
- package/src/rules/require-req-annotation.ts +0 -36
- package/src/rules/require-story-annotation.ts +0 -52
- package/src/rules/valid-annotation-format.ts +0 -62
- package/src/rules/valid-req-reference.ts +0 -114
- package/src/rules/valid-story-reference.ts +0 -213
- package/tests/fixtures/story_bullet.md +0 -6
- package/tests/maintenance/batch.test.ts +0 -55
- package/tests/maintenance/detect-isolated.test.ts +0 -65
- package/tests/maintenance/detect.test.ts +0 -19
- package/tests/maintenance/report.test.ts +0 -37
- package/tests/maintenance/update-isolated.test.ts +0 -39
- package/tests/maintenance/update.test.ts +0 -21
- package/tests/plugin-default-export-and-configs.test.ts +0 -50
- package/tests/plugin-setup.test.ts +0 -17
- package/tests/rules/require-branch-annotation.test.ts +0 -250
- package/tests/rules/require-req-annotation.test.ts +0 -38
- package/tests/rules/require-story-annotation.test.ts +0 -33
- package/tests/rules/valid-annotation-format.test.ts +0 -55
- package/tests/rules/valid-req-reference.test.ts +0 -85
- package/tests/rules/valid-story-reference.test.ts +0 -66
- package/tsconfig.json +0 -15
- package/user-docs/api-reference.md +0 -135
- package/user-docs/examples.md +0 -73
- package/user-docs/migration-guide.md +0 -71
- /package/{src/maintenance/index.ts → lib/src/maintenance/index.d.ts} +0 -0
package/user-docs/examples.md
DELETED
|
@@ -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.
|
|
File without changes
|