]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/tests/lib/rules/no-restricted-exports.js
import and build new upstream release 7.2.0
[pve-eslint.git] / eslint / tests / lib / rules / no-restricted-exports.js
index 6d0e693b57d47e6953c93b27b226898f18777a2f..31458f15fc1c877fce091cdaab45dc6179f42219 100644 (file)
@@ -16,7 +16,7 @@ const { RuleTester } = require("../../../lib/rule-tester");
 // Tests
 //------------------------------------------------------------------------------
 
-const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2018, sourceType: "module" } });
+const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2020, sourceType: "module" } });
 
 ruleTester.run("no-restricted-exports", rule, {
     valid: [
@@ -73,6 +73,7 @@ ruleTester.run("no-restricted-exports", rule, {
 
         // does not check source in re-export declarations
         { code: "export { b } from 'a';", options: [{ restrictedNamedExports: ["a"] }] },
+        { code: "export * as b from 'a';", options: [{ restrictedNamedExports: ["a"] }] },
 
         // does not check non-export declarations
         { code: "var a;", options: [{ restrictedNamedExports: ["a"] }] },
@@ -332,6 +333,11 @@ ruleTester.run("no-restricted-exports", rule, {
             options: [{ restrictedNamedExports: ["a"] }],
             errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Identifier", column: 15 }]
         },
+        {
+            code: "export * as a from 'a';",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Identifier", column: 13 }]
+        },
 
         // Note: duplicate identifiers in the same export declaration are a 'duplicate export' syntax error. Example: export var a, a;