]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/tests/lib/rules/padding-line-between-statements.js
import 7.12.1 upstream release
[pve-eslint.git] / eslint / tests / lib / rules / padding-line-between-statements.js
index e553610e353c910a9ec09b2065441feff4c6ee1d..931cdd24ccb4152823176dec22173da9f3ee8111 100644 (file)
@@ -3632,6 +3632,22 @@ ruleTester.run("padding-line-between-statements", rule, {
             errors: [{ messageId: "expectedBlankLine" }]
         },
 
+        // Optional chaining
+        {
+            code: "(function(){\n})?.()\nvar a = 2;",
+            output: "(function(){\n})?.()\n\nvar a = 2;",
+            options: [{ blankLine: "always", prev: "iife", next: "*" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [{ messageId: "expectedBlankLine" }]
+        },
+        {
+            code: "void (function(){\n})?.()\nvar a = 2;",
+            output: "void (function(){\n})?.()\n\nvar a = 2;",
+            options: [{ blankLine: "always", prev: "iife", next: "*" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [{ messageId: "expectedBlankLine" }]
+        },
+
         //----------------------------------------------------------------------
         // import
         //----------------------------------------------------------------------