@so1ve/eslint-plugin 0.78.3 → 0.78.4
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.cjs +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,7 @@ const functionStyle = createEslintRule({
|
|
|
64
64
|
},
|
|
65
65
|
"FunctionExpression:exit"(node) {
|
|
66
66
|
if (node.parent?.id?.typeAnnotation || node.parent?.type !== types.AST_NODE_TYPES.VariableDeclarator || haveThisAccess) {
|
|
67
|
+
clearThisAccess();
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
const name = node.parent.id.name;
|
|
@@ -86,6 +87,7 @@ const functionStyle = createEslintRule({
|
|
|
86
87
|
}
|
|
87
88
|
const statement = getLoneReturnStatement(node);
|
|
88
89
|
if (!statement || !node.id?.name || node.generator) {
|
|
90
|
+
clearThisAccess();
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
93
|
const asVariable = node.parent?.type !== types.AST_NODE_TYPES.ExportDefaultDeclaration;
|
|
@@ -123,9 +125,11 @@ const functionStyle = createEslintRule({
|
|
|
123
125
|
getStatementRaw(statement)
|
|
124
126
|
)
|
|
125
127
|
});
|
|
128
|
+
clearThisAccess();
|
|
126
129
|
return;
|
|
127
130
|
}
|
|
128
131
|
if (parent?.id?.typeAnnotation) {
|
|
132
|
+
clearThisAccess();
|
|
129
133
|
return;
|
|
130
134
|
}
|
|
131
135
|
if (body.type === types.AST_NODE_TYPES.BlockStatement) {
|
package/dist/index.mjs
CHANGED
|
@@ -62,6 +62,7 @@ const functionStyle = createEslintRule({
|
|
|
62
62
|
},
|
|
63
63
|
"FunctionExpression:exit"(node) {
|
|
64
64
|
if (node.parent?.id?.typeAnnotation || node.parent?.type !== AST_NODE_TYPES.VariableDeclarator || haveThisAccess) {
|
|
65
|
+
clearThisAccess();
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
const name = node.parent.id.name;
|
|
@@ -84,6 +85,7 @@ const functionStyle = createEslintRule({
|
|
|
84
85
|
}
|
|
85
86
|
const statement = getLoneReturnStatement(node);
|
|
86
87
|
if (!statement || !node.id?.name || node.generator) {
|
|
88
|
+
clearThisAccess();
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
91
|
const asVariable = node.parent?.type !== AST_NODE_TYPES.ExportDefaultDeclaration;
|
|
@@ -121,9 +123,11 @@ const functionStyle = createEslintRule({
|
|
|
121
123
|
getStatementRaw(statement)
|
|
122
124
|
)
|
|
123
125
|
});
|
|
126
|
+
clearThisAccess();
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
129
|
if (parent?.id?.typeAnnotation) {
|
|
130
|
+
clearThisAccess();
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
133
|
if (body.type === AST_NODE_TYPES.BlockStatement) {
|