eslint-plugin-function 0.0.20 → 0.0.21
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/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "eslint-plugin-function";
|
|
12
|
-
var version = "0.0.
|
|
12
|
+
var version = "0.0.21";
|
|
13
13
|
function getDocsUrl() {
|
|
14
14
|
return "TODO: add docs for local ESLint rules";
|
|
15
15
|
}
|
|
@@ -205,7 +205,7 @@ function create3(context, [opts]) {
|
|
|
205
205
|
}
|
|
206
206
|
return {
|
|
207
207
|
[":function"](node) {
|
|
208
|
-
const functionName = AST.
|
|
208
|
+
const functionName = AST.getFunctionId(node)?.name;
|
|
209
209
|
const isMatched = functionName != null && pattern.test(functionName);
|
|
210
210
|
functionEntries.push({ functionName, functionNode: node, isMatched });
|
|
211
211
|
},
|
|
@@ -231,7 +231,7 @@ function create3(context, [opts]) {
|
|
|
231
231
|
const { functionName, functionNode, isMatched = false } = functionEntries.at(-1) ?? {};
|
|
232
232
|
if (functionName == null || functionNode == null || !isMatched) return;
|
|
233
233
|
handleReturnExpression(context, node.argument, (expr, data) => {
|
|
234
|
-
const functionName2 = AST.
|
|
234
|
+
const functionName2 = AST.getFunctionId(functionNode)?.name;
|
|
235
235
|
if (functionName2 == null) return;
|
|
236
236
|
context.report({
|
|
237
237
|
messageId: "functionReturnBoolean",
|