chore(deps): update dependency acorn to v8.14.0 (#16793)

* chore(deps): update dependency acorn to v8.14.0

* Fix tests

* Fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
renovate[bot]andfisker authored and GitHub committed 2024-10-28 12:23:14 +08:00
1 parent 2f409df61d
commit 4e1a313064
19 files changed
+91 -557

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@
"@prettier/parse-srcset": "3.1.0",
"@typescript-eslint/typescript-estree": "8.10.0",
"@typescript-eslint/visitor-keys": "8.10.0",
"acorn": "8.13.0",
"acorn": "8.14.0",
"acorn-jsx": "5.3.2",
"angular-estree-parser": "10.0.4",
"angular-html-parser": "7.0.1",
@@ -1141,22 +1141,6 @@ iterator.next(2); // Logs "Yield 2"
================================================================================
`;
exports[`import-assertions-dynamic.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`import-assertions-dynamic.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`import-assertions-dynamic.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -1209,22 +1193,6 @@ import json from "./foo.json" assert { type: "json" };
================================================================================
`;
exports[`import-attributes-dynamic.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`import-attributes-dynamic.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`import-attributes-dynamic.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -1239,22 +1207,6 @@ import("./foo.json", { with: { type: "json" } });
================================================================================
`;
exports[`import-attributes-static.js [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token (1:30)"
`;
exports[`import-attributes-static.js [espree] format 1`] = `
"Unexpected token with (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token with"
`;
exports[`import-attributes-static.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -2395,22 +2347,6 @@ printWidth: 80
================================================================================
`;
exports[`regexp-modifiers.js [acorn] format 1`] = `
"Invalid regular expression: /^(?i:[a-z])[a-z]$/: Invalid group (1:13)
> 1 | const re = /^(?i:[a-z])[a-z]$/;
| ^
2 |
Cause: Invalid regular expression: /^(?i:[a-z])[a-z]$/: Invalid group (1:12)"
`;
exports[`regexp-modifiers.js [espree] format 1`] = `
"Invalid regular expression: /^(?i:[a-z])[a-z]$/: Invalid group (1:13)
> 1 | const re = /^(?i:[a-z])[a-z]$/;
| ^
2 |
Cause: Invalid regular expression: /^(?i:[a-z])[a-z]$/: Invalid group"
`;
exports[`regexp-modifiers.js [meriyah] format 1`] = `
"Unterminated regular expression (1:12)
> 1 | const re = /^(?i:[a-z])[a-z]$/;
@@ -11,10 +11,7 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], {
"flow.js",
"function-bind.js",
"function-sent.js",
"import-assertions-dynamic.js",
"import-assertions-static.js",
"import-attributes-dynamic.js",
"import-attributes-static.js",
"partial-application.js",
"pipeline-operator-fsharp.js",
"pipeline-operator-minimal.js",
@@ -28,7 +25,6 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], {
"async-do-expressions.js",
"decorator-auto-accessors.js",
"explicit-resource-management.js",
"regexp-modifiers.js",
"source-phase-imports.js",
"deferred-import-evaluation.js",
"optional-chaining-assignment.js",
@@ -41,10 +37,7 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], {
"flow.js",
"function-bind.js",
"function-sent.js",
"import-assertions-dynamic.js",
"import-assertions-static.js",
"import-attributes-dynamic.js",
"import-attributes-static.js",
"partial-application.js",
"pipeline-operator-fsharp.js",
"pipeline-operator-minimal.js",
@@ -58,7 +51,6 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], {
"async-do-expressions.js",
"decorator-auto-accessors.js",
"explicit-resource-management.js",
"regexp-modifiers.js",
"source-phase-imports.js",
"deferred-import-evaluation.js",
"optional-chaining-assignment.js",
@@ -1,21 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`assertions.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`assertions.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`assertions.js [flow] format 1`] = `
"Unexpected token \`,\`, expected the token \`)\` (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
@@ -1,8 +1,8 @@
runFormatTest(import.meta, ["babel", "flow", "typescript"], {
errors: {
flow: ["assertions.js", "template-literal.js", "import-phase.js"],
acorn: ["assertions.js", "import-phase.js"],
espree: ["assertions.js", "import-phase.js"],
acorn: ["import-phase.js"],
espree: ["import-phase.js"],
meriyah: ["import-phase.js"],
},
});
@@ -1,21 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dynamic-import.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`dynamic-import.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`dynamic-import.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -1,21 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dynamic-import.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} format 1`] = `
====================================options=====================================
bracketSpacing: false
@@ -1,18 +1,8 @@
runFormatTest(import.meta, ["babel"], {
bracketSpacing: false,
errors: {
acorn: [
"dynamic-import.js",
"static-import.js",
"re-export.js",
"empty.js",
],
espree: [
"dynamic-import.js",
"static-import.js",
"re-export.js",
"empty.js",
],
acorn: ["static-import.js", "re-export.js", "empty.js"],
espree: ["static-import.js", "re-export.js", "empty.js"],
meriyah: ["static-import.js", "re-export.js", "empty.js"],
},
});
@@ -1,7 +1,6 @@
runFormatTest(import.meta, ["babel", "typescript"], {
errors: {
acorn: [
"dynamic-import.js",
"empty.js",
"multi-types.js",
"static-import.js",
@@ -11,7 +10,6 @@ runFormatTest(import.meta, ["babel", "typescript"], {
"keyword-detect.js",
],
espree: [
"dynamic-import.js",
"empty.js",
"multi-types.js",
"static-import.js",
@@ -1,21 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dynamic-import.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`dynamic-import.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`dynamic-import.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -30,28 +14,6 @@ import("./foo.json", { with: { type: "json" } });
================================================================================
`;
exports[`empty.js [acorn] format 1`] = `
"Unexpected token (2:33)
1 | export * as foo from "foo.json"
> 2 | export * as bar from "bar.json" with { }
| ^
3 | export * as baz from "baz.json" with { /* comment */ }
4 |
5 | import * as foo from "foo.json"
Cause: Unexpected token (2:32)"
`;
exports[`empty.js [espree] format 1`] = `
"Unexpected token with (2:33)
1 | export * as foo from "foo.json"
> 2 | export * as bar from "bar.json" with { }
| ^
3 | export * as baz from "baz.json" with { /* comment */ }
4 |
5 | import * as foo from "foo.json"
Cause: Unexpected token with"
`;
exports[`empty.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -78,26 +40,6 @@ import * as baz from "baz.json" /* comment */ with {};
================================================================================
`;
exports[`keyword-detect.js [acorn] format 1`] = `
"Unexpected token (1:35)
> 1 | import "./test.json" /* assert */ with /* assert */ { type: "json" }
| ^
2 | import a from "./test.json" /* assert */ with /* assert */ { type: "json" }
3 |
4 | export {default as c} from "./test.json" /* assert */ with /* assert */ { type: "json" }
Cause: Unexpected token (1:34)"
`;
exports[`keyword-detect.js [espree] format 1`] = `
"Unexpected token with (1:35)
> 1 | import "./test.json" /* assert */ with /* assert */ { type: "json" }
| ^
2 | import a from "./test.json" /* assert */ with /* assert */ { type: "json" }
3 |
4 | export {default as c} from "./test.json" /* assert */ with /* assert */ { type: "json" }
Cause: Unexpected token with"
`;
exports[`keyword-detect.js [meriyah] format 1`] = `
"Invalid binding in JSON import (1:69)
> 1 | import "./test.json" /* assert */ with /* assert */ { type: "json" }
@@ -132,26 +74,6 @@ export * from "./test.json" /* assert */ /* assert */ with { type: "json" };
================================================================================
`;
exports[`long-sources.js [acorn] format 1`] = `
"Unexpected token (1:37)
> 1 | import a10 from "./aaaaaaaaaa.json" with {
| ^
2 | type: "json" };
3 | import a20 from "./aaaaaaaaaaaaaaaaaaaa.json" with { type: "json" };
4 | import a30 from "./aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" with { type: "json" };
Cause: Unexpected token (1:36)"
`;
exports[`long-sources.js [espree] format 1`] = `
"Unexpected token with (1:37)
> 1 | import a10 from "./aaaaaaaaaa.json" with {
| ^
2 | type: "json" };
3 | import a20 from "./aaaaaaaaaaaaaaaaaaaa.json" with { type: "json" };
4 | import a30 from "./aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" with { type: "json" };
Cause: Unexpected token with"
`;
exports[`long-sources.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -214,19 +136,19 @@ import(
`;
exports[`multi-types.js [acorn] format 1`] = `
"Unexpected token (1:31)
"Duplicate attribute key 'type' (1:52)
> 1 | import json from "./foo.json" with { type: "json", type: "bar" };
| ^
| ^
2 |
Cause: Unexpected token (1:30)"
Cause: Duplicate attribute key 'type' (1:51)"
`;
exports[`multi-types.js [espree] format 1`] = `
"Unexpected token with (1:31)
"Duplicate attribute key 'type' (1:52)
> 1 | import json from "./foo.json" with { type: "json", type: "bar" };
| ^
| ^
2 |
Cause: Unexpected token with"
Cause: Duplicate attribute key 'type'"
`;
exports[`multi-types.js [meriyah] format 1`] = `
@@ -251,22 +173,6 @@ import json from "./foo.json" with { type: "json", type: "bar" };
================================================================================
`;
exports[`non-type.js [acorn] format 1`] = `
"Unexpected token (1:28)
> 1 | import foo from "foo.json" with { lazy: "true" };
| ^
2 |
Cause: Unexpected token (1:27)"
`;
exports[`non-type.js [espree] format 1`] = `
"Unexpected token with (1:28)
> 1 | import foo from "foo.json" with { lazy: "true" };
| ^
2 |
Cause: Unexpected token with"
`;
exports[`non-type.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -281,26 +187,6 @@ import foo from "foo.json" with { lazy: "true" };
================================================================================
`;
exports[`re-export.js [acorn] format 1`] = `
"Unexpected token (1:44)
> 1 | export { default as foo2 } from "foo.json" with { type: "json" };
| ^
2 | export * from "foo.json" with { type: "json" };
3 | export * as foo3 from "foo.json" with { type: "json" };
4 |
Cause: Unexpected token (1:43)"
`;
exports[`re-export.js [espree] format 1`] = `
"Unexpected token with (1:44)
> 1 | export { default as foo2 } from "foo.json" with { type: "json" };
| ^
2 | export * from "foo.json" with { type: "json" };
3 | export * as foo3 from "foo.json" with { type: "json" };
4 |
Cause: Unexpected token with"
`;
exports[`re-export.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -319,22 +205,6 @@ export * as foo3 from "foo.json" with { type: "json" };
================================================================================
`;
exports[`static-import.js [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token (1:30)"
`;
exports[`static-import.js [espree] format 1`] = `
"Unexpected token with (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token with"
`;
exports[`static-import.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -349,22 +219,6 @@ import json from "./foo.json" with { type: "json" };
================================================================================
`;
exports[`without-from.js [acorn] format 1`] = `
"Unexpected token (1:14)
> 1 | import "foo" with { type: "json" }
| ^
2 |
Cause: Unexpected token (1:13)"
`;
exports[`without-from.js [espree] format 1`] = `
"Unexpected token with (1:14)
> 1 | import "foo" with { type: "json" }
| ^
2 |
Cause: Unexpected token with"
`;
exports[`without-from.js [meriyah] format 1`] = `
"Invalid binding in JSON import (1:34)
> 1 | import "foo" with { type: "json" }
@@ -1,21 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dynamic-import.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token (1:19)"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import("./foo.json", { with: { type: "json" } });
| ^
2 |
Cause: Unexpected token ,"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} format 1`] = `
====================================options=====================================
bracketSpacing: false
@@ -31,20 +15,6 @@ import("./foo.json", {with: {type: "json"}});
================================================================================
`;
exports[`empty.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:33)
> 1 | export * as bar from "bar.json" with { }
| ^
Cause: Unexpected token (1:32)"
`;
exports[`empty.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token with (1:33)
> 1 | export * as bar from "bar.json" with { }
| ^
Cause: Unexpected token with"
`;
exports[`empty.js - {"bracketSpacing":false} format 1`] = `
====================================options=====================================
bracketSpacing: false
@@ -59,22 +29,6 @@ export * as bar from "bar.json" with {};
================================================================================
`;
exports[`re-export.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:44)
> 1 | export { default as foo2 } from "foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token (1:43)"
`;
exports[`re-export.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token with (1:44)
> 1 | export { default as foo2 } from "foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token with"
`;
exports[`re-export.js - {"bracketSpacing":false} format 1`] = `
====================================options=====================================
bracketSpacing: false
@@ -90,22 +44,6 @@ export {default as foo2} from "foo.json" with {type: "json"};
================================================================================
`;
exports[`static-import.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token (1:30)"
`;
exports[`static-import.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token with (1:31)
> 1 | import json from "./foo.json" with { type: "json" };
| ^
2 |
Cause: Unexpected token with"
`;
exports[`static-import.js - {"bracketSpacing":false} format 1`] = `
====================================options=====================================
bracketSpacing: false
@@ -1,17 +1 @@
runFormatTest(import.meta, ["babel"], {
bracketSpacing: false,
errors: {
acorn: [
"dynamic-import.js",
"static-import.js",
"re-export.js",
"empty.js",
],
espree: [
"dynamic-import.js",
"static-import.js",
"re-export.js",
"empty.js",
],
},
});
runFormatTest(import.meta, ["babel"], { bracketSpacing: false });
@@ -1,26 +1,6 @@
const errors = {
acorn: [
"dynamic-import.js",
"empty.js",
"multi-types.js",
"static-import.js",
"re-export.js",
"without-from.js",
"non-type.js",
"keyword-detect.js",
"long-sources.js",
],
espree: [
"dynamic-import.js",
"empty.js",
"multi-types.js",
"static-import.js",
"re-export.js",
"without-from.js",
"non-type.js",
"keyword-detect.js",
"long-sources.js",
],
acorn: ["multi-types.js"],
espree: ["multi-types.js"],
meriyah: ["multi-types.js", "without-from.js", "keyword-detect.js"],
};
runFormatTest(import.meta, ["babel", "typescript"], { errors });
@@ -1,45 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`quoted-keys.js [acorn] format 1`] = `
"Unexpected token (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token (1:28)"
`;
exports[`quoted-keys.js [espree] format 1`] = `
"Unexpected token with (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token with"
`;
exports[`quoted-keys.js - {"quoteProps":"consistent"} [acorn] format 1`] = `
"Unexpected token (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token (1:28)"
`;
exports[`quoted-keys.js - {"quoteProps":"consistent"} [espree] format 1`] = `
"Unexpected token with (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token with"
`;
exports[`quoted-keys.js - {"quoteProps":"consistent"} format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -47,52 +7,32 @@ printWidth: 80
quoteProps: "consistent"
| printWidth
=====================================input======================================
import json from './mod.js' with { "type":"json" };
import json from './mod.js' with { "foobar":"json" };
import json from './mod.js' with { "type-foo" :"json" };
import json from './mod.js' with { "333foo" :"json" };
import json from './mod.js' with { "0" :"json" };
import json from './mod.js' with { "0n" :"json" };
import json from './mod.js' with { "33333" :"json" };
import json from './mod.js' with { "33333n" :"json" };
import json from './mod.js' with { "33333b" :"json" };
import json from './mod.js' with { "03333" :"json" };
import json1 from './mod.js' with { "type":"json" };
import json2 from './mod.js' with { "foobar":"json" };
import json3 from './mod.js' with { "type-foo" :"json" };
import json4 from './mod.js' with { "333foo" :"json" };
import json5 from './mod.js' with { "0" :"json" };
import json6 from './mod.js' with { "0n" :"json" };
import json7 from './mod.js' with { "33333" :"json" };
import json8 from './mod.js' with { "33333n" :"json" };
import json9 from './mod.js' with { "33333b" :"json" };
import json10 from './mod.js' with { "03333" :"json" };
=====================================output=====================================
import json from "./mod.js" with { type: "json" };
import json from "./mod.js" with { foobar: "json" };
import json from "./mod.js" with { "type-foo": "json" };
import json from "./mod.js" with { "333foo": "json" };
import json from "./mod.js" with { "0": "json" };
import json from "./mod.js" with { "0n": "json" };
import json from "./mod.js" with { "33333": "json" };
import json from "./mod.js" with { "33333n": "json" };
import json from "./mod.js" with { "33333b": "json" };
import json from "./mod.js" with { "03333": "json" };
import json1 from "./mod.js" with { type: "json" };
import json2 from "./mod.js" with { foobar: "json" };
import json3 from "./mod.js" with { "type-foo": "json" };
import json4 from "./mod.js" with { "333foo": "json" };
import json5 from "./mod.js" with { "0": "json" };
import json6 from "./mod.js" with { "0n": "json" };
import json7 from "./mod.js" with { "33333": "json" };
import json8 from "./mod.js" with { "33333n": "json" };
import json9 from "./mod.js" with { "33333b": "json" };
import json10 from "./mod.js" with { "03333": "json" };
================================================================================
`;
exports[`quoted-keys.js - {"quoteProps":"preserve"} [acorn] format 1`] = `
"Unexpected token (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token (1:28)"
`;
exports[`quoted-keys.js - {"quoteProps":"preserve"} [espree] format 1`] = `
"Unexpected token with (1:29)
> 1 | import json from './mod.js' with { "type":"json" };
| ^
2 | import json from './mod.js' with { "foobar":"json" };
3 | import json from './mod.js' with { "type-foo" :"json" };
4 | import json from './mod.js' with { "333foo" :"json" };
Cause: Unexpected token with"
`;
exports[`quoted-keys.js - {"quoteProps":"preserve"} format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -100,28 +40,28 @@ printWidth: 80
quoteProps: "preserve"
| printWidth
=====================================input======================================
import json from './mod.js' with { "type":"json" };
import json from './mod.js' with { "foobar":"json" };
import json from './mod.js' with { "type-foo" :"json" };
import json from './mod.js' with { "333foo" :"json" };
import json from './mod.js' with { "0" :"json" };
import json from './mod.js' with { "0n" :"json" };
import json from './mod.js' with { "33333" :"json" };
import json from './mod.js' with { "33333n" :"json" };
import json from './mod.js' with { "33333b" :"json" };
import json from './mod.js' with { "03333" :"json" };
import json1 from './mod.js' with { "type":"json" };
import json2 from './mod.js' with { "foobar":"json" };
import json3 from './mod.js' with { "type-foo" :"json" };
import json4 from './mod.js' with { "333foo" :"json" };
import json5 from './mod.js' with { "0" :"json" };
import json6 from './mod.js' with { "0n" :"json" };
import json7 from './mod.js' with { "33333" :"json" };
import json8 from './mod.js' with { "33333n" :"json" };
import json9 from './mod.js' with { "33333b" :"json" };
import json10 from './mod.js' with { "03333" :"json" };
=====================================output=====================================
import json from "./mod.js" with { "type": "json" };
import json from "./mod.js" with { "foobar": "json" };
import json from "./mod.js" with { "type-foo": "json" };
import json from "./mod.js" with { "333foo": "json" };
import json from "./mod.js" with { "0": "json" };
import json from "./mod.js" with { "0n": "json" };
import json from "./mod.js" with { "33333": "json" };
import json from "./mod.js" with { "33333n": "json" };
import json from "./mod.js" with { "33333b": "json" };
import json from "./mod.js" with { "03333": "json" };
import json1 from "./mod.js" with { "type": "json" };
import json2 from "./mod.js" with { "foobar": "json" };
import json3 from "./mod.js" with { "type-foo": "json" };
import json4 from "./mod.js" with { "333foo": "json" };
import json5 from "./mod.js" with { "0": "json" };
import json6 from "./mod.js" with { "0n": "json" };
import json7 from "./mod.js" with { "33333": "json" };
import json8 from "./mod.js" with { "33333n": "json" };
import json9 from "./mod.js" with { "33333b": "json" };
import json10 from "./mod.js" with { "03333": "json" };
================================================================================
`;
@@ -132,28 +72,28 @@ parsers: ["babel", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
import json from './mod.js' with { "type":"json" };
import json from './mod.js' with { "foobar":"json" };
import json from './mod.js' with { "type-foo" :"json" };
import json from './mod.js' with { "333foo" :"json" };
import json from './mod.js' with { "0" :"json" };
import json from './mod.js' with { "0n" :"json" };
import json from './mod.js' with { "33333" :"json" };
import json from './mod.js' with { "33333n" :"json" };
import json from './mod.js' with { "33333b" :"json" };
import json from './mod.js' with { "03333" :"json" };
import json1 from './mod.js' with { "type":"json" };
import json2 from './mod.js' with { "foobar":"json" };
import json3 from './mod.js' with { "type-foo" :"json" };
import json4 from './mod.js' with { "333foo" :"json" };
import json5 from './mod.js' with { "0" :"json" };
import json6 from './mod.js' with { "0n" :"json" };
import json7 from './mod.js' with { "33333" :"json" };
import json8 from './mod.js' with { "33333n" :"json" };
import json9 from './mod.js' with { "33333b" :"json" };
import json10 from './mod.js' with { "03333" :"json" };
=====================================output=====================================
import json from "./mod.js" with { type: "json" };
import json from "./mod.js" with { foobar: "json" };
import json from "./mod.js" with { "type-foo": "json" };
import json from "./mod.js" with { "333foo": "json" };
import json from "./mod.js" with { "0": "json" };
import json from "./mod.js" with { "0n": "json" };
import json from "./mod.js" with { "33333": "json" };
import json from "./mod.js" with { "33333n": "json" };
import json from "./mod.js" with { "33333b": "json" };
import json from "./mod.js" with { "03333": "json" };
import json1 from "./mod.js" with { type: "json" };
import json2 from "./mod.js" with { foobar: "json" };
import json3 from "./mod.js" with { "type-foo": "json" };
import json4 from "./mod.js" with { "333foo": "json" };
import json5 from "./mod.js" with { "0": "json" };
import json6 from "./mod.js" with { "0n": "json" };
import json7 from "./mod.js" with { "33333": "json" };
import json8 from "./mod.js" with { "33333n": "json" };
import json9 from "./mod.js" with { "33333b": "json" };
import json10 from "./mod.js" with { "03333": "json" };
================================================================================
`;
@@ -1,13 +1,5 @@
const errors = {
acorn: ["quoted-keys.js"],
espree: ["quoted-keys.js"],
};
runFormatTest(import.meta, ["babel", "typescript"], { errors });
runFormatTest(import.meta, ["babel", "typescript"]);
runFormatTest(import.meta, ["babel", "typescript"], {
quoteProps: "consistent",
errors,
});
runFormatTest(import.meta, ["babel", "typescript"], {
quoteProps: "preserve",
errors,
});
runFormatTest(import.meta, ["babel", "typescript"], { quoteProps: "preserve" });
@@ -1,10 +1,10 @@
import json from './mod.js' with { "type":"json" };
import json from './mod.js' with { "foobar":"json" };
import json from './mod.js' with { "type-foo" :"json" };
import json from './mod.js' with { "333foo" :"json" };
import json from './mod.js' with { "0" :"json" };
import json from './mod.js' with { "0n" :"json" };
import json from './mod.js' with { "33333" :"json" };
import json from './mod.js' with { "33333n" :"json" };
import json from './mod.js' with { "33333b" :"json" };
import json from './mod.js' with { "03333" :"json" };
import json1 from './mod.js' with { "type":"json" };
import json2 from './mod.js' with { "foobar":"json" };
import json3 from './mod.js' with { "type-foo" :"json" };
import json4 from './mod.js' with { "333foo" :"json" };
import json5 from './mod.js' with { "0" :"json" };
import json6 from './mod.js' with { "0n" :"json" };
import json7 from './mod.js' with { "33333" :"json" };
import json8 from './mod.js' with { "33333n" :"json" };
import json9 from './mod.js' with { "33333b" :"json" };
import json10 from './mod.js' with { "03333" :"json" };
@@ -30,26 +30,6 @@ printWidth: 80
================================================================================
`;
exports[`regexp-modifiers.js [acorn] format 1`] = `
"Invalid regular expression: /(?ims:^[a-z])/: Invalid group (1:2)
> 1 | /(?ims:^[a-z])/u;
| ^
2 | /(?-ims:^[a-z].)(^[a-z].)/uims;
3 | /(?ims:^[a-z].1$)/;
4 |
Cause: Invalid regular expression: /(?ims:^[a-z])/: Invalid group (1:1)"
`;
exports[`regexp-modifiers.js [espree] format 1`] = `
"Invalid regular expression: /(?ims:^[a-z])/: Invalid group (1:2)
> 1 | /(?ims:^[a-z])/u;
| ^
2 | /(?-ims:^[a-z].)(^[a-z].)/uims;
3 | /(?ims:^[a-z].1$)/;
4 |
Cause: Invalid regular expression: /(?ims:^[a-z])/: Invalid group"
`;
exports[`regexp-modifiers.js [meriyah] format 1`] = `
"Unterminated regular expression (1:1)
> 1 | /(?ims:^[a-z])/u;
-2
View File
@@ -1,7 +1,5 @@
runFormatTest(import.meta, ["babel", "flow", "typescript"], {
errors: {
acorn: ["regexp-modifiers.js"],
espree: ["regexp-modifiers.js"],
meriyah: ["regexp-modifiers.js"],
},
});
+5 -5
View File
@@ -2119,12 +2119,12 @@ __metadata:
languageName: node
linkType: hard
"acorn@npm:8.13.0, acorn@npm:^8.11.3, acorn@npm:^8.12.0":
version: 8.13.0
resolution: "acorn@npm:8.13.0"
"acorn@npm:8.14.0, acorn@npm:^8.11.3, acorn@npm:^8.12.0":
version: 8.14.0
resolution: "acorn@npm:8.14.0"
bin:
acorn: bin/acorn
checksum: 10/33e3a03114b02b3bc5009463b3d9549b31a90ee38ebccd5e66515830a02acf62a90edcc12abfb6c9fb3837b6c17a3ec9b72b3bf52ac31d8ad8248a4af871e0f5
checksum: 10/6df29c35556782ca9e632db461a7f97947772c6c1d5438a81f0c873a3da3a792487e83e404d1c6c25f70513e91aa18745f6eafb1fcc3a43ecd1920b21dd173d2
languageName: node
linkType: hard
@@ -7249,7 +7249,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:8.10.0"
"@typescript-eslint/typescript-estree": "npm:8.10.0"
"@typescript-eslint/visitor-keys": "npm:8.10.0"
acorn: "npm:8.13.0"
acorn: "npm:8.14.0"
acorn-jsx: "npm:5.3.2"
angular-estree-parser: "npm:10.0.4"
angular-html-parser: "npm:7.0.1"