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.
- package/package.json +6 -1
- package/.env.example +0 -6
- package/.github/workflows/ci-cd.yml +0 -110
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -27
- package/.prettierrc +0 -4
- package/.releaserc.json +0 -20
- 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 -58
- 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 -51
- package/src/index.ts +0 -56
- package/src/maintenance/batch.ts +0 -29
- package/src/maintenance/detect.ts +0 -42
- package/src/maintenance/index.ts +0 -14
- 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/stale/example.ts +0 -2
- package/tests/fixtures/story_bullet.md +0 -6
- package/tests/fixtures/update/example.ts +0 -2
- package/tests/fixtures/valid-annotations/example.ts +0 -2
- 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
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
overall,functionality,code_quality,testing,execution,documentation,dependencies,security,vcs
|
|
2
|
-
12.5,,10,0,0,55,5,10,20
|
|
3
|
-
46,,68,90,60,35,85,0,30
|
|
4
|
-
47,,90,30,90,50,80,0,35
|
|
5
|
-
60.5,,72,25,95,75,100,92,25
|
|
6
|
-
64.13,,75,85,90,48,90,95,30
|
|
7
|
-
70,,90,92,75,55,95,95,55
|
|
8
|
-
68.5,,90,75,90,25,98,95,75
|
|
9
|
-
72.25,,78,80,85,50,95,100,90
|
|
10
|
-
71.25,,92,90,35,70,95,100,88
|
|
11
|
-
75,,90,75,65,87,100,95,90
|
|
12
|
-
78,,75,85,90,90,95,95,95
|
|
13
|
-
80.4,,90,88,80,90,100,100,95
|
|
14
|
-
81,,92,85,85,92,100,100,95
|
|
15
|
-
80.25,,85,90,90,92,100,95,90
|
|
16
|
-
75,,92,90,90,82,98,100,55
|
|
17
|
-
85,,90,90,90,85,100,100,98
|
|
18
|
-
93.14,,90,92,95,88,97,98,92
|
|
19
|
-
80,,85,90,92,88,98,100,90
|
|
20
|
-
76,,92,85,75,85,95,95,80
|
|
21
|
-
89,,70,92,90,80,98,100,90
|
|
22
|
-
77.25,,90,90,95,65,100,88,90
|
|
23
|
-
73.12,,85,92,90,45,100,98,75
|
|
24
|
-
89,50,90,92,92,90,100,100,95
|
|
25
|
-
78.5,,92,88,88,90,100,100,70
|
|
26
|
-
79.4,,80,90,90,90,95,95,95
|
|
27
|
-
77.9,,70,96,95,70,100,100,92
|
|
28
|
-
75,,75,95,90,92,90,100,90
|
|
29
|
-
85,,90,90,90,95,100,90,85
|
|
30
|
-
75.625,,80,95,88,92,100,100,50
|
|
31
|
-
90.5,60,90,92,92,92,100,100,98
|
|
32
|
-
77.5,,77,60,93,95,100,100,95
|
|
33
|
-
76.875,,93,92,95,85,100,95,55
|
|
34
|
-
89.6,,90,90,95,82,100,95,75
|
|
35
|
-
91,,93,87,95,85,100,95,85
|
|
36
|
-
78.25,,70,85,95,85,100,98,93
|
|
37
|
-
89.6,,95,92,95,90,100,95,60
|
|
38
|
-
72.5,,80,95,95,55,100,95,60
|
|
39
|
-
75.25,,85,95,85,92,95,95,55
|
package/.voder/progress-log.csv
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
12.5
|
|
2
|
-
46
|
|
3
|
-
47
|
|
4
|
-
60.5
|
|
5
|
-
64.13
|
|
6
|
-
70
|
|
7
|
-
68.5
|
|
8
|
-
72.25
|
|
9
|
-
71.25
|
|
10
|
-
75
|
|
11
|
-
78
|
|
12
|
-
80.4
|
|
13
|
-
81
|
|
14
|
-
80.25
|
|
15
|
-
75
|
|
16
|
-
85
|
|
17
|
-
93.14
|
|
18
|
-
80
|
|
19
|
-
76
|
|
20
|
-
89
|
|
21
|
-
77.25
|
|
22
|
-
73.12
|
|
23
|
-
89
|
|
24
|
-
78.5
|
|
25
|
-
79.4
|
|
26
|
-
77.9
|
|
27
|
-
75
|
|
28
|
-
85
|
|
29
|
-
75.625
|
|
30
|
-
90.5
|
|
31
|
-
77.5
|
|
32
|
-
76.875
|
|
33
|
-
89.6
|
|
34
|
-
91
|
|
35
|
-
78.25
|
|
36
|
-
89.6
|
|
37
|
-
72.5
|
|
38
|
-
75.25
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/001.0-DEV-PLUGIN-SETUP.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:05:11.795Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.385Z</last_modified>
|
|
7
|
-
<evidence>- src/index.ts exports plugin.rules and plugin.configs in standard ESLint plugin structure with TypeScript and traceability annotations (@story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md, @req REQ-PLUGIN-STRUCTURE).
|
|
8
|
-
- package.json defines main and types fields, scripts for build, lint, test, and peerDependencies, conforming to npm package conventions.
|
|
9
|
-
- tsconfig.json and build script (`npm run build`) compile TypeScript source to CommonJS without errors.
|
|
10
|
-
- tests/basic.test.ts verifies that plugin.rules and plugin.configs are defined and correctly exported (Basic plugin structure test for Story 001.0).
|
|
11
|
-
- tests/integration/plugin-validation.test.ts invokes ESLint CLI with flat config (eslint.config.js) and confirms rule errors as expected, demonstrating ESLint v9 flat config integration.
|
|
12
|
-
- README.md and docs/eslint-9-setup-guide.md include clear installation and configuration instructions for the plugin.
|
|
13
|
-
- eslint.config.js handles plugin loading errors via try/catch, satisfying graceful error handling.
|
|
14
|
-
- All Jest tests pass under CI (`npm test`), and CLI integration script (cli-integration.js) also confirms plugin registration behavior.
|
|
15
|
-
</evidence>
|
|
16
|
-
<notes>The foundational ESLint plugin structure defined in 001.0-DEV-PLUGIN-SETUP has been implemented: the plugin registers rules and configs, compiles cleanly under TypeScript, integrates with ESLint v9 flat config, includes comprehensive tests for module exports and CLI behavior, and provides clear documentation and error handling. All acceptance criteria and technical requirements for this story are satisfied.</notes>
|
|
17
|
-
</traceability>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/002.0-DEV-ESLINT-CONFIG.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:05:16.869Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.396Z</last_modified>
|
|
7
|
-
<evidence>- src/index.ts exports `configs.recommended` and `configs.strict` with the required rule presets (REQ-CONFIG-PRESETS)
|
|
8
|
-
- eslint.config.js is written in ESLint v9 flat‐config format and includes sections for JS, TS, common CJS files, and ignores (REQ-FLAT-CONFIG)
|
|
9
|
-
- valid-story-reference rule schema supports `storyDirectories`, `allowAbsolutePaths`, and `requireStoryExtension` options (REQ-CUSTOMIZABLE-PATHS, REQ-RULE-OPTIONS)
|
|
10
|
-
- CI build and linting pass without errors, demonstrating seamless integration (EXECUTION reports 92%, CODE_QUALITY reports lint/test/type-check OK)
|
|
11
|
-
- docs/config-presets.md and docs/eslint-9-setup-guide.md provide clear setup instructions, examples, and troubleshooting (Documentation acceptance)</evidence>
|
|
12
|
-
<notes>All acceptance criteria for story 002.0-DEV-ESLINT-CONFIG have been met: the plugin provides both recommended and strict presets, follows ESLint v9 flat config best practices, allows rule customization, integrates with JS/TS projects, and includes comprehensive documentation and configuration validation.</notes>
|
|
13
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md</specification>
|
|
4
|
-
<status>FAILED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:03:12.326Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.405Z</last_modified>
|
|
7
|
-
<evidence>Inspection of src/rules/require-story-annotation.ts and src/rules/require-req-annotation.ts shows only FunctionDeclaration nodes are handled (no arrow functions, function expressions, or class methods), there is no support for TypeScript‐specific syntax or parser configuration in RuleTester (only default parser used), and neither rule exposes configuration to scope which functions are checked or to prioritize exported functions. Key requirements REQ-FUNCTION-DETECTION (expressions/arrow functions), REQ-CONFIGURABLE-SCOPE, REQ-EXPORT-PRIORITY, and REQ-TYPESCRIPT-SUPPORT are not implemented.</evidence>
|
|
8
|
-
<notes>While basic function‐level detection and error reporting exist for missing @story and @req, the implementation does not satisfy the full breadth of acceptance criteria and technical requirements outlined in the story. Additional work is needed to support all function patterns, configurability, and TypeScript integration.</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md</specification>
|
|
4
|
-
<status>FAILED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:03:22.383Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.419Z</last_modified>
|
|
7
|
-
<evidence>In src/rules/require-branch-annotation.ts the rule.meta.schema is an empty array (schema: []), and the documentation (docs/rules/require-branch-annotation.md) explicitly states “This rule does not accept any options.” However, the story’s Requirements include REQ-CONFIGURABLE-SCOPE: “Allow configuration of which branch types require annotations.” There is no code to accept or handle any configuration options for branch scopes, nor any tests for that behavior.</evidence>
|
|
8
|
-
<notes>While the core detection, parsing, and error reporting for branch annotations are implemented and well-tested, the required ability to configure which branch types are enforced is missing. The story is therefore not fully satisfied.</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:03:32.682Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.431Z</last_modified>
|
|
7
|
-
<evidence>The `valid-annotation-format` rule is present in src/rules/valid-annotation-format.ts with appropriate meta, messages, and schema. Tests in tests/rules/valid-annotation-format.test.ts cover valid and invalid @story and @req formats, including block comments and single-line comments, and all tests pass (100% statements, 100% lines, 92.85% branches). Documentation exists at docs/rules/valid-annotation-format.md with examples matching implementation. The rule is exported in src/index.ts and included in both 'recommended' and 'strict' configs. ESLint linting, Jest testing, type checking, and coverage checks all pass.</evidence>
|
|
8
|
-
<notes>The annotation format validation rule fully meets the story’s acceptance criteria: it validates @story and @req syntax, follows ESLint best practices, integrates with other rules, provides clear error messages, handles edge cases (multiline/block comments), and is documented with examples. Tests ensure REQ-FORMAT-SPECIFICATION, REQ-SYNTAX-VALIDATION, REQ-PATH-FORMAT, REQ-REQ-FORMAT, REQ-MULTILINE-SUPPORT, REQ-FLEXIBLE-PARSING, and REQ-ERROR-SPECIFICITY are satisfied.</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/006.0-DEV-FILE-VALIDATION.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:03:17.855Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.445Z</last_modified>
|
|
7
|
-
<evidence>Found src/rules/valid-story-reference.ts with full implementation of REQ-FILE-EXISTENCE, REQ-PATH-RESOLUTION, REQ-SECURITY-VALIDATION, REQ-PERFORMANCE-OPTIMIZATION (caching), REQ-PROJECT-BOUNDARY, and REQ-CONFIGURABLE-PATHS, all annotated with @story docs/stories/006.0-DEV-FILE-VALIDATION.story.md. Corresponding tests in tests/rules/valid-story-reference.test.ts cover valid and invalid scenarios (file exists, extension check, path traversal, absolute paths) and reference the story and requirement IDs. package.json scripts include Jest run, and CI reports 100% passing tests and high coverage.</evidence>
|
|
8
|
-
<notes>The valid-story-reference rule meets all acceptance criteria: core functionality, ESLint best practices, integration with format validation, clear error messages, and documented examples. Tests confirm correct behavior across file system scenarios.</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/007.0-DEV-ERROR-REPORTING.story.md</specification>
|
|
4
|
-
<status>FAILED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:04:41.461Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.454Z</last_modified>
|
|
7
|
-
<evidence>A review of the rule implementations shows that none of the context.report() calls supply “suggest” fixes or instruction text: for example, require-story-annotation only reports messageId “missingStory” with text “Missing @story annotation” and no suggestion on how to add one. None of the rules use ESLint’s suggest API or include actionable guidance (e.g. “Add @story docs/stories/...”) or dynamic context beyond basic identifiers. The docs/rules markdown do not document full error messages or suggestions, and existing unit and CLI tests only assert that errors fire, not that they carry specific, actionable message text or locations beyond the default. </evidence>
|
|
8
|
-
<notes>The 007.0-DEV-ERROR-REPORTING story calls for clear, actionable error messages including suggested fixes, context and consistent formatting. While basic error reporting exists, there is no implementation of suggestion API, no contextual guidance, and no documentation of full message format. Therefore the story is not satisfied.</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/008.0-DEV-AUTO-FIX.story.md</specification>
|
|
4
|
-
<status>FAILED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:04:59.379Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.465Z</last_modified>
|
|
7
|
-
<evidence>Assessment error: 400 This model's maximum context length is 200000 tokens. However, your messages resulted in 206091 tokens (204696 in the messages, 1395 in the functions). Please reduce the length of the messages or functions.</evidence>
|
|
8
|
-
<notes>Technical error during assessment</notes>
|
|
9
|
-
</traceability>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:05:08.140Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.476Z</last_modified>
|
|
7
|
-
<evidence>- src/maintenance/detect.ts, update.ts, batch.ts, report.ts, utils.ts implement all six REQ-MAINT-* requirements with JSDoc @story and @req annotations.
|
|
8
|
-
- tests/maintenance/detect.test.ts & detect-isolated.test.ts cover REQ-MAINT-DETECT (detectStaleAnnotations).
|
|
9
|
-
- tests/maintenance/update.test.ts & update-isolated.test.ts cover REQ-MAINT-UPDATE (updateAnnotationReferences).
|
|
10
|
-
- tests/maintenance/batch.test.ts cover REQ-MAINT-BATCH and REQ-MAINT-VERIFY (batchUpdateAnnotations, verifyAnnotations).
|
|
11
|
-
- tests/maintenance/report.test.ts covers REQ-MAINT-REPORT (generateMaintenanceReport) and implicitly REQ-MAINT-SAFE.
|
|
12
|
-
- npm test (Jest) runs all tests with 100% passing, maintaining >96% coverage in maintenance code.
|
|
13
|
-
- Code preserves formatting, handles missing directories, nested structures, permission errors, and writes updates safely.
|
|
14
|
-
</evidence>
|
|
15
|
-
<notes>All acceptance criteria for story 009.0-DEV-MAINTENANCE-TOOLS are satisfied: core functionality, quality standards, integration, UX feedback, error handling, and documentation via JSDoc and test coverage. Maintenance tools are fully implemented and validated by tests.</notes>
|
|
16
|
-
</traceability>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<traceability>
|
|
3
|
-
<specification>docs/stories/010.0-DEV-DEEP-VALIDATION.story.md</specification>
|
|
4
|
-
<status>PASSED</status>
|
|
5
|
-
<last_validated>2025-11-16T17:03:50.351Z</last_validated>
|
|
6
|
-
<last_modified>2025-11-16T00:07:54.487Z</last_modified>
|
|
7
|
-
<evidence>- src/rules/valid-req-reference.ts implements deep validation logic with AST comment parsing, path resolution, caching, regex-based requirement extraction, and reports both invalidPath and reqMissing messages.
|
|
8
|
-
- Tests in tests/rules/valid-req-reference.test.ts cover valid references (including bullet-list fixture), missing requirements, path traversal, and absolute paths, all passing under Jest: exit code 0, coverage report included.
|
|
9
|
-
- Documentation in docs/rules/valid-req-reference.md and docs/stories/010.0-DEV-DEEP-VALIDATION.story.md align, and the plugin builds, lints, type-checks, and tests successfully (npm test shows 96%+ statements, 84%+ branches overall).</evidence>
|
|
10
|
-
<notes>The implementation provides the required core functionality for deep requirement content validation: it parses story files, matches @req IDs, handles path errors, caches content, reports clear errors, and is fully tested. All acceptance criteria are satisfied.</notes>
|
|
11
|
-
</traceability>
|
package/CHANGELOG.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
## [1.1.1](https://github.com/voder-ai/eslint-plugin-traceability/compare/v1.1.0...v1.1.1) (2025-11-17)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* build project before semantic-release and improve smoke test to use npm pack ([e9621d3](https://github.com/voder-ai/eslint-plugin-traceability/commit/e9621d365bf8ebd36e507052c88ead787703cb17))
|
|
7
|
-
* remove tarballDir option from semantic-release npm plugin ([e3703e5](https://github.com/voder-ai/eslint-plugin-traceability/commit/e3703e5a79e6b0784b98f8f4996083a6040a5fb4))
|
|
8
|
-
|
|
9
|
-
# Changelog
|
|
10
|
-
|
|
11
|
-
All notable changes to this project will be documented in this file.
|
|
12
|
-
|
|
13
|
-
## [1.0.3] - 2025-11-17
|
|
14
|
-
|
|
15
|
-
### Added
|
|
16
|
-
- CLI integration script (`cli-integration.js`) for end-to-end ESLint CLI tests.
|
|
17
|
-
- Migration guide in `user-docs/migration-guide.md`.
|
|
18
|
-
|
|
19
|
-
## [1.0.2] - 2025-11-17
|
|
20
|
-
|
|
21
|
-
### Changed
|
|
22
|
-
- Updated README and docs to reference `cli-integration.js` script.
|
|
23
|
-
- Removed stale references to migration guide in CHANGELOG gradients.
|
|
24
|
-
|
|
25
|
-
## [1.0.1] - 2025-11-17
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
- Detailed API documentation in `user-docs/api-reference.md`
|
|
29
|
-
- New usage examples in `user-docs/examples.md`
|
|
30
|
-
|
|
31
|
-
### Changed
|
|
32
|
-
- Updated `README.md` with advanced usage instructions and migration guide
|
|
33
|
-
- Consolidated CI workflows into a unified GitHub Actions pipeline
|
|
34
|
-
|
|
35
|
-
## [1.0.0] - 2025-11-16
|
|
36
|
-
|
|
37
|
-
### Changed
|
|
38
|
-
- Bumped version to 1.0.0 in package.json.
|
|
39
|
-
- Aligned CHANGELOG with package.json version.
|
|
40
|
-
|
|
41
|
-
## [0.1.0] - 2025-11-16
|
|
42
|
-
|
|
43
|
-
### Added
|
|
44
|
-
- Initial release of `eslint-plugin-traceability`:
|
|
45
|
-
- `require-story-annotation`
|
|
46
|
-
- `require-req-annotation`
|
|
47
|
-
- `require-branch-annotation`
|
|
48
|
-
- `valid-annotation-format`
|
|
49
|
-
- `valid-story-reference`
|
|
50
|
-
- `valid-req-reference`
|
|
51
|
-
- Documentation for all rules under `docs/rules`.
|
|
52
|
-
- Configuration presets in `docs/config-presets.md`.
|
|
53
|
-
- Example usage in `README.md`.
|
|
54
|
-
- Pre-commit and pre-push hooks with formatting, linting, and tests.
|
|
55
|
-
- Comprehensive tests covering core validation rules.
|
|
56
|
-
|
|
57
|
-
### Fixed
|
|
58
|
-
- N/A
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# Contributing to eslint-plugin-traceability
|
|
2
|
-
|
|
3
|
-
Thank you for your interest in contributing to `eslint-plugin-traceability`! We welcome bug reports, feature requests, and pull requests. To ensure a smooth process, please follow the guidelines below.
|
|
4
|
-
|
|
5
|
-
## Reporting Issues
|
|
6
|
-
|
|
7
|
-
If you encounter a bug or have a feature request:
|
|
8
|
-
|
|
9
|
-
1. Search existing issues to see if the problem or suggestion has already been reported.
|
|
10
|
-
2. If not, open a new issue on GitHub: [Issue Tracker](https://github.com/voder-ai/eslint-plugin-traceability/issues).
|
|
11
|
-
3. Provide a clear and descriptive title, steps to reproduce, expected behavior, and any relevant screenshots or logs.
|
|
12
|
-
4. Specify your environment:
|
|
13
|
-
- `node` version: `node -v`
|
|
14
|
-
- `eslint` version: `npx eslint -v`
|
|
15
|
-
- Operating system and shell.
|
|
16
|
-
|
|
17
|
-
## Pull Request Process
|
|
18
|
-
|
|
19
|
-
When submitting a pull request (PR):
|
|
20
|
-
|
|
21
|
-
1. Fork the repository and create a branch for your changes.
|
|
22
|
-
2. Commit your changes in small, logical increments. Use descriptive commit messages.
|
|
23
|
-
3. Ensure all tests pass and the project builds successfully.
|
|
24
|
-
4. Push your branch to GitHub and open a PR against the `main` branch.
|
|
25
|
-
5. Reference any related issues in your PR description.
|
|
26
|
-
6. A maintainer will review your changes and may request updates or approve the PR.
|
|
27
|
-
|
|
28
|
-
## Commit Message Conventions
|
|
29
|
-
|
|
30
|
-
We follow [Conventional Commits](https://www.conventionalcommits.org/) format to enable automated semantic versioning and changelog generation.
|
|
31
|
-
|
|
32
|
-
For detailed guidelines and examples, see [docs/conventional-commits-guide.md](docs/conventional-commits-guide.md).
|
|
33
|
-
|
|
34
|
-
Commit messages should be structured as:
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
type[optional scope]: description
|
|
38
|
-
|
|
39
|
-
[optional body]
|
|
40
|
-
|
|
41
|
-
[optional footer(s)]
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Examples:
|
|
45
|
-
|
|
46
|
-
- `feat: add new validation rule` → minor version increment
|
|
47
|
-
- `fix: resolve parsing issue` → patch version increment
|
|
48
|
-
- `feat!: change API interface` → major version increment
|
|
49
|
-
- `docs: update README` → no version change
|
|
50
|
-
|
|
51
|
-
Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `ci`
|
|
52
|
-
|
|
53
|
-
## Coding Style and Quality Checks
|
|
54
|
-
|
|
55
|
-
We enforce code style and quality using ESLint, Prettier, TypeScript, and other tools. Please run the following commands before submitting your PR:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# Build the project and generate types
|
|
59
|
-
npm run build
|
|
60
|
-
|
|
61
|
-
# Run TypeScript type checks
|
|
62
|
-
npm run type-check
|
|
63
|
-
|
|
64
|
-
# Lint code
|
|
65
|
-
npm run lint
|
|
66
|
-
|
|
67
|
-
# Run tests
|
|
68
|
-
npm test
|
|
69
|
-
|
|
70
|
-
# Check formatting (no changes)
|
|
71
|
-
npm run format:check
|
|
72
|
-
|
|
73
|
-
# Check duplication threshold
|
|
74
|
-
npm run duplication
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Ensure there are no errors or warnings in the output.
|
|
78
|
-
|
|
79
|
-
## Developing Locally
|
|
80
|
-
|
|
81
|
-
1. Clone your fork and install dependencies:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
git clone https://github.com/<your-username>/eslint-plugin-traceability.git
|
|
85
|
-
cd eslint-plugin-traceability
|
|
86
|
-
npm install
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
````
|
|
90
|
-
|
|
91
|
-
2. Run the tests in watch mode:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npm test
|
|
95
|
-
````
|
|
96
|
-
|
|
97
|
-
3. Make your changes, and verify that tests and linting continue to pass.
|
|
98
|
-
|
|
99
|
-
Thank you for helping improve `eslint-plugin-traceability`!
|
package/cli-integration.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLI integration tests script for ESLint Traceability Plugin
|
|
4
|
-
* @story docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
|
|
5
|
-
* @req REQ-PLUGIN-STRUCTURE - Validate plugin registers via CLI
|
|
6
|
-
*/
|
|
7
|
-
const { spawnSync } = require("child_process");
|
|
8
|
-
const path = require("path");
|
|
9
|
-
|
|
10
|
-
// Resolve the ESLint CLI binary and configuration path
|
|
11
|
-
const eslintPkgDir = path.dirname(require.resolve("eslint/package.json"));
|
|
12
|
-
const eslintCliPath = path.join(eslintPkgDir, "bin", "eslint.js");
|
|
13
|
-
const configPath = path.resolve(__dirname, "eslint.config.js");
|
|
14
|
-
|
|
15
|
-
// Define CLI integration test scenarios
|
|
16
|
-
const tests = [
|
|
17
|
-
{
|
|
18
|
-
name: "reports error when @story annotation is missing",
|
|
19
|
-
code: "function foo() {}",
|
|
20
|
-
rule: "traceability/require-story-annotation:error",
|
|
21
|
-
expectedStatus: 1,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "does not report error when @story annotation is present",
|
|
25
|
-
code: `/**
|
|
26
|
-
* @story docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md
|
|
27
|
-
*/
|
|
28
|
-
function foo() {}`,
|
|
29
|
-
rule: "traceability/require-story-annotation:error",
|
|
30
|
-
expectedStatus: 0,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "reports error when @req annotation is missing",
|
|
34
|
-
code: "function bar() {}",
|
|
35
|
-
rule: "traceability/require-req-annotation:error",
|
|
36
|
-
expectedStatus: 1,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "reports error when @story annotation uses path traversal and @req annotation uses path traversal",
|
|
40
|
-
code: `/**
|
|
41
|
-
* @story ../docs/stories/invalid.story.md
|
|
42
|
-
* @req ../docs/requirements/REQ-INVALID.md
|
|
43
|
-
*/
|
|
44
|
-
function bar() {}`,
|
|
45
|
-
rule: "traceability/valid-req-reference:error",
|
|
46
|
-
expectedStatus: 1,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "reports error when @story annotation uses absolute path and @req annotation uses absolute path",
|
|
50
|
-
code: `/**
|
|
51
|
-
* @story /absolute/path/to/story.story.md
|
|
52
|
-
* @req /etc/passwd
|
|
53
|
-
*/
|
|
54
|
-
function baz() {}`,
|
|
55
|
-
rule: "traceability/valid-req-reference:error",
|
|
56
|
-
expectedStatus: 1,
|
|
57
|
-
},
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Run ESLint CLI with given code and rule override
|
|
62
|
-
* @param {string} code Source code to lint via stdin
|
|
63
|
-
* @param {string} rule ESLint rule override e.g. "traceability/require-story-annotation:error"
|
|
64
|
-
* @returns {object} Result of spawnSync call
|
|
65
|
-
*/
|
|
66
|
-
function runEslint(code, rule) {
|
|
67
|
-
const args = [
|
|
68
|
-
"--no-config-lookup",
|
|
69
|
-
"--config",
|
|
70
|
-
configPath,
|
|
71
|
-
"--stdin",
|
|
72
|
-
"--stdin-filename",
|
|
73
|
-
"foo.js",
|
|
74
|
-
"--rule",
|
|
75
|
-
"no-unused-vars:off",
|
|
76
|
-
"--rule",
|
|
77
|
-
rule,
|
|
78
|
-
];
|
|
79
|
-
return spawnSync(process.execPath, [eslintCliPath, ...args], {
|
|
80
|
-
encoding: "utf-8",
|
|
81
|
-
input: code,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Execute tests and report results
|
|
86
|
-
let failures = 0;
|
|
87
|
-
tests.forEach((test) => {
|
|
88
|
-
const result = runEslint(test.code, test.rule);
|
|
89
|
-
const passed = result.status === test.expectedStatus;
|
|
90
|
-
if (passed) {
|
|
91
|
-
console.log(`✓ ${test.name}`);
|
|
92
|
-
} else {
|
|
93
|
-
console.error(`✗ ${test.name}`);
|
|
94
|
-
console.error(
|
|
95
|
-
` Expected exit code ${test.expectedStatus}, got ${result.status}`,
|
|
96
|
-
);
|
|
97
|
-
if (result.stdout) console.error(` stdout: ${result.stdout}`);
|
|
98
|
-
if (result.stderr) console.error(` stderr: ${result.stderr}`);
|
|
99
|
-
failures++;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
process.exit(failures > 0 ? 1 : 0);
|
package/docs/cli-integration.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# CLI Integration Script Documentation
|
|
2
|
-
|
|
3
|
-
This document provides detailed information about the `cli-integration.js` script, which runs end-to-end CLI integration tests for the `eslint-plugin-traceability` plugin.
|
|
4
|
-
|
|
5
|
-
Story: docs/stories/001.0-DEV-PLUGIN-SETUP.story.md
|
|
6
|
-
Requirement: REQ-PLUGIN-STRUCTURE - Validate plugin registers via CLI
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
The `cli-integration.js` script automates tests that invoke the ESLint CLI with the plugin configured, verifying that rule errors are reported (or not) as expected when code is passed via `stdin`.
|
|
11
|
-
|
|
12
|
-
It uses Node.js `child_process.spawnSync` to:
|
|
13
|
-
|
|
14
|
-
- Disable default ESLint config resolution
|
|
15
|
-
- Load the plugin via `eslint.config.js` flat config
|
|
16
|
-
- Pass code and rule settings via `--stdin` and `--rule` flags
|
|
17
|
-
|
|
18
|
-
## Tests Implemented
|
|
19
|
-
|
|
20
|
-
The script defines an array of test scenarios, each with:
|
|
21
|
-
|
|
22
|
-
- **name**: A descriptive test name
|
|
23
|
-
- **code**: A string containing JavaScript code to lint
|
|
24
|
-
- **rule**: An ESLint rule override specifying severity
|
|
25
|
-
- **expectedStatus**: The expected exit code (0 or 1)
|
|
26
|
-
|
|
27
|
-
Current test scenarios:
|
|
28
|
-
|
|
29
|
-
1. `reports error when @story annotation is missing`
|
|
30
|
-
- Code: `function foo() {}`
|
|
31
|
-
- Rule: `traceability/require-story-annotation:error`
|
|
32
|
-
- Expected exit code: 1 (error reported)
|
|
33
|
-
|
|
34
|
-
2. `does not report error when @story annotation is present`
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
/**
|
|
38
|
-
* @story docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md
|
|
39
|
-
*/
|
|
40
|
-
function foo() {}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
- Rule: `traceability/require-story-annotation:error`
|
|
44
|
-
- Expected exit code: 0 (no error)
|
|
45
|
-
|
|
46
|
-
3. `reports error when @req annotation is missing`
|
|
47
|
-
- Code: `function bar() {}`
|
|
48
|
-
- Rule: `traceability/valid-req-reference:error`
|
|
49
|
-
- Expected exit code: 1 (error reported)
|
|
50
|
-
|
|
51
|
-
4. `reports error when @req annotation uses path traversal`
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
/**
|
|
55
|
-
* @req ../docs/requirements/REQ-INVALID.md
|
|
56
|
-
*/
|
|
57
|
-
function bar() {}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
- Rule: `traceability/valid-req-reference:error`
|
|
61
|
-
- Expected exit code: 1 (error reported)
|
|
62
|
-
|
|
63
|
-
5. `reports error when @req annotation uses absolute path`
|
|
64
|
-
|
|
65
|
-
```js
|
|
66
|
-
/**
|
|
67
|
-
* @req /etc/passwd
|
|
68
|
-
*/
|
|
69
|
-
function baz() {}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
- Rule: `traceability/valid-req-reference:error`
|
|
73
|
-
- Expected exit code: 1 (error reported)
|
|
74
|
-
|
|
75
|
-
## Usage
|
|
76
|
-
|
|
77
|
-
Note: The script lives at the project root.
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# Run CLI integration tests
|
|
81
|
-
node ./cli-integration.js
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Integration into CI
|
|
85
|
-
|
|
86
|
-
The CI workflow (`.github/workflows/ci.yml`) includes a separate `integration-tests` job that runs:
|
|
87
|
-
|
|
88
|
-
```yaml
|
|
89
|
-
jobs:
|
|
90
|
-
integration-tests:
|
|
91
|
-
needs: quality-checks
|
|
92
|
-
run: node cli-integration.js
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
This ensures that CLI-level behavior is verified on all supported Node.js versions.
|
|
96
|
-
|
|
97
|
-
## Extending Tests
|
|
98
|
-
|
|
99
|
-
To add new CLI integration scenarios:
|
|
100
|
-
|
|
101
|
-
1. Open `cli-integration.js`.
|
|
102
|
-
2. Append a new object to the `tests` array with the desired `name`, `code`, `rule`, and `expectedStatus`.
|
|
103
|
-
3. Run `node cli-integration.js` locally to verify.
|
|
104
|
-
|
|
105
|
-
Ensure that any new scenarios have clear test names and cover distinct rule behaviors.
|
package/docs/config-presets.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Configuration Presets
|
|
2
|
-
|
|
3
|
-
This document describes the built-in configuration presets provided by the `eslint-plugin-traceability` plugin.
|
|
4
|
-
|
|
5
|
-
## Recommended Preset
|
|
6
|
-
|
|
7
|
-
Use the **recommended** preset to enable the core traceability rule set with default settings.
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
// eslint.config.js
|
|
11
|
-
import js from "@eslint/js";
|
|
12
|
-
import traceability from "eslint-plugin-traceability";
|
|
13
|
-
|
|
14
|
-
export default [js.configs.recommended, traceability.configs.recommended];
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This preset enables the following rules at the `error` level:
|
|
18
|
-
|
|
19
|
-
- `traceability/require-story-annotation`
|
|
20
|
-
- `traceability/require-req-annotation`
|
|
21
|
-
- `traceability/require-branch-annotation`
|
|
22
|
-
- `traceability/valid-annotation-format`
|
|
23
|
-
- `traceability/valid-story-reference`
|
|
24
|
-
- `traceability/valid-req-reference`
|
|
25
|
-
|
|
26
|
-
## Strict Preset
|
|
27
|
-
|
|
28
|
-
Use the **strict** preset to enforce the same core rules, with potential future enhancements for stricter policies.
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
// eslint.config.js
|
|
32
|
-
import js from "@eslint/js";
|
|
33
|
-
import traceability from "eslint-plugin-traceability";
|
|
34
|
-
|
|
35
|
-
export default [js.configs.recommended, traceability.configs.strict];
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
The **strict** preset currently mirrors the **recommended** rules, but may include additional constraints in future plugin versions.
|