eslint-plugin-traceability 1.4.11 → 1.4.12
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.
|
@@ -71,7 +71,6 @@ exports.DEFAULT_SCOPE = [
|
|
|
71
71
|
"MethodDefinition",
|
|
72
72
|
"TSMethodSignature",
|
|
73
73
|
"TSDeclareFunction",
|
|
74
|
-
"VariableDeclarator",
|
|
75
74
|
];
|
|
76
75
|
/**
|
|
77
76
|
* Allowed values for export priority option.
|
|
@@ -103,8 +102,13 @@ function reportMissing(context, sourceCode, node, target) {
|
|
|
103
102
|
// @req REQ-ANNOTATION-REQUIRED - Resolve function name for reporting, default to <unknown>
|
|
104
103
|
const name = node && node.id && node.id.name ? node.id.name : "<unknown>";
|
|
105
104
|
const resolvedTarget = target ?? node;
|
|
105
|
+
const nameNode = node && node.id && node.id.type === "Identifier"
|
|
106
|
+
? node.id
|
|
107
|
+
: node && node.key && node.key.type === "Identifier"
|
|
108
|
+
? node.key
|
|
109
|
+
: node;
|
|
106
110
|
context.report({
|
|
107
|
-
node,
|
|
111
|
+
node: nameNode,
|
|
108
112
|
messageId: "missingStory",
|
|
109
113
|
data: { name },
|
|
110
114
|
suggest: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-traceability",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
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/src/index.js",
|
|
6
6
|
"types": "lib/src/index.d.ts",
|