1
+ diff --git a/node_modules/eslint-plugin-eslint-plugin/lib/rules/require-meta-docs-url.js b/node_modules/eslint-plugin-eslint-plugin/lib/rules/require-meta-docs-url.js
2
+ index ed7d67a..af8ea5c 100644
3
+ --- a/node_modules/eslint-plugin-eslint-plugin/lib/rules/require-meta-docs-url.js
4
+ +++ b/node_modules/eslint-plugin-eslint-plugin/lib/rules/require-meta-docs-url.js
5
+ @@ -48,7 +48,7 @@ module.exports = {
6
+ const options = context.options[0] || {};
7
+ const sourceCode = context.getSourceCode();
8
+ const filename = context.getFilename();
9
+ - const ruleName = filename === '<input>' ? undefined : path.basename(filename, '.js');
10
+ + const ruleName = filename === '<input>' ? undefined : path.basename(filename, '.ts');
11
+ const expectedUrl = !options.pattern || !ruleName
12
+ ? undefined
13
+ : options.pattern.replace(/{{\s*name\s*}}/g, ruleName);
1
14
diff --git a/node_modules/eslint-plugin-eslint-plugin/lib/utils.js b/node_modules/eslint-plugin-eslint-plugin/lib/utils.js
2
- index e00aada..555ec69 100644
15
+ index e00aada..9eeb3b9 100644
3
16
--- a/node_modules/eslint-plugin-eslint-plugin/lib/utils.js
4
17
+++ b/node_modules/eslint-plugin-eslint-plugin/lib/utils.js
5
18
@@ -76,10 +76,10 @@ function isNormalFunctionExpressionReference (node, scopeManager) {
@@ -15,7 +28,58 @@ index e00aada..555ec69 100644
15
28
);
16
29
}
17
30
18
- @@ -239,7 +239,7 @@ module.exports = {
31
+ @@ -98,7 +98,15 @@ module.exports = {
32
+ let exportsVarOverridden = false;
33
+ let exportsIsFunction = false;
34
+
35
+ - const exportNodes = ast.body
36
+ + const collectProps = (parsedProps, prop) => {
37
+ + const keyValue = module.exports.getKeyName(prop);
38
+ + if (INTERESTING_KEYS.has(keyValue)) {
39
+ + parsedProps[keyValue] = prop.value;
40
+ + }
41
+ + return parsedProps;
42
+ + };
43
+ +
44
+ + let exportNodes = ast.body
45
+ .filter(statement => statement.type === 'ExpressionStatement')
46
+ .map(statement => statement.expression)
47
+ .filter(expression => expression.type === 'AssignmentExpression')
48
+ @@ -119,13 +127,7 @@ module.exports = {
49
+ // Check `module.exports = { create: function () {}, meta: {} }`
50
+
51
+ exportsIsFunction = false;
52
+ - return node.right.properties.reduce((parsedProps, prop) => {
53
+ - const keyValue = module.exports.getKeyName(prop);
54
+ - if (INTERESTING_KEYS.has(keyValue)) {
55
+ - parsedProps[keyValue] = prop.value;
56
+ - }
57
+ - return parsedProps;
58
+ - }, {});
59
+ + return node.right.properties.reduce(collectProps, {});
60
+ }
61
+ return {};
62
+ } else if (
63
+ @@ -150,6 +152,18 @@ module.exports = {
64
+ return currentExports;
65
+ }, {});
66
+
67
+ + exportNodes = Object.keys(exportNodes).length > 0
68
+ + ? exportNodes
69
+ + : ast.body.filter(statement => statement.type === "VariableDeclaration")
70
+ + .flatMap(statement => statement.declarations)
71
+ + .filter(statement => statement.init?.properties)
72
+ + .reduce((nodes, statement) => {
73
+ + return {
74
+ + ...nodes,
75
+ + ...statement.init.properties.reduce(collectProps, {})
76
+ + };
77
+ + }, {});
78
+ +
79
+ const createExists = Object.prototype.hasOwnProperty.call(exportNodes, 'create');
80
+ if (!createExists) {
81
+ return null;
82
+ @@ -239,7 +253,7 @@ module.exports = {
19
83
variableIdentifiers.has(statement.expression.callee.object)
20
84
) &&
21
85
statement.expression.callee.property.type === 'Identifier' &&
0 commit comments