]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/padding-line-between-statements.js
import 8.23.1 source
[pve-eslint.git] / eslint / lib / rules / padding-line-between-statements.js
index eea19f5ce5811b534e2fd6cf2dd933e41382d88c..9d730bffcd9025470eba1abddaa982faad6e8751 100644 (file)
@@ -85,10 +85,10 @@ function newNodeTypeTester(type) {
  */
 function isIIFEStatement(node) {
     if (node.type === "ExpressionStatement") {
-        let call = node.expression;
+        let call = astUtils.skipChainExpression(node.expression);
 
         if (call.type === "UnaryExpression") {
-            call = call.argument;
+            call = astUtils.skipChainExpression(call.argument);
         }
         return call.type === "CallExpression" && astUtils.isFunction(call.callee);
     }
@@ -425,13 +425,13 @@ const StatementTypes = {
 // Rule Definition
 //------------------------------------------------------------------------------
 
+/** @type {import('../shared/types').Rule} */
 module.exports = {
     meta: {
         type: "layout",
 
         docs: {
-            description: "require or disallow padding lines between statements",
-            category: "Stylistic Issues",
+            description: "Require or disallow padding lines between statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/padding-line-between-statements"
         },
@@ -450,8 +450,7 @@ module.exports = {
                             type: "array",
                             items: { enum: Object.keys(StatementTypes) },
                             minItems: 1,
-                            uniqueItems: true,
-                            additionalItems: false
+                            uniqueItems: true
                         }
                     ]
                 }
@@ -466,8 +465,7 @@ module.exports = {
                 },
                 additionalProperties: false,
                 required: ["blankLine", "prev", "next"]
-            },
-            additionalItems: false
+            }
         },
 
         messages: {
@@ -619,9 +617,11 @@ module.exports = {
             Program: enterScope,
             BlockStatement: enterScope,
             SwitchStatement: enterScope,
+            StaticBlock: enterScope,
             "Program:exit": exitScope,
             "BlockStatement:exit": exitScope,
             "SwitchStatement:exit": exitScope,
+            "StaticBlock:exit": exitScope,
 
             ":statement": verify,