eslint-plugin-traceability 1.29.0 → 1.29.1
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
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
## [1.29.1](https://github.com/voder-ai/eslint-plugin-traceability/compare/v1.29.0...v1.29.1) (2026-01-12)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* **rules:**
|
|
6
|
+
* **rules:** clarify anonymous arrow exclusion logic and add inline docs ([efd6f4a](https://github.com/voder-ai/eslint-plugin-traceability/commit/efd6f4a6101936ac42321d4fb31f156ce2f12a9d))
|
|
7
7
|
|
|
8
8
|
# Changelog
|
|
9
9
|
|
|
@@ -159,15 +159,17 @@ function requiresOwnFunctionAnnotation(node, options) {
|
|
|
159
159
|
if ((0, require_story_node_utils_1.isNestedFunction)(node) && (0, require_story_node_utils_1.isEffectivelyAnonymousFunction)(node)) {
|
|
160
160
|
return false;
|
|
161
161
|
}
|
|
162
|
-
// Anonymous arrow functions
|
|
163
|
-
//
|
|
162
|
+
// Anonymous arrow functions are excluded by default when used as:
|
|
163
|
+
// - Callbacks to common utility methods (map, filter, setTimeout, Promise.then, etc.)
|
|
164
|
+
// - Callbacks to recognized test framework functions (when excludeTestCallbacks is true)
|
|
165
|
+
// Anonymous arrows passed to custom functions are checked unless nested and inheriting.
|
|
164
166
|
// Named arrow functions require annotations like other function declarations.
|
|
165
167
|
if ((0, require_story_node_utils_1.isAnonymousArrowFunction)(node)) {
|
|
166
|
-
// When excludeTestCallbacks is false, check ALL functions
|
|
168
|
+
// When excludeTestCallbacks is false, check ALL functions (including anonymous arrows)
|
|
167
169
|
if (options?.excludeTestCallbacks === false) {
|
|
168
170
|
return true;
|
|
169
171
|
}
|
|
170
|
-
// Special case: Vitest's bench callbacks should always be checked
|
|
172
|
+
// Special case: Vitest's bench callbacks should always be checked, even if anonymous
|
|
171
173
|
if (node.parent?.type === "CallExpression" &&
|
|
172
174
|
node.parent.callee?.type === "Identifier" &&
|
|
173
175
|
node.parent.callee.name === "bench") {
|
|
@@ -177,7 +179,8 @@ function requiresOwnFunctionAnnotation(node, options) {
|
|
|
177
179
|
if (isCommonUtilityCallback(node)) {
|
|
178
180
|
return false; // Exclude common utility callbacks
|
|
179
181
|
}
|
|
180
|
-
// Other anonymous arrows (like callbacks to
|
|
182
|
+
// Other anonymous arrows (like callbacks to custom functions) should be checked
|
|
183
|
+
// unless they are nested and can inherit from their parent
|
|
181
184
|
return true;
|
|
182
185
|
}
|
|
183
186
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-traceability",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.1",
|
|
4
4
|
"description": "A customizable ESLint plugin that enforces traceability annotations in your code, ensuring each implementation is linked to its requirement or test case.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|