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.29.0](https://github.com/voder-ai/eslint-plugin-traceability/compare/v1.28.0...v1.29.0) (2026-01-12)
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
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * **rules:** exclude anonymous arrow callbacks, require named arrows ([373ac23](https://github.com/voder-ai/eslint-plugin-traceability/commit/373ac23f620cb6d0ad3056526f329c9f1dcb0e13))
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 used as common utility callbacks (map, filter, setTimeout, etc.)
163
- // are excluded by default, UNLESS excludeTestCallbacks is explicitly false.
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 user functions) should be checked
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.0",
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",