@so1ve/eslint-plugin 0.78.1 → 0.78.2
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 +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -97,13 +97,14 @@ const functionStyle = createEslintRule({
|
|
|
97
97
|
getStatementRaw(statement)
|
|
98
98
|
)
|
|
99
99
|
});
|
|
100
|
+
return;
|
|
100
101
|
}
|
|
101
102
|
if (parent?.id?.typeAnnotation) {
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
if (body.type === types.AST_NODE_TYPES.BlockStatement) {
|
|
105
106
|
const { body: blockBody } = body;
|
|
106
|
-
if (blockBody.length >
|
|
107
|
+
if (blockBody.length > 0 && node.parent?.parent?.type === types.AST_NODE_TYPES.VariableDeclaration) {
|
|
107
108
|
const { parent: parent2 } = node.parent;
|
|
108
109
|
context.report({
|
|
109
110
|
node: parent2,
|
package/dist/index.mjs
CHANGED
|
@@ -95,13 +95,14 @@ const functionStyle = createEslintRule({
|
|
|
95
95
|
getStatementRaw(statement)
|
|
96
96
|
)
|
|
97
97
|
});
|
|
98
|
+
return;
|
|
98
99
|
}
|
|
99
100
|
if (parent?.id?.typeAnnotation) {
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
103
104
|
const { body: blockBody } = body;
|
|
104
|
-
if (blockBody.length >
|
|
105
|
+
if (blockBody.length > 0 && node.parent?.parent?.type === AST_NODE_TYPES.VariableDeclaration) {
|
|
105
106
|
const { parent: parent2 } = node.parent;
|
|
106
107
|
context.report({
|
|
107
108
|
node: parent2,
|