*/
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);
}
// 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"
},
type: "array",
items: { enum: Object.keys(StatementTypes) },
minItems: 1,
- uniqueItems: true,
- additionalItems: false
+ uniqueItems: true
}
]
}
},
additionalProperties: false,
required: ["blankLine", "prev", "next"]
- },
- additionalItems: false
+ }
},
messages: {
Program: enterScope,
BlockStatement: enterScope,
SwitchStatement: enterScope,
+ StaticBlock: enterScope,
"Program:exit": exitScope,
"BlockStatement:exit": exitScope,
"SwitchStatement:exit": exitScope,
+ "StaticBlock:exit": exitScope,
":statement": verify,