chore: disable string escaping in snapshots (#12612)

This commit is contained in:
Simen Bekkhus authored and GitHub committed 2022-04-08 09:59:17 +09:00
1 parent f98c197b66
commit 033ac94f25
66 files changed
+1146 -1145

No files matched your search

+3
View File
@@ -58,6 +58,9 @@ module.exports = {
"jest-snapshot-serializer-raw",
"jest-snapshot-serializer-ansi",
],
snapshotFormat: {
escapeString: false,
},
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
testPathIgnorePatterns,
collectCoverage: ENABLE_CODE_COVERAGE,
@@ -1017,9 +1017,9 @@ exports[`function-sent.js [acorn] format 1`] = `
"Unexpected token (4:33)
2 |
3 | function* generator() {
> 4 | console.log(\\"Sent\\", function.sent);
> 4 | console.log("Sent", function.sent);
| ^
5 | console.log(\\"Yield\\", yield);
5 | console.log("Yield", yield);
6 | }
7 |"
`;
@@ -1028,9 +1028,9 @@ exports[`function-sent.js [espree] format 1`] = `
"Unexpected token . (4:33)
2 |
3 | function* generator() {
> 4 | console.log(\\"Sent\\", function.sent);
> 4 | console.log("Sent", function.sent);
| ^
5 | console.log(\\"Yield\\", yield);
5 | console.log("Yield", yield);
6 | }
7 |"
`;
@@ -1039,9 +1039,9 @@ exports[`function-sent.js [meriyah] format 1`] = `
"Expected '(' (4:33)
2 |
3 | function* generator() {
> 4 | console.log(\\"Sent\\", function.sent);
> 4 | console.log("Sent", function.sent);
| ^
5 | console.log(\\"Yield\\", yield);
5 | console.log("Yield", yield);
6 | }
7 |"
`;
@@ -1080,21 +1080,21 @@ 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\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`import-assertions-dynamic.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`import-assertions-dynamic.js [meriyah] format 1`] = `
"Expected ')' (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
@@ -1115,21 +1115,21 @@ import("./foo.json", { assert: { type: "json" } });
exports[`import-assertions-static.js [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`import-assertions-static.js [espree] format 1`] = `
"Unexpected token assert (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`import-assertions-static.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:36)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
@@ -1297,9 +1297,9 @@ let m = module {
exports[`module-string-names.js [meriyah] format 1`] = `
"Expected '}' (1:13)
> 1 | import { \\"😄\\" as smile } from \\"./emojis.js\\";
> 1 | import { "😄" as smile } from "./emojis.js";
| ^
2 | export { smile as \\"😄\\" } from \\"./emojis.js\\";
2 | export { smile as "😄" } from "./emojis.js";
3 |"
`;
@@ -1884,9 +1884,9 @@ return list |> take(prefix.length, %) |> equals(%, prefix);
exports[`pipeline-operator-minimal.js [acorn] format 1`] = `
"Identifier 'result' has already been declared (7:5)
5 | result //=> \\"Hello, hello!\\"
5 | result //=> "Hello, hello!"
6 |
> 7 | let result = \\"hello\\"
> 7 | let result = "hello"
| ^
8 | |> doubleSay
9 | |> capitalize
@@ -1895,9 +1895,9 @@ exports[`pipeline-operator-minimal.js [acorn] format 1`] = `
exports[`pipeline-operator-minimal.js [espree] format 1`] = `
"Identifier 'result' has already been declared (7:5)
5 | result //=> \\"Hello, hello!\\"
5 | result //=> "Hello, hello!"
6 |
> 7 | let result = \\"hello\\"
> 7 | let result = "hello"
| ^
8 | |> doubleSay
9 | |> capitalize
@@ -1907,7 +1907,7 @@ exports[`pipeline-operator-minimal.js [espree] format 1`] = `
exports[`pipeline-operator-minimal.js [meriyah] format 1`] = `
"Unexpected token: '>' (8:4)
6 |
7 | let result = \\"hello\\"
7 | let result = "hello"
> 8 | |> doubleSay
| ^
9 | |> capitalize
@@ -5,7 +5,7 @@ exports[`null-arguments-item.js [__babel_estree] format 1`] = `
> 1 | foor('a', , 'b');
| ^
2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong');
3 | foo(\\"a\\",
3 | foo("a",
4 | //1"
`;
@@ -14,7 +14,7 @@ exports[`null-arguments-item.js [acorn] format 1`] = `
> 1 | foor('a', , 'b');
| ^
2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong');
3 | foo(\\"a\\",
3 | foo("a",
4 | //1"
`;
@@ -23,7 +23,7 @@ exports[`null-arguments-item.js [babel] format 1`] = `
> 1 | foor('a', , 'b');
| ^
2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong');
3 | foo(\\"a\\",
3 | foo("a",
4 | //1"
`;
@@ -32,7 +32,7 @@ exports[`null-arguments-item.js [espree] format 1`] = `
> 1 | foor('a', , 'b');
| ^
2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong');
3 | foo(\\"a\\",
3 | foo("a",
4 | //1"
`;
@@ -41,6 +41,6 @@ exports[`null-arguments-item.js [meriyah] format 1`] = `
> 1 | foor('a', , 'b');
| ^
2 | foo('looooooooooooooooooooooooooooooooooooooooooooooong', , 'looooooooooooooooooooooooooooooooooooooooooooooong');
3 | foo(\\"a\\",
3 | foo("a",
4 | //1"
`;
@@ -15,7 +15,7 @@ exports[`example.js [espree] format 1`] = `
`;
exports[`example.js [meriyah] format 1`] = `
"Calls to super must be in the \\"constructor\\" method of a class expression or class declaration that has a superclass (1:6)
"Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass (1:6)
> 1 | super();
| ^
2 |"
@@ -76,7 +76,7 @@ class Foo {
exports[`computed.js [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class Foo {
> 2 | accessor [\\"bar\\"];
> 2 | accessor ["bar"];
| ^
3 | }
4 |"
@@ -85,7 +85,7 @@ exports[`computed.js [acorn] format 1`] = `
exports[`computed.js [espree] format 1`] = `
"Unexpected token [ (2:12)
1 | class Foo {
> 2 | accessor [\\"bar\\"];
> 2 | accessor ["bar"];
| ^
3 | }
4 |"
@@ -94,7 +94,7 @@ exports[`computed.js [espree] format 1`] = `
exports[`computed.js - {"semi":false} [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class Foo {
> 2 | accessor [\\"bar\\"];
> 2 | accessor ["bar"];
| ^
3 | }
4 |"
@@ -103,7 +103,7 @@ exports[`computed.js - {"semi":false} [acorn] format 1`] = `
exports[`computed.js - {"semi":false} [espree] format 1`] = `
"Unexpected token [ (2:12)
1 | class Foo {
> 2 | accessor [\\"bar\\"];
> 2 | accessor ["bar"];
| ^
3 | }
4 |"
@@ -410,7 +410,7 @@ class Foo {
exports[`static-computed.js [acorn] format 1`] = `
"Unexpected token (2:19)
1 | class Foo {
> 2 | static accessor [\\"bar\\"];
> 2 | static accessor ["bar"];
| ^
3 | }
4 |"
@@ -419,7 +419,7 @@ exports[`static-computed.js [acorn] format 1`] = `
exports[`static-computed.js [espree] format 1`] = `
"Unexpected token [ (2:19)
1 | class Foo {
> 2 | static accessor [\\"bar\\"];
> 2 | static accessor ["bar"];
| ^
3 | }
4 |"
@@ -428,7 +428,7 @@ exports[`static-computed.js [espree] format 1`] = `
exports[`static-computed.js - {"semi":false} [acorn] format 1`] = `
"Unexpected token (2:19)
1 | class Foo {
> 2 | static accessor [\\"bar\\"];
> 2 | static accessor ["bar"];
| ^
3 | }
4 |"
@@ -437,7 +437,7 @@ exports[`static-computed.js - {"semi":false} [acorn] format 1`] = `
exports[`static-computed.js - {"semi":false} [espree] format 1`] = `
"Unexpected token [ (2:19)
1 | class Foo {
> 2 | static accessor [\\"bar\\"];
> 2 | static accessor ["bar"];
| ^
3 | }
4 |"
@@ -638,7 +638,7 @@ class Foo {
exports[`with-semicolon-1.js [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | [foo]() {}
4 | }
@@ -648,7 +648,7 @@ exports[`with-semicolon-1.js [acorn] format 1`] = `
exports[`with-semicolon-1.js [espree] format 1`] = `
"Unexpected token clicked (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | [foo]() {}
4 | }
@@ -658,7 +658,7 @@ exports[`with-semicolon-1.js [espree] format 1`] = `
exports[`with-semicolon-1.js - {"semi":false} [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | [foo]() {}
4 | }
@@ -668,7 +668,7 @@ exports[`with-semicolon-1.js - {"semi":false} [acorn] format 1`] = `
exports[`with-semicolon-1.js - {"semi":false} [espree] format 1`] = `
"Unexpected token clicked (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | [foo]() {}
4 | }
@@ -719,7 +719,7 @@ class C {
exports[`with-semicolon-2.js [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | *foo() {}
4 | }
@@ -729,7 +729,7 @@ exports[`with-semicolon-2.js [acorn] format 1`] = `
exports[`with-semicolon-2.js [espree] format 1`] = `
"Unexpected token clicked (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | *foo() {}
4 | }
@@ -739,7 +739,7 @@ exports[`with-semicolon-2.js [espree] format 1`] = `
exports[`with-semicolon-2.js - {"semi":false} [acorn] format 1`] = `
"Unexpected token (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | *foo() {}
4 | }
@@ -749,7 +749,7 @@ exports[`with-semicolon-2.js - {"semi":false} [acorn] format 1`] = `
exports[`with-semicolon-2.js - {"semi":false} [espree] format 1`] = `
"Unexpected token clicked (2:12)
1 | class C {
> 2 | accessor clicked = \\"value\\";
> 2 | accessor clicked = "value";
| ^
3 | *foo() {}
4 | }
@@ -166,22 +166,22 @@ exports[`methods.js [acorn] format 1`] = `
"Unexpected character '@' (3:3)
1 |
2 | class Yo {
> 3 | @foo(\\"hello\\")
> 3 | @foo("hello")
| ^
4 | async plop() {}
5 |
6 | @anotherDecoratorWithALongName(\\"and a very long string as a first argument\\")"
6 | @anotherDecoratorWithALongName("and a very long string as a first argument")"
`;
exports[`methods.js [espree] format 1`] = `
"Unexpected character '@' (3:3)
1 |
2 | class Yo {
> 3 | @foo(\\"hello\\")
> 3 | @foo("hello")
| ^
4 | async plop() {}
5 |
6 | @anotherDecoratorWithALongName(\\"and a very long string as a first argument\\")"
6 | @anotherDecoratorWithALongName("and a very long string as a first argument")"
`;
exports[`methods.js format 1`] = `
@@ -266,7 +266,7 @@ export default class MyComponent {
exports[`mobx.js [acorn] format 1`] = `
"Unexpected character '@' (3:1)
1 | import {observable} from \\"mobx\\";
1 | import {observable} from "mobx";
2 |
> 3 | @observer class OrderLine {
| ^
@@ -277,7 +277,7 @@ exports[`mobx.js [acorn] format 1`] = `
exports[`mobx.js [espree] format 1`] = `
"Unexpected character '@' (3:1)
1 | import {observable} from \\"mobx\\";
1 | import {observable} from "mobx";
2 |
> 3 | @observer class OrderLine {
| ^
@@ -6,9 +6,9 @@ exports[`call-arguments.js [acorn] format 1`] = `
2 | expect(
> 3 | do {
| ^
4 | var bar = \\"foo\\";
4 | var bar = "foo";
5 | if (!bar) throw new Error(
6 | \\"unreachable\\""
6 | "unreachable""
`;
exports[`call-arguments.js [espree] format 1`] = `
@@ -17,9 +17,9 @@ exports[`call-arguments.js [espree] format 1`] = `
2 | expect(
> 3 | do {
| ^
4 | var bar = \\"foo\\";
4 | var bar = "foo";
5 | if (!bar) throw new Error(
6 | \\"unreachable\\""
6 | "unreachable""
`;
exports[`call-arguments.js [meriyah] format 1`] = `
@@ -28,9 +28,9 @@ exports[`call-arguments.js [meriyah] format 1`] = `
2 | expect(
> 3 | do {
| ^
4 | var bar = \\"foo\\";
4 | var bar = "foo";
5 | if (!bar) throw new Error(
6 | \\"unreachable\\""
6 | "unreachable""
`;
exports[`call-arguments.js format 1`] = `
@@ -2,28 +2,28 @@
exports[`assertions.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`assertions.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`assertions.js [flow] format 1`] = `
"Unexpected token \`,\`, expected the token \`)\` (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`assertions.js [meriyah] format 1`] = `
"Expected ')' (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
@@ -2,22 +2,22 @@
exports[`default-escaped.js [acorn] format 1`] = `
"Unexpected token (2:8)
1 | // export asyn\\\\u{63} from \\"async\\";
> 2 | export n\\\\u{63} from \\"async\\";
1 | // export asyn\\u{63} from "async";
> 2 | export n\\u{63} from "async";
| ^"
`;
exports[`default-escaped.js [espree] format 1`] = `
"Unexpected token n\\\\u{63} (2:8)
1 | // export asyn\\\\u{63} from \\"async\\";
> 2 | export n\\\\u{63} from \\"async\\";
"Unexpected token n\\u{63} (2:8)
1 | // export asyn\\u{63} from "async";
> 2 | export n\\u{63} from "async";
| ^"
`;
exports[`default-escaped.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:12)
1 | // export asyn\\\\u{63} from \\"async\\";
> 2 | export n\\\\u{63} from \\"async\\";
1 | // export asyn\\u{63} from "async";
> 2 | export n\\u{63} from "async";
| ^"
`;
@@ -81,14 +81,14 @@ export * as "foo" from "foo";
exports[`export-star-as-string2.js [flow] format 1`] = `
"Unexpected string, expected an identifier (1:13)
> 1 | export * as \\"foo\\" from 'foo'
> 1 | export * as "foo" from 'foo'
| ^^^^^
2 |"
`;
exports[`export-star-as-string2.js [typescript] format 1`] = `
"Identifier expected. (1:13)
> 1 | export * as \\"foo\\" from 'foo'
> 1 | export * as "foo" from 'foo'
| ^
2 |"
`;
@@ -2,34 +2,34 @@
exports[`test.js [acorn] format 1`] = `
"Unexpected token (3:8)
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\";
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports";
2 |
> 3 | export a,{b} from \\"./baz\\";
> 3 | export a,{b} from "./baz";
| ^
4 |
5 | export * as ns from \\"mod\\";
5 | export * as ns from "mod";
6 |"
`;
exports[`test.js [espree] format 1`] = `
"Unexpected token a (3:8)
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\";
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports";
2 |
> 3 | export a,{b} from \\"./baz\\";
> 3 | export a,{b} from "./baz";
| ^
4 |
5 | export * as ns from \\"mod\\";
5 | export * as ns from "mod";
6 |"
`;
exports[`test.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (3:8)
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\";
1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports";
2 |
> 3 | export a,{b} from \\"./baz\\";
> 3 | export a,{b} from "./baz";
| ^
4 |
5 | export * as ns from \\"mod\\";
5 | export * as ns from "mod";
6 |"
`;
@@ -2,21 +2,21 @@
exports[`dynamic-import.js [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`dynamic-import.js [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`dynamic-import.js [meriyah] format 1`] = `
"Expected ')' (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
@@ -37,32 +37,32 @@ import("./foo.json", { assert: { 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\\" assert { }
1 | export * as foo from "foo.json"
> 2 | export * as bar from "bar.json" assert { }
| ^
3 | export * as baz from \\"baz.json\\" assert { /* comment */ }
3 | export * as baz from "baz.json" assert { /* comment */ }
4 |
5 | import * as foo from \\"foo.json\\""
5 | import * as foo from "foo.json""
`;
exports[`empty.js [espree] format 1`] = `
"Unexpected token assert (2:33)
1 | export * as foo from \\"foo.json\\"
> 2 | export * as bar from \\"bar.json\\" assert { }
1 | export * as foo from "foo.json"
> 2 | export * as bar from "bar.json" assert { }
| ^
3 | export * as baz from \\"baz.json\\" assert { /* comment */ }
3 | export * as baz from "baz.json" assert { /* comment */ }
4 |
5 | import * as foo from \\"foo.json\\""
5 | import * as foo from "foo.json""
`;
exports[`empty.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:38)
1 | export * as foo from \\"foo.json\\"
> 2 | export * as bar from \\"bar.json\\" assert { }
1 | export * as foo from "foo.json"
> 2 | export * as bar from "bar.json" assert { }
| ^
3 | export * as baz from \\"baz.json\\" assert { /* comment */ }
3 | export * as baz from "baz.json" assert { /* comment */ }
4 |
5 | import * as foo from \\"foo.json\\""
5 | import * as foo from "foo.json""
`;
exports[`empty.js format 1`] = `
@@ -92,21 +92,21 @@ import * as baz from "baz.json" /* comment */;
exports[`multi-types.js [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" };
> 1 | import json from "./foo.json" assert { type: "json", type: "bar" };
| ^
2 |"
`;
exports[`multi-types.js [espree] format 1`] = `
"Unexpected token assert (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" };
> 1 | import json from "./foo.json" assert { type: "json", type: "bar" };
| ^
2 |"
`;
exports[`multi-types.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:36)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" };
> 1 | import json from "./foo.json" assert { type: "json", type: "bar" };
| ^
2 |"
`;
@@ -127,21 +127,21 @@ import json from "./foo.json" assert { type: "json", type: "bar" };
exports[`non-type.js [acorn] format 1`] = `
"Unexpected token (1:28)
> 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" };
> 1 | import foo from "foo.json" assert { lazy: "true" };
| ^
2 |"
`;
exports[`non-type.js [espree] format 1`] = `
"Unexpected token assert (1:28)
> 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" };
> 1 | import foo from "foo.json" assert { lazy: "true" };
| ^
2 |"
`;
exports[`non-type.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:33)
> 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" };
> 1 | import foo from "foo.json" assert { lazy: "true" };
| ^
2 |"
`;
@@ -178,28 +178,28 @@ assert({ type: "json" });
exports[`re-export.js [acorn] format 1`] = `
"Unexpected token (1:33)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from \\"foo.json\\" assert { type: \\"json\\" };
3 | export * as foo3 from \\"foo.json\\" assert { type: \\"json\\" };
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
`;
exports[`re-export.js [espree] format 1`] = `
"Unexpected token assert (1:33)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from \\"foo.json\\" assert { type: \\"json\\" };
3 | export * as foo3 from \\"foo.json\\" assert { type: \\"json\\" };
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
`;
exports[`re-export.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:38)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from \\"foo.json\\" assert { type: \\"json\\" };
3 | export * as foo3 from \\"foo.json\\" assert { type: \\"json\\" };
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
`;
@@ -223,21 +223,21 @@ export * as foo3 from "foo.json" assert { type: "json" };
exports[`static-import.js [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`static-import.js [espree] format 1`] = `
"Unexpected token assert (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`static-import.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:36)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
@@ -258,21 +258,21 @@ import json from "./foo.json" assert { type: "json" };
exports[`without-from.js [acorn] format 1`] = `
"Unexpected token (1:14)
> 1 | import \\"foo\\" assert { type: \\"json\\" }
> 1 | import "foo" assert { type: "json" }
| ^
2 |"
`;
exports[`without-from.js [espree] format 1`] = `
"Unexpected token assert (1:14)
> 1 | import \\"foo\\" assert { type: \\"json\\" }
> 1 | import "foo" assert { type: "json" }
| ^
2 |"
`;
exports[`without-from.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:19)
> 1 | import \\"foo\\" assert { type: \\"json\\" }
> 1 | import "foo" assert { type: "json" }
| ^
2 |"
`;
@@ -2,21 +2,21 @@
exports[`dynamic-import.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token , (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
exports[`dynamic-import.js - {"bracketSpacing":false} [meriyah] format 1`] = `
"Expected ')' (1:20)
> 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } });
> 1 | import("./foo.json", { assert: { type: "json" } });
| ^
2 |"
`;
@@ -38,19 +38,19 @@ import("./foo.json", {assert: {type: "json"}});
exports[`empty.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:33)
> 1 | export * as bar from \\"bar.json\\" assert { }
> 1 | export * as bar from "bar.json" assert { }
| ^"
`;
exports[`empty.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token assert (1:33)
> 1 | export * as bar from \\"bar.json\\" assert { }
> 1 | export * as bar from "bar.json" assert { }
| ^"
`;
exports[`empty.js - {"bracketSpacing":false} [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:38)
> 1 | export * as bar from \\"bar.json\\" assert { }
> 1 | export * as bar from "bar.json" assert { }
| ^"
`;
@@ -70,21 +70,21 @@ export * as bar from "bar.json";
exports[`re-export.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:33)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`re-export.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token assert (1:33)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`re-export.js - {"bracketSpacing":false} [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:38)
> 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" };
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
2 |"
`;
@@ -106,21 +106,21 @@ export {foo2} from "foo.json" assert {type: "json"};
exports[`static-import.js - {"bracketSpacing":false} [acorn] format 1`] = `
"Unexpected token (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`static-import.js - {"bracketSpacing":false} [espree] format 1`] = `
"Unexpected token assert (1:31)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
exports[`static-import.js - {"bracketSpacing":false} [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:36)
> 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" };
> 1 | import json from "./foo.json" assert { type: "json" };
| ^
2 |"
`;
@@ -5,7 +5,7 @@ exports[`comments.js [acorn] format 1`] = `
> 1 | const m = /*A1*/ module /*A2*/ { /*A3*/
| ^
2 | /*A4*/
3 | export const foo = \\"foo\\";
3 | export const foo = "foo";
4 | export { foo }; /*A5*/"
`;
@@ -14,7 +14,7 @@ exports[`comments.js [espree] format 1`] = `
> 1 | const m = /*A1*/ module /*A2*/ { /*A3*/
| ^
2 | /*A4*/
3 | export const foo = \\"foo\\";
3 | export const foo = "foo";
4 | export { foo }; /*A5*/"
`;
@@ -23,7 +23,7 @@ exports[`comments.js [meriyah] format 1`] = `
> 1 | const m = /*A1*/ module /*A2*/ { /*A3*/
| ^
2 | /*A4*/
3 | export const foo = \\"foo\\";
3 | export const foo = "foo";
4 | export { foo }; /*A5*/"
`;
@@ -211,7 +211,7 @@ exports[`range.js [acorn] format 1`] = `
| ^
2 | };
3 |
4 | foo(module { export let foo = \\"foo\\"; })"
4 | foo(module { export let foo = "foo"; })"
`;
exports[`range.js [espree] format 1`] = `
@@ -220,7 +220,7 @@ exports[`range.js [espree] format 1`] = `
| ^
2 | };
3 |
4 | foo(module { export let foo = \\"foo\\"; })"
4 | foo(module { export let foo = "foo"; })"
`;
exports[`range.js [meriyah] format 1`] = `
@@ -229,7 +229,7 @@ exports[`range.js [meriyah] format 1`] = `
| ^
2 | };
3 |
4 | foo(module { export let foo = \\"foo\\"; })"
4 | foo(module { export let foo = "foo"; })"
`;
exports[`range.js format 1`] = `
@@ -2,11 +2,11 @@
exports[`module-string-names-export.js [meriyah] format 1`] = `
"Only a identifier can be used to indicate alias (1:26)
> 1 | export { smile as \\"smile1\\" } from \\"./emojis.js\\";
> 1 | export { smile as "smile1" } from "./emojis.js";
| ^
2 | export { \\"smile\\" as smile2 } from \\"./emojis.js\\";
3 | export { \\"smile\\" as \\"smile3\\" } from \\"./emojis.js\\";
4 | export { foo1, bar as \\"foo2\\" } from \\"./emojis.js\\";"
2 | export { "smile" as smile2 } from "./emojis.js";
3 | export { "smile" as "smile3" } from "./emojis.js";
4 | export { foo1, bar as "foo2" } from "./emojis.js";"
`;
exports[`module-string-names-export.js format 1`] = `
@@ -38,10 +38,10 @@ export { "smile4" } from "./emojis.js";
exports[`module-string-names-import.js [meriyah] format 1`] = `
"Expected '}' (1:18)
> 1 | import { \\"default\\" as quotation1 } from \\"Confucius\\";
> 1 | import { "default" as quotation1 } from "Confucius";
| ^
2 | import { \\"foo\\" as bar, \\"default\\" as qux } from \\"module-a\\";
3 | import { \\"學而時習之,不亦說乎?\\" as quotation2 } from \\"Confucius\\";
2 | import { "foo" as bar, "default" as qux } from "module-a";
3 | import { "學而時習之,不亦說乎?" as quotation2 } from "Confucius";
4 |"
`;
@@ -2,53 +2,53 @@
exports[`text.js [acorn] format 1`] = `
"Bad escape sequence in untagged template literal (6:18)
4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`;
5 | foo = css\`\\\\u{prettier}\\\\u{0065}\`;
> 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`;
4 | foo = markdown\`\\u{prettier}\\u{0065}\`;
5 | foo = css\`\\u{prettier}\\u{0065}\`;
> 6 | foo = /* HTML */\`\\u{prettier}\\u{0065}\`;
| ^
7 | foo = /* GraphQL */\`\\\\u{prettier}\\\\u{0065}\`;
7 | foo = /* GraphQL */\`\\u{prettier}\\u{0065}\`;
8 |
9 | foo = foo\`\\\\u{prettier}\${foo}pr\\\\u{0065}ttier\`;"
9 | foo = foo\`\\u{prettier}\${foo}pr\\u{0065}ttier\`;"
`;
exports[`text.js [espree] format 1`] = `
"Bad escape sequence in untagged template literal (6:18)
4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`;
5 | foo = css\`\\\\u{prettier}\\\\u{0065}\`;
> 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`;
4 | foo = markdown\`\\u{prettier}\\u{0065}\`;
5 | foo = css\`\\u{prettier}\\u{0065}\`;
> 6 | foo = /* HTML */\`\\u{prettier}\\u{0065}\`;
| ^
7 | foo = /* GraphQL */\`\\\\u{prettier}\\\\u{0065}\`;
7 | foo = /* GraphQL */\`\\u{prettier}\\u{0065}\`;
8 |
9 | foo = foo\`\\\\u{prettier}\${foo}pr\\\\u{0065}ttier\`;"
9 | foo = foo\`\\u{prettier}\${foo}pr\\u{0065}ttier\`;"
`;
exports[`text.js [flow] format 1`] = `
"Unexpected token ILLEGAL (1:12)
> 1 | foo = foo\`\\\\u{prettier}\\\\u{0065}\`;
> 1 | foo = foo\`\\u{prettier}\\u{0065}\`;
| ^
2 | foo = html\`\\\\u{prettier}\\\\u{0065}\`;
3 | foo = graphql\`\\\\u{prettier}\\\\u{0065}\`;
4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`;"
2 | foo = html\`\\u{prettier}\\u{0065}\`;
3 | foo = graphql\`\\u{prettier}\\u{0065}\`;
4 | foo = markdown\`\\u{prettier}\\u{0065}\`;"
`;
exports[`text.js [meriyah] format 1`] = `
"Invalid hexadecimal escape sequence (6:20)
4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`;
5 | foo = css\`\\\\u{prettier}\\\\u{0065}\`;
> 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`;
4 | foo = markdown\`\\u{prettier}\\u{0065}\`;
5 | foo = css\`\\u{prettier}\\u{0065}\`;
> 6 | foo = /* HTML */\`\\u{prettier}\\u{0065}\`;
| ^
7 | foo = /* GraphQL */\`\\\\u{prettier}\\\\u{0065}\`;
7 | foo = /* GraphQL */\`\\u{prettier}\\u{0065}\`;
8 |
9 | foo = foo\`\\\\u{prettier}\${foo}pr\\\\u{0065}ttier\`;"
9 | foo = foo\`\\u{prettier}\${foo}pr\\u{0065}ttier\`;"
`;
exports[`text.js [typescript] format 1`] = `
"Hexadecimal digit expected. (1:14)
> 1 | foo = foo\`\\\\u{prettier}\\\\u{0065}\`;
> 1 | foo = foo\`\\u{prettier}\\u{0065}\`;
| ^
2 | foo = html\`\\\\u{prettier}\\\\u{0065}\`;
3 | foo = graphql\`\\\\u{prettier}\\\\u{0065}\`;
4 | foo = markdown\`\\\\u{prettier}\\\\u{0065}\`;"
2 | foo = html\`\\u{prettier}\\u{0065}\`;
3 | foo = graphql\`\\u{prettier}\\u{0065}\`;
4 | foo = markdown\`\\u{prettier}\\u{0065}\`;"
`;
exports[`text.js format 1`] = `
@@ -2,7 +2,7 @@
exports[`computed.js [acorn] format 1`] = `
"Unexpected character '{' (2:9)
1 | const key = \\"a\\";
1 | const key = "a";
> 2 | assert(#{ [key]: 1 } === #{ a: 1 })
| ^
3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 })
@@ -12,7 +12,7 @@ exports[`computed.js [acorn] format 1`] = `
exports[`computed.js [espree] format 1`] = `
"Unexpected character '{' (2:9)
1 | const key = \\"a\\";
1 | const key = "a";
> 2 | assert(#{ [key]: 1 } === #{ a: 1 })
| ^
3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 })
@@ -22,7 +22,7 @@ exports[`computed.js [espree] format 1`] = `
exports[`computed.js [meriyah] format 1`] = `
"'#' not followed by identifier (2:8)
1 | const key = \\"a\\";
1 | const key = "a";
> 2 | assert(#{ [key]: 1 } === #{ a: 1 })
| ^
3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 })
@@ -190,7 +190,7 @@ assert(record1.d?.a === undefined);
exports[`shorthand.js [acorn] format 1`] = `
"Unexpected character '{' (2:17)
1 | const url = \\"https://github.com/tc39/proposal-record-tuple\\";
1 | const url = "https://github.com/tc39/proposal-record-tuple";
> 2 | const record = #{ url }
| ^
3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple
@@ -199,7 +199,7 @@ exports[`shorthand.js [acorn] format 1`] = `
exports[`shorthand.js [espree] format 1`] = `
"Unexpected character '{' (2:17)
1 | const url = \\"https://github.com/tc39/proposal-record-tuple\\";
1 | const url = "https://github.com/tc39/proposal-record-tuple";
> 2 | const record = #{ url }
| ^
3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple
@@ -208,7 +208,7 @@ exports[`shorthand.js [espree] format 1`] = `
exports[`shorthand.js [meriyah] format 1`] = `
"'#' not followed by identifier (2:16)
1 | const url = \\"https://github.com/tc39/proposal-record-tuple\\";
1 | const url = "https://github.com/tc39/proposal-record-tuple";
> 2 | const record = #{ url }
| ^
3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple
@@ -235,28 +235,28 @@ console.log(record.url); // https://github.com/tc39/proposal-record-tuple
exports[`spread.js [acorn] format 1`] = `
"Unexpected character '{' (1:19)
> 1 | const formData = #{ title: \\"Implement all the things\\" }
> 1 | const formData = #{ title: "Implement all the things" }
| ^
2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData }
3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" }
2 | const taskNow = #{ id: 42, status: "WIP", ...formData }
3 | const taskLater = #{ ...taskNow, status: "DONE" }
4 |"
`;
exports[`spread.js [espree] format 1`] = `
"Unexpected character '{' (1:19)
> 1 | const formData = #{ title: \\"Implement all the things\\" }
> 1 | const formData = #{ title: "Implement all the things" }
| ^
2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData }
3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" }
2 | const taskNow = #{ id: 42, status: "WIP", ...formData }
3 | const taskLater = #{ ...taskNow, status: "DONE" }
4 |"
`;
exports[`spread.js [meriyah] format 1`] = `
"'#' not followed by identifier (1:18)
> 1 | const formData = #{ title: \\"Implement all the things\\" }
> 1 | const formData = #{ title: "Implement all the things" }
| ^
2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData }
3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" }
2 | const taskNow = #{ id: 42, status: "WIP", ...formData }
3 | const taskLater = #{ ...taskNow, status: "DONE" }
4 |"
`;
@@ -4,44 +4,44 @@ exports[`non-octal-eight-and-nine.js [acorn] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
> 3 | "\\8","\\9";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
5 | "use strict";
6 | "\\8", "\\9";"
`;
exports[`non-octal-eight-and-nine.js [espree] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
> 3 | "\\8","\\9";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
5 | "use strict";
6 | "\\8", "\\9";"
`;
exports[`non-octal-eight-and-nine.js - {"trailingComma":"all"} [acorn] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
> 3 | "\\8","\\9";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
5 | "use strict";
6 | "\\8", "\\9";"
`;
exports[`non-octal-eight-and-nine.js - {"trailingComma":"all"} [espree] format 1`] = `
"Invalid escape sequence (3:3)
1 | // https://github.com/babel/babel/pull/11852
2 |
> 3 | \\"\\\\8\\",\\"\\\\9\\";
> 3 | "\\8","\\9";
| ^
4 | () => {
5 | \\"use strict\\";
6 | \\"\\\\8\\", \\"\\\\9\\";"
5 | "use strict";
6 | "\\8", "\\9";"
`;
exports[`non-octal-eight-and-nine.js - {"trailingComma":"all"} format 1`] = `
@@ -2,29 +2,29 @@
exports[`throw_expression.js [acorn] format 1`] = `
"Unexpected token (1:26)
> 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {}
> 1 | function save(filename = throw new TypeError("Argument required")) {}
| ^
2 |
3 | lint(ast, {
4 | with: () => throw new Error(\\"avoid using 'with' statements.\\")"
4 | with: () => throw new Error("avoid using 'with' statements.")"
`;
exports[`throw_expression.js [espree] format 1`] = `
"Unexpected token throw (1:26)
> 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {}
> 1 | function save(filename = throw new TypeError("Argument required")) {}
| ^
2 |
3 | lint(ast, {
4 | with: () => throw new Error(\\"avoid using 'with' statements.\\")"
4 | with: () => throw new Error("avoid using 'with' statements.")"
`;
exports[`throw_expression.js [meriyah] format 1`] = `
"Unexpected token: 'throw' (1:30)
> 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {}
> 1 | function save(filename = throw new TypeError("Argument required")) {}
| ^
2 |
3 | lint(ast, {
4 | with: () => throw new Error(\\"avoid using 'with' statements.\\")"
4 | with: () => throw new Error("avoid using 'with' statements.")"
`;
exports[`throw_expression.js format 1`] = `
@@ -2,7 +2,7 @@
exports[`trailing.js [acorn] format 1`] = `
"Unexpected token (1:8)
> 1 | export type Result<T, V> = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" };
> 1 | export type Result<T, V> = | { kind: "not-test-editor1" } | { kind: "not-test-editor2" };
| ^
2 |
3 | // Note: there are trailing whitespace in this file
@@ -11,7 +11,7 @@ exports[`trailing.js [acorn] format 1`] = `
exports[`trailing.js [espree] format 1`] = `
"Unexpected token type (1:8)
> 1 | export type Result<T, V> = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" };
> 1 | export type Result<T, V> = | { kind: "not-test-editor1" } | { kind: "not-test-editor2" };
| ^
2 |
3 | // Note: there are trailing whitespace in this file
@@ -20,7 +20,7 @@ exports[`trailing.js [espree] format 1`] = `
exports[`trailing.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:11)
> 1 | export type Result<T, V> = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" };
> 1 | export type Result<T, V> = | { kind: "not-test-editor1" } | { kind: "not-test-editor2" };
| ^
2 |
3 | // Note: there are trailing whitespace in this file
@@ -46,7 +46,7 @@ exports[`parenthesized-decorators-tagged-template.ts [babel-ts] format 1`] = `
1 | class Test {
> 2 | @foo\`bar\`
| ^
3 | text: string = \\"text\\"
3 | text: string = "text"
4 | }
5 |"
`;
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`snippet: #0 [missing-comments] format 1`] = `"Comment \\"comment\\" was not printed. Please report this error!"`;
exports[`snippet: #0 [missing-comments] format 1`] = `"Comment "comment" was not printed. Please report this error!"`;
@@ -10,7 +10,7 @@ exports[`async-arrow-invalid.js [flow] format 1`] = `
exports[`default-escaped.js [flow] format 1`] = `
"Unexpected identifier, expected the token \`{\` (1:8)
> 1 | export asyn\\\\u{63} from \\"async\\";
> 1 | export asyn\\u{63} from "async";
| ^^^^^^^^^^
2 |"
`;
@@ -31,14 +31,14 @@ exports[`function-async.js [flow] format 1`] = `
exports[`module-attributes-dynamic.js [flow] format 1`] = `
"Unexpected token \`,\`, expected the token \`)\` (1:18)
> 1 | import(\\"foo.json\\", { with: { type: \\"json\\" } })
> 1 | import("foo.json", { with: { type: "json" } })
| ^
2 |"
`;
exports[`module-attributes-static.js [flow] format 1`] = `
"Unexpected token \`with\`, expected the token \`;\` (1:28)
> 1 | import foo from \\"foo.json\\" with type: \\"json\\";
> 1 | import foo from "foo.json" with type: "json";
| ^^^^
2 |"
`;
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`type-interfaces.graphql [graphql] format 1`] = `
"Syntax Error: Unexpected \\"|\\". (5:21)
"Syntax Error: Unexpected "|". (5:21)
3 | # which will break seperator detection added in #7305
4 |
> 5 | type A implements A | B {
@@ -7,7 +7,7 @@ exports[`snippet: #0 [acorn] format 1`] = `
`;
exports[`snippet: #0 [babel] format 1`] = `
"Unexpected token, expected \\"(\\" (1:5)
"Unexpected token, expected "(" (1:5)
> 1 | for each (a in b) {}
| ^"
`;
@@ -19,7 +19,7 @@ exports[`snippet: #0 [babel] format 2`] = `
`;
exports[`snippet: #0 [babel-flow] format 1`] = `
"Unexpected token, expected \\"(\\" (1:5)
"Unexpected token, expected "(" (1:5)
> 1 | for each (a in b) {}
| ^"
`;
@@ -31,7 +31,7 @@ exports[`snippet: #0 [babel-flow] format 2`] = `
`;
exports[`snippet: #0 [babel-ts] format 1`] = `
"Unexpected token, expected \\"(\\" (1:5)
"Unexpected token, expected "(" (1:5)
> 1 | for each (a in b) {}
| ^"
`;
@@ -13,42 +13,42 @@ exports[`html-like-comments.js [babel] format 1`] = `
exports[`import-assertions-for-export-without-from.js [babel] format 1`] = `
"Missing semicolon. (1:15)
> 1 | export { foo } assert { type: \\"json\\" };
> 1 | export { foo } assert { type: "json" };
| ^
2 |"
`;
exports[`import-assertions-with-parens.js [babel] format 1`] = `
"Unexpected token (1:19)
> 1 | import \\"x\\" assert ({type: 'json'});
> 1 | import "x" assert ({type: 'json'});
| ^
2 |"
`;
exports[`invalid-escape-in-identifier.js [babel] format 1`] = `
"Invalid Unicode escape. (1:7)
> 1 | const \\\\u{20} = 1
> 1 | const \\u{20} = 1
| ^
2 | const \\\\u{3000} = 1
2 | const \\u{3000} = 1
3 |"
`;
exports[`invalid-escape-in-identifier-2.js [babel] format 1`] = `
"Expecting Unicode escape sequence \\\\uXXXX. (1:3)
> 1 | a\\\\ = a
"Expecting Unicode escape sequence \\uXXXX. (1:3)
> 1 | a\\ = a
| ^
2 |"
`;
exports[`module-attributes.js [babel] format 1`] = `
"Unexpected token, expected \\"(\\" (1:33)
> 1 | import foo from \\"foo.json\\" with type: \\"json\\";
"Unexpected token, expected "(" (1:33)
> 1 | import foo from "foo.json" with type: "json";
| ^
2 |"
`;
exports[`no-for-in-init-concise-binary-in.js [babel] format 1`] = `
"Unexpected token, expected \\")\\" (3:18)
"Unexpected token, expected ")" (3:18)
1 | // https://github.com/babel/babel/pull/11931
2 |
> 3 | for (() => x in y;;);
@@ -64,7 +64,7 @@ exports[`partial-template-strings.js [babel] format 1`] = `
| ^
7 | name_not_found: \`'\${?}' not found.\`
8 | };
9 | Diagnostics.name_not_found(\\"foo\\"); // \\"'foo' not found.\\""
9 | Diagnostics.name_not_found("foo"); // "'foo' not found.""
`;
exports[`snippet: #0 [babel] format 1`] = `
@@ -155,7 +155,7 @@ exports[`snippet: #4 [acorn] format 1`] = `
`;
exports[`snippet: #4 [babel] format 1`] = `
"Unexpected token, expected \\",\\" (1:22)
"Unexpected token, expected "," (1:22)
> 1 | async (a) => (await a!) ** 6;
| ^"
`;
@@ -55,7 +55,7 @@ exports[`snippet: #0 [flow] format 1`] = `
`;
exports[`snippet: #0 [meriyah] format 1`] = `
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
"Identifier "let" disallowed as left-hand side expression in strict mode (1:9)
> 1 | for (let.foo of []);
| ^"
`;
@@ -91,7 +91,7 @@ exports[`snippet: #1 [flow] format 1`] = `
`;
exports[`snippet: #1 [meriyah] format 1`] = `
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
"Identifier "let" disallowed as left-hand side expression in strict mode (1:9)
> 1 | for (let().bar of []);
| ^"
`;
@@ -127,7 +127,7 @@ exports[`snippet: #2 [flow] format 1`] = `
`;
exports[`snippet: #2 [meriyah] format 1`] = `
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10)
"Identifier "let" disallowed as left-hand side expression in strict mode (1:10)
> 1 | for (let\`\`.bar of []);
| ^"
`;
@@ -14,12 +14,12 @@ exports[`snippet: #0 [meriyah] format 1`] = `
exports[`snippet: #1 [espree] format 1`] = `
"The keyword 'interface' is reserved (1:8)
> 1 | import interface from \\"foo\\";
> 1 | import interface from "foo";
| ^"
`;
exports[`snippet: #1 [meriyah] format 1`] = `
"Unexpected strict mode reserved word (1:16)
> 1 | import interface from \\"foo\\";
> 1 | import interface from "foo";
| ^"
`;
@@ -20,91 +20,91 @@ exports[`snippet: #0 [json5] format 1`] = `
exports[`snippet: #1 [json] format 1`] = `
"Computed key is not allowed in JSON. (1:3)
> 1 | {[\\"foo\\"]:\\"bar\\"}
> 1 | {["foo"]:"bar"}
| ^^^^^"
`;
exports[`snippet: #1 [json-stringify] format 1`] = `
"Computed key is not allowed in JSON. (1:3)
> 1 | {[\\"foo\\"]:\\"bar\\"}
> 1 | {["foo"]:"bar"}
| ^^^^^"
`;
exports[`snippet: #1 [json5] format 1`] = `
"Computed key is not allowed in JSON. (1:3)
> 1 | {[\\"foo\\"]:\\"bar\\"}
> 1 | {["foo"]:"bar"}
| ^^^^^"
`;
exports[`snippet: #2 [json] format 1`] = `
"Operator '~' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": ~1}
> 1 | {"foo": ~1}
| ^^"
`;
exports[`snippet: #2 [json-stringify] format 1`] = `
"Operator '~' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": ~1}
> 1 | {"foo": ~1}
| ^^"
`;
exports[`snippet: #2 [json5] format 1`] = `
"Operator '~' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": ~1}
> 1 | {"foo": ~1}
| ^^"
`;
exports[`snippet: #3 [json] format 1`] = `
"'LogicalExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": false || \\"bar\\"}
> 1 | {"foo": false || "bar"}
| ^^^^^^^^^^^^^^"
`;
exports[`snippet: #3 [json-stringify] format 1`] = `
"'LogicalExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": false || \\"bar\\"}
> 1 | {"foo": false || "bar"}
| ^^^^^^^^^^^^^^"
`;
exports[`snippet: #3 [json5] format 1`] = `
"'LogicalExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": false || \\"bar\\"}
> 1 | {"foo": false || "bar"}
| ^^^^^^^^^^^^^^"
`;
exports[`snippet: #4 [json] format 1`] = `
"'ArrowFunctionExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": () => {}}
> 1 | {"foo": () => {}}
| ^^^^^^^^"
`;
exports[`snippet: #4 [json-stringify] format 1`] = `
"'ArrowFunctionExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": () => {}}
> 1 | {"foo": () => {}}
| ^^^^^^^^"
`;
exports[`snippet: #4 [json5] format 1`] = `
"'ArrowFunctionExpression' is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": () => {}}
> 1 | {"foo": () => {}}
| ^^^^^^^^"
`;
exports[`snippet: #5 [json] format 1`] = `
"Expecting Unicode escape sequence \\\\uXXXX. (1:10)
> 1 | packages\\\\the-hub\\\\cypress\\\\fixtures\\\\gridConfiguration.json
"Expecting Unicode escape sequence \\uXXXX. (1:10)
> 1 | packages\\the-hub\\cypress\\fixtures\\gridConfiguration.json
| ^"
`;
exports[`snippet: #5 [json-stringify] format 1`] = `
"Expecting Unicode escape sequence \\\\uXXXX. (1:10)
> 1 | packages\\\\the-hub\\\\cypress\\\\fixtures\\\\gridConfiguration.json
"Expecting Unicode escape sequence \\uXXXX. (1:10)
> 1 | packages\\the-hub\\cypress\\fixtures\\gridConfiguration.json
| ^"
`;
exports[`snippet: #5 [json5] format 1`] = `
"Expecting Unicode escape sequence \\\\uXXXX. (1:10)
> 1 | packages\\\\the-hub\\\\cypress\\\\fixtures\\\\gridConfiguration.json
"Expecting Unicode escape sequence \\uXXXX. (1:10)
> 1 | packages\\the-hub\\cypress\\fixtures\\gridConfiguration.json
| ^"
`;
@@ -401,21 +401,21 @@ exports[`snippet: #21 [json5] format 1`] = `
exports[`snippet: #22 [json] format 1`] = `
"Unexpected token (2:1)
1 | \\"use strict\\"
1 | "use strict"
> 2 | {}
| ^"
`;
exports[`snippet: #22 [json-stringify] format 1`] = `
"Unexpected token (2:1)
1 | \\"use strict\\"
1 | "use strict"
> 2 | {}
| ^"
`;
exports[`snippet: #22 [json5] format 1`] = `
"Unexpected token (2:1)
1 | \\"use strict\\"
1 | "use strict"
> 2 | {}
| ^"
`;
@@ -2,7 +2,7 @@
exports[`snippet: #0 [json-stringify] format 1`] = `
"Comment is not allowed in JSON. (1:1)
> 1 | /* comment */{\\"foo\\": 1}
> 1 | /* comment */{"foo": 1}
| ^^^^^^^^^^^^^"
`;
@@ -10,11 +10,11 @@ exports[`snippet: #1 [json-stringify] format 1`] = `
"Comment is not allowed in JSON. (1:1)
> 1 | // comment
| ^^^^^^^^^^
2 | {\\"foo\\": 1}"
2 | {"foo": 1}"
`;
exports[`snippet: #2 [json-stringify] format 1`] = `
"Comment is not allowed in JSON. (1:9)
> 1 | {\\"foo\\": /* comment */ 1}
> 1 | {"foo": /* comment */ 1}
| ^^^^^^^^^^^^^"
`;
@@ -14,7 +14,7 @@ exports[`inline-comment.less [less] format 1`] = `
exports[`open-double-quote.less [less] format 1`] = `
"CssSyntaxError: Unclosed string (2:17)
1 | a {
> 2 | background: url(\\"
> 2 | background: url("
| ^
3 | }
4 |"
@@ -2,7 +2,7 @@
exports[`default-escaped.ts [typescript] format 1`] = `
"Declaration or statement expected. (1:1)
> 1 | export asyn\\\\u{63} from \\"async\\";
> 1 | export asyn\\u{63} from "async";
| ^
2 |"
`;
@@ -25,7 +25,7 @@ exports[`invalid-jsx-1.ts [typescript] format 1`] = `
exports[`module-attributes-static.ts [typescript] format 1`] = `
"';' expected. (1:28)
> 1 | import foo from \\"foo.json\\" with type: \\"json\\";
> 1 | import foo from "foo.json" with type: "json";
| ^
2 |"
`;
@@ -52,25 +52,25 @@ exports[`snippet: #1 [typescript] format 1`] = `
exports[`snippet: #2 [typescript] format 1`] = `
"':' expected. (1:21)
> 1 | let x3 = <div>{\\"foo\\"}}</div>;
> 1 | let x3 = <div>{"foo"}}</div>;
| ^"
`;
exports[`snippet: #3 [typescript] format 1`] = `
"':' expected. (1:21)
> 1 | let x4 = <div>{\\"foo\\"}></div>;
> 1 | let x4 = <div>{"foo"}></div>;
| ^"
`;
exports[`snippet: #4 [typescript] format 1`] = `
"Expression expected. (1:15)
> 1 | let x5 = <div>}{\\"foo\\"}</div>;
> 1 | let x5 = <div>}{"foo"}</div>;
| ^"
`;
exports[`snippet: #5 [typescript] format 1`] = `
"Expression expected. (1:15)
> 1 | let x6 = <div>>{\\"foo\\"}</div>;
> 1 | let x6 = <div>>{"foo"}</div>;
| ^"
`;
@@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`unclosed_tag.vue [vue] format 1`] = `
"Unexpected character \\"EOF\\" (2:1)
"Unexpected character "EOF" (2:1)
1 | <div
> 2 |
| ^"
`;
exports[`unclosed_tag_in_template.vue [vue] format 1`] = `
"Unexpected character \\"/\\" (4:2)
"Unexpected character "/" (4:2)
2 | <p>Templates are formatted as well...
3 | </
> 4 | </template>
@@ -17,12 +17,12 @@ exports[`unclosed_tag_in_template.vue [vue] format 1`] = `
`;
exports[`upper-case.html [vue] format 1`] = `
"Void elements do not have end tags \\"Input\\" (8:21)
6 | <div id=\\"app\\">
"Void elements do not have end tags "Input" (8:21)
6 | <div id="app">
7 | <!-- when vue parse use for html, Input should not treat as component -->
> 8 | <Input>{{value}}</Input>
| ^^^^^^^^
9 | </div>
10 | </body>
11 | <script src=\\"https://unpkg.com/vue/dist/vue.js\\"></script>"
11 | <script src="https://unpkg.com/vue/dist/vue.js"></script>"
`;
@@ -35,7 +35,7 @@ abstract class Bar {
`;
exports[`constructor.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\",\\" (2:22)
"Unexpected token, expected "," (2:22)
1 | class foo {
> 2 | constructor(static a: number) {}
| ^
@@ -351,7 +351,7 @@ interface AudioBufferList {
`;
exports[`methods.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\";\\" (6:10)
"Unexpected token, expected ";" (6:10)
4 |
5 | interface Iterable<T> {
> 6 | export [Symbol.iterator](): Iterator<T>;
@@ -442,7 +442,7 @@ const;
`;
exports[`errorOnInitializerInInterfaceProperty.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\";\\" (2:17)
"Unexpected token, expected ";" (2:17)
1 | interface Foo {
> 2 | bar: number = 5;
| ^
@@ -153,7 +153,7 @@ class f7<> {
`;
exports[`index-signature.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\"]\\" (4:13)
"Unexpected token, expected "]" (4:13)
2 |
3 | type TwoParams = {
> 4 | [a: string, b: string]: string;
@@ -164,7 +164,7 @@ exports[`index-signature.ts [babel-ts] format 1`] = `
`;
exports[`index-signature.ts - {"trailingComma":"all"} [babel-ts] format 1`] = `
"Unexpected token, expected \\"]\\" (4:13)
"Unexpected token, expected "]" (4:13)
2 |
3 | type TwoParams = {
> 4 | [a: string, b: string]: string;
@@ -238,7 +238,7 @@ type TooLongSingleParam = {
`;
exports[`index-signature.ts - {"trailingComma":"es5"} [babel-ts] format 1`] = `
"Unexpected token, expected \\"]\\" (4:13)
"Unexpected token, expected "]" (4:13)
2 |
3 | type TwoParams = {
> 4 | [a: string, b: string]: string;
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`keywords.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\"{\\" (9:12)
"Unexpected token, expected "{" (9:12)
7 |
8 | // Apparently this parses :P
> 9 | export private public protected static readonly abstract async enum X { }
@@ -196,7 +196,7 @@ class G {
`;
exports[`module.ts [babel-ts] format 1`] = `
"Unexpected token, expected \\"{\\" (7:10)
"Unexpected token, expected "{" (7:10)
5 |
6 | // Apparently this parses :P
> 7 | export private public protected static readonly abstract async enum X { }
@@ -19,7 +19,7 @@ exports[`deprecated option values are warned (stderr) 1`] = `
`;
exports[`deprecated option values are warned (stdout) 1`] = `
"console.log(\\"could be single quote and without semi\\");
"console.log("could be single quote and without semi");
"
`;
@@ -28,7 +28,7 @@ exports[`deprecated option values are warned (write) 1`] = `Array []`;
exports[`negated options work (stderr) 1`] = `""`;
exports[`negated options work (stdout) 1`] = `
"console.log(\\"could be single quote and without semi\\")
"console.log("could be single quote and without semi")
"
`;
@@ -81,7 +81,7 @@ exports[`unknown negated options are warned (stderr) 1`] = `
`;
exports[`unknown negated options are warned (stdout) 1`] = `
"console.log(\\"could be single quote and without semi\\");
"console.log("could be single quote and without semi");
"
`;
@@ -93,7 +93,7 @@ exports[`unknown options are warned (stderr) 1`] = `
`;
exports[`unknown options are warned (stdout) 1`] = `
"console.log(\\"could be single quote and without semi\\");
"console.log("could be single quote and without semi");
"
`;
@@ -105,6 +105,6 @@ exports[`unknown options not suggestion \`_\` (stderr) 1`] = `
`;
exports[`unknown options not suggestion \`_\` (stdout) 1`] = `
"console.log(\\"could be single quote and without semi\\");
"console.log("could be single quote and without semi");
"
`;
@@ -10,7 +10,7 @@ exports[`resolves external configuration from package.json (stdout) 1`] = `""`;
exports[`resolves external configuration from package.json (write) 1`] = `Array []`;
exports[`show warning with kebab-case option key (stderr) 1`] = `
"[warn] Ignored unknown option { \\"print-width\\": 3 }. Did you mean printWidth?
"[warn] Ignored unknown option { "print-width": 3 }. Did you mean printWidth?
"
`;
@@ -19,7 +19,7 @@ exports[`show warning with kebab-case option key (stdout) 1`] = `""`;
exports[`show warning with kebab-case option key (write) 1`] = `Array []`;
exports[`show warning with unknown option (stderr) 1`] = `
"[warn] Ignored unknown option { hello: \\"world\\" }.
"[warn] Ignored unknown option { hello: "world" }.
"
`;
@@ -28,7 +28,7 @@ exports[`show warning with unknown option (stdout) 1`] = `""`;
exports[`show warning with unknown option (write) 1`] = `Array []`;
exports[`throw error for unsupported extension (stderr) 1`] = `
"[error] Invalid configuration file \`<cwd>/tests/integration/cli/config/invalid\`: No loader specified for extension \\".unsupported\\"
"[error] Invalid configuration file \`<cwd>/tests/integration/cli/config/invalid\`: No loader specified for extension ".unsupported"
"
`;
@@ -54,7 +54,7 @@ exports[`throw error with invalid config option (int) (stdout) 1`] = `""`;
exports[`throw error with invalid config option (int) (write) 1`] = `Array []`;
exports[`throw error with invalid config option (trailingComma) (stderr) 1`] = `
"[error] Invalid trailingComma value. Expected \\"all\\", \\"es5\\" or \\"none\\", but received \\"wow\\".
"[error] Invalid trailingComma value. Expected "all", "es5" or "none", but received "wow".
"
`;
@@ -63,7 +63,7 @@ exports[`throw error with invalid config option (trailingComma) (stdout) 1`] = `
exports[`throw error with invalid config option (trailingComma) (write) 1`] = `Array []`;
exports[`throw error with invalid config precedence option (configPrecedence) (stderr) 1`] = `
"[error] Invalid --config-precedence value. Expected \\"cli-override\\", \\"file-override\\" or \\"prefer-file\\", but received \\"option/configPrecedence\\".
"[error] Invalid --config-precedence value. Expected "cli-override", "file-override" or "prefer-file", but received "option/configPrecedence".
"
`;
@@ -5,59 +5,59 @@ exports[`CLI overrides take precedence (stderr) 1`] = `""`;
exports[`CLI overrides take precedence (stdout) 1`] = `
"function f() {
console.log(
\\"should have tab width 8\\"
"should have tab width 8"
)
}
function f() {
console.log(
\\"should have space width 2\\"
"should have space width 2"
)
}
function f() {
console.log(
\\"should have space width 8\\"
"should have space width 8"
)
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present"
)
}
console.log(
\\"should have no semi\\"
"should have no semi"
)
console.log(
\\"jest/__best-tests__/.file.js should have semi\\"
"jest/__best-tests__/.file.js should have semi"
);
console.log(
\\"jest/__best-tests__/file.js should have semi\\"
"jest/__best-tests__/file.js should have semi"
);
console.log(
\\"jest/Component.js should not have semi\\"
"jest/Component.js should not have semi"
)
console.log(
\\"jest/Component.test.js should have semi\\"
"jest/Component.test.js should have semi"
);
function js() {
console.log(
\\"js/file.js should have tab width 8 (1 if CLI)\\"
"js/file.js should have tab width 8 (1 if CLI)"
);
}
\\"use strict\\";
"use strict";
module.exports =
{
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
"no-config/file.js should have no semicolons"
)
}
function packageJs() {
console.log(
\\"package/file.js should have tab width 3\\"
"package/file.js should have tab width 3"
);
}
function rcJson() {
@@ -99,7 +99,7 @@ exports[`accepts configuration from --config (stderr) 1`] = `""`;
exports[`accepts configuration from --config (stdout) 1`] = `
"function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\")
console.log("js/file.js should have tab width 8 (1 if CLI)")
}
"
`;
@@ -107,7 +107,7 @@ exports[`accepts configuration from --config (stdout) 1`] = `
exports[`accepts configuration from --config (write) 1`] = `Array []`;
exports[`prints error message when no file found with --find-config-path (stderr) 1`] = `
"[error] Can not find configure file for \\"..\\"
"[error] Can not find configure file for ".."
"
`;
@@ -126,38 +126,38 @@ exports[`resolves configuration from external files (stderr) 1`] = `""`;
exports[`resolves configuration from external files (stdout) 1`] = `
"function f() {
console.log(\\"should have tab width 8\\")
console.log("should have tab width 8")
}
function f() {
console.log(\\"should have space width 2\\")
console.log("should have space width 2")
}
function f() {
console.log(\\"should have space width 8\\")
console.log("should have space width 8")
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present"
)
}
console.log(\\"should have no semi\\")
console.log(\\"jest/__best-tests__/.file.js should have semi\\");
console.log(\\"jest/__best-tests__/file.js should have semi\\");
console.log(\\"jest/Component.js should not have semi\\")
console.log(\\"jest/Component.test.js should have semi\\");
console.log("should have no semi")
console.log("jest/__best-tests__/.file.js should have semi");
console.log("jest/__best-tests__/file.js should have semi");
console.log("jest/Component.js should not have semi")
console.log("jest/Component.test.js should have semi");
function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\");
console.log("js/file.js should have tab width 8 (1 if CLI)");
}
\\"use strict\\";
"use strict";
module.exports = {
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
function noConfigJs() {
console.log(\\"no-config/file.js should have no semicolons\\")
console.log("no-config/file.js should have no semicolons")
}
function packageJs() {
console.log(\\"package/file.js should have tab width 3\\");
console.log("package/file.js should have tab width 3");
}
function rcJson() {
console.log.apply(null, [
@@ -190,12 +190,12 @@ exports[`resolves configuration from external files and overrides by extname (st
exports[`resolves configuration from external files and overrides by extname (stdout) 1`] = `
"function noConfigTs() {
console.log(
\\"no-config/file.ts should have semicolons because it has a .ts extension\\"
"no-config/file.ts should have semicolons because it has a .ts extension"
);
}
function packageTs() {
console.log(
\\"package/file.ts should have tab width 5 because it has .ts extension\\"
"package/file.ts should have tab width 5 because it has .ts extension"
);
}
"
@@ -206,7 +206,7 @@ exports[`resolves configuration from external files and overrides by extname (wr
exports[`resolves external configuration from package.json (stderr) 1`] = `""`;
exports[`resolves external configuration from package.json (stdout) 1`] = `
"console.log(\\"should have no semi\\")
"console.log("should have no semi")
"
`;
@@ -2,17 +2,17 @@
exports[`cursorOffset should not be affected by full-width character (stdout) 1`] = `
"const x = [
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
\\"中文\\",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
"中文",
];
"
`;
@@ -3,11 +3,11 @@
exports[`API prettier.formatDoc 1`] = `
"[
group([
\\"const\\",
\\" \\",
group([group(\\"foo\\"), \\" =\\", group(indent([line, '\\"bar\\"']))]),
"const",
" ",
group([group("foo"), " =", group(indent([line, '"bar"']))]),
indent([]),
\\";\\",
";",
]),
hardline,
]"
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`prints information for debugging AST --debug-print-ast (stdout) 1`] = `"{\\"type\\":\\"File\\",\\"start\\":0,\\"end\\":18,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":0,\\"index\\":0},\\"end\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18}},\\"range\\":[0,18],\\"errors\\":[],\\"program\\":{\\"type\\":\\"Program\\",\\"start\\":0,\\"end\\":18,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":0,\\"index\\":0},\\"end\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18}},\\"range\\":[0,18],\\"sourceType\\":\\"module\\",\\"interpreter\\":null,\\"body\\":[{\\"type\\":\\"VariableDeclaration\\",\\"start\\":0,\\"end\\":18,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":0,\\"index\\":0},\\"end\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18}},\\"range\\":[0,18],\\"declarations\\":[{\\"type\\":\\"VariableDeclarator\\",\\"start\\":6,\\"end\\":17,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":6,\\"index\\":6},\\"end\\":{\\"line\\":1,\\"column\\":17,\\"index\\":17}},\\"range\\":[6,17],\\"id\\":{\\"type\\":\\"Identifier\\",\\"start\\":6,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":6,\\"index\\":6},\\"end\\":{\\"line\\":1,\\"column\\":9,\\"index\\":9},\\"identifierName\\":\\"foo\\"},\\"range\\":[6,9],\\"name\\":\\"foo\\"},\\"init\\":{\\"type\\":\\"StringLiteral\\",\\"start\\":12,\\"end\\":17,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":12,\\"index\\":12},\\"end\\":{\\"line\\":1,\\"column\\":17,\\"index\\":17}},\\"range\\":[12,17],\\"extra\\":{\\"rawValue\\":\\"foo\\",\\"raw\\":\\"'foo'\\"},\\"value\\":\\"foo\\"}}],\\"kind\\":\\"const\\"}],\\"directives\\":[]},\\"comments\\":[],\\"tokens\\":[{\\"type\\":{\\"label\\":\\"const\\",\\"keyword\\":\\"const\\",\\"beforeExpr\\":false,\\"startsExpr\\":false,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":false,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"value\\":\\"const\\",\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":0,\\"index\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"index\\":5}}},{\\"type\\":{\\"label\\":\\"name\\",\\"beforeExpr\\":false,\\"startsExpr\\":true,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":false,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"value\\":\\"foo\\",\\"start\\":6,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":6,\\"index\\":6},\\"end\\":{\\"line\\":1,\\"column\\":9,\\"index\\":9}}},{\\"type\\":{\\"label\\":\\"=\\",\\"beforeExpr\\":true,\\"startsExpr\\":false,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":true,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"value\\":\\"=\\",\\"start\\":10,\\"end\\":11,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":10,\\"index\\":10},\\"end\\":{\\"line\\":1,\\"column\\":11,\\"index\\":11}}},{\\"type\\":{\\"label\\":\\"string\\",\\"beforeExpr\\":false,\\"startsExpr\\":true,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":false,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"value\\":\\"foo\\",\\"start\\":12,\\"end\\":17,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":12,\\"index\\":12},\\"end\\":{\\"line\\":1,\\"column\\":17,\\"index\\":17}}},{\\"type\\":{\\"label\\":\\";\\",\\"beforeExpr\\":true,\\"startsExpr\\":false,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":false,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"start\\":17,\\"end\\":18,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":17,\\"index\\":17},\\"end\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18}}},{\\"type\\":{\\"label\\":\\"eof\\",\\"beforeExpr\\":false,\\"startsExpr\\":false,\\"rightAssociative\\":false,\\"isLoop\\":false,\\"isAssign\\":false,\\"prefix\\":false,\\"postfix\\":false,\\"binop\\":null,\\"updateContext\\":null},\\"start\\":18,\\"end\\":18,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18},\\"end\\":{\\"line\\":1,\\"column\\":18,\\"index\\":18}}}]}"`;
exports[`prints information for debugging AST --debug-print-ast (stdout) 1`] = `"{"type":"File","start":0,"end":18,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":18,"index":18}},"range":[0,18],"errors":[],"program":{"type":"Program","start":0,"end":18,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":18,"index":18}},"range":[0,18],"sourceType":"module","interpreter":null,"body":[{"type":"VariableDeclaration","start":0,"end":18,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":18,"index":18}},"range":[0,18],"declarations":[{"type":"VariableDeclarator","start":6,"end":17,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":17,"index":17}},"range":[6,17],"id":{"type":"Identifier","start":6,"end":9,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":9,"index":9},"identifierName":"foo"},"range":[6,9],"name":"foo"},"init":{"type":"StringLiteral","start":12,"end":17,"loc":{"start":{"line":1,"column":12,"index":12},"end":{"line":1,"column":17,"index":17}},"range":[12,17],"extra":{"rawValue":"foo","raw":"'foo'"},"value":"foo"}}],"kind":"const"}],"directives":[]},"comments":[],"tokens":[{"type":{"label":"const","keyword":"const","beforeExpr":false,"startsExpr":false,"rightAssociative":false,"isLoop":false,"isAssign":false,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"value":"const","start":0,"end":5,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":5,"index":5}}},{"type":{"label":"name","beforeExpr":false,"startsExpr":true,"rightAssociative":false,"isLoop":false,"isAssign":false,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"value":"foo","start":6,"end":9,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":9,"index":9}}},{"type":{"label":"=","beforeExpr":true,"startsExpr":false,"rightAssociative":false,"isLoop":false,"isAssign":true,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"value":"=","start":10,"end":11,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":11,"index":11}}},{"type":{"label":"string","beforeExpr":false,"startsExpr":true,"rightAssociative":false,"isLoop":false,"isAssign":false,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"value":"foo","start":12,"end":17,"loc":{"start":{"line":1,"column":12,"index":12},"end":{"line":1,"column":17,"index":17}}},{"type":{"label":";","beforeExpr":true,"startsExpr":false,"rightAssociative":false,"isLoop":false,"isAssign":false,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"start":17,"end":18,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":1,"column":18,"index":18}}},{"type":{"label":"eof","beforeExpr":false,"startsExpr":false,"rightAssociative":false,"isLoop":false,"isAssign":false,"prefix":false,"postfix":false,"binop":null,"updateContext":null},"start":18,"end":18,"loc":{"start":{"line":1,"column":18,"index":18},"end":{"line":1,"column":18,"index":18}}}]}"`;
exports[`prints information for debugging AST --debug-print-ast (write) 1`] = `Array []`;
@@ -3,46 +3,46 @@
exports[`prints information for debugging comment attachment with --debug-print-comments (stdout) 1`] = `
"[
{
\\"type\\": \\"CommentBlock\\",
\\"value\\": \\" 1 \\",
\\"start\\": 0,
\\"end\\": 7,
\\"loc\\": {
\\"start\\": { \\"line\\": 1, \\"column\\": 0, \\"index\\": 0 },
\\"end\\": { \\"line\\": 1, \\"column\\": 7, \\"index\\": 7 }
"type": "CommentBlock",
"value": " 1 ",
"start": 0,
"end": 7,
"loc": {
"start": { "line": 1, "column": 0, "index": 0 },
"end": { "line": 1, "column": 7, "index": 7 }
},
\\"placement\\": \\"endOfLine\\",
\\"leading\\": true,
\\"trailing\\": false,
\\"nodeDescription\\": \\"ExpressionStatement\\"
"placement": "endOfLine",
"leading": true,
"trailing": false,
"nodeDescription": "ExpressionStatement"
},
{
\\"type\\": \\"CommentBlock\\",
\\"value\\": \\" 2 \\",
\\"start\\": 24,
\\"end\\": 31,
\\"loc\\": {
\\"start\\": { \\"line\\": 2, \\"column\\": 16, \\"index\\": 24 },
\\"end\\": { \\"line\\": 2, \\"column\\": 23, \\"index\\": 31 }
"type": "CommentBlock",
"value": " 2 ",
"start": 24,
"end": 31,
"loc": {
"start": { "line": 2, "column": 16, "index": 24 },
"end": { "line": 2, "column": 23, "index": 31 }
},
\\"placement\\": \\"remaining\\",
\\"leading\\": false,
\\"trailing\\": true,
\\"nodeDescription\\": \\"Identifier foo\\"
"placement": "remaining",
"leading": false,
"trailing": true,
"nodeDescription": "Identifier foo"
},
{
\\"type\\": \\"CommentLine\\",
\\"value\\": \\" 3\\",
\\"start\\": 34,
\\"end\\": 38,
\\"loc\\": {
\\"start\\": { \\"line\\": 2, \\"column\\": 26, \\"index\\": 34 },
\\"end\\": { \\"line\\": 2, \\"column\\": 30, \\"index\\": 38 }
"type": "CommentLine",
"value": " 3",
"start": 34,
"end": 38,
"loc": {
"start": { "line": 2, "column": 26, "index": 34 },
"end": { "line": 2, "column": 30, "index": 38 }
},
\\"placement\\": \\"remaining\\",
\\"leading\\": false,
\\"trailing\\": true,
\\"nodeDescription\\": \\"ExpressionStatement\\"
"placement": "remaining",
"leading": false,
"trailing": true,
"nodeDescription": "ExpressionStatement"
}
]
"
@@ -172,7 +172,7 @@ exports[`show version with --version (stderr) 1`] = `""`;
exports[`show version with --version (write) 1`] = `Array []`;
exports[`show warning with --help not-found (typo) (stderr) 1`] = `
"[warn] Unknown flag \\"parserr\\", did you mean \\"parser\\"?
"[warn] Unknown flag "parserr", did you mean "parser"?
"
`;
@@ -365,7 +365,7 @@ exports[`throw error with --find-config-path + multiple files (stdout) 1`] = `""
exports[`throw error with --find-config-path + multiple files (write) 1`] = `Array []`;
exports[`throw error with --help not-found (stderr) 1`] = `
"[error] Invalid --help value. Expected a flag, but received \\"not-found\\".
"[error] Invalid --help value. Expected a flag, but received "not-found".
"
`;
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`error on unmatched pattern (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"**/*.toml\\".
"[error] No files matching the pattern were found: "**/*.toml".
"
`;
@@ -10,14 +10,14 @@ exports[`error on unmatched pattern (stdout) 1`] = `""`;
exports[`error on unmatched pattern (write) 1`] = `Array []`;
exports[`error on unmatched pattern when 2nd glob has no match (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"**/*.toml\\".
"[error] No files matching the pattern were found: "**/*.toml".
"
`;
exports[`error on unmatched pattern when 2nd glob has no match (stdout) 1`] = `
"const hello = \\"there\\";
"const hello = "there";
{
\\"hello\\": \\"there\\"
"hello": "there"
}
hello: there
"
@@ -28,7 +28,7 @@ exports[`error on unmatched pattern when 2nd glob has no match (write) 1`] = `Ar
exports[`no error on unmatched pattern (stderr) 1`] = `""`;
exports[`no error on unmatched pattern (stdout) 1`] = `
"const hello = \\"there\\";
"const hello = "there";
"
`;
@@ -37,9 +37,9 @@ exports[`no error on unmatched pattern (write) 1`] = `Array []`;
exports[`no error on unmatched pattern when 2nd glob has no match (stderr) 1`] = `""`;
exports[`no error on unmatched pattern when 2nd glob has no match (stdout) 1`] = `
"const hello = \\"there\\";
"const hello = "there";
{
\\"hello\\": \\"there\\"
"hello": "there"
}
hello: there
"
@@ -3,7 +3,7 @@
exports[`extracts file-info for a file in not_node_modules (stderr) 1`] = `""`;
exports[`extracts file-info for a file in not_node_modules (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -13,7 +13,7 @@ exports[`extracts file-info for a file in not_node_modules (write) 1`] = `Array
exports[`extracts file-info for a js file (stderr) 1`] = `""`;
exports[`extracts file-info for a js file (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -23,7 +23,7 @@ exports[`extracts file-info for a js file (write) 1`] = `Array []`;
exports[`extracts file-info for a known markdown file with no extension (stderr) 1`] = `""`;
exports[`extracts file-info for a known markdown file with no extension (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"markdown\\" }
"{ "ignored": false, "inferredParser": "markdown" }
"
`;
@@ -33,7 +33,7 @@ exports[`extracts file-info for a known markdown file with no extension (write)
exports[`extracts file-info for a markdown file (stderr) 1`] = `""`;
exports[`extracts file-info for a markdown file (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"markdown\\" }
"{ "ignored": false, "inferredParser": "markdown" }
"
`;
@@ -43,7 +43,7 @@ exports[`extracts file-info for a markdown file (write) 1`] = `Array []`;
exports[`extracts file-info with ignored=false for a file in node_modules when --with-node-modules provided (stderr) 1`] = `""`;
exports[`extracts file-info with ignored=false for a file in node_modules when --with-node-modules provided (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -53,7 +53,7 @@ exports[`extracts file-info with ignored=false for a file in node_modules when -
exports[`extracts file-info with ignored=true for a file in .prettierignore (stderr) 1`] = `""`;
exports[`extracts file-info with ignored=true for a file in .prettierignore (stdout) 1`] = `
"{ \\"ignored\\": true, \\"inferredParser\\": null }
"{ "ignored": true, "inferredParser": null }
"
`;
@@ -63,7 +63,7 @@ exports[`extracts file-info with ignored=true for a file in .prettierignore (wri
exports[`extracts file-info with ignored=true for a file in a hand-picked .prettierignore (stderr) 1`] = `""`;
exports[`extracts file-info with ignored=true for a file in a hand-picked .prettierignore (stdout) 1`] = `
"{ \\"ignored\\": true, \\"inferredParser\\": null }
"{ "ignored": true, "inferredParser": null }
"
`;
@@ -73,7 +73,7 @@ exports[`extracts file-info with ignored=true for a file in a hand-picked .prett
exports[`extracts file-info with inferredParser=foo when a plugin is hand-picked (stderr) 1`] = `""`;
exports[`extracts file-info with inferredParser=foo when a plugin is hand-picked (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"foo\\" }
"{ "ignored": false, "inferredParser": "foo" }
"
`;
@@ -83,7 +83,7 @@ exports[`extracts file-info with inferredParser=foo when a plugin is hand-picked
exports[`extracts file-info with inferredParser=foo when plugins are autoloaded (stderr) 1`] = `""`;
exports[`extracts file-info with inferredParser=foo when plugins are autoloaded (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"foo\\" }
"{ "ignored": false, "inferredParser": "foo" }
"
`;
@@ -93,7 +93,7 @@ exports[`extracts file-info with inferredParser=foo when plugins are autoloaded
exports[`extracts file-info with inferredParser=foo when plugins are loaded with --plugin-search-dir (stderr) 1`] = `""`;
exports[`extracts file-info with inferredParser=foo when plugins are loaded with --plugin-search-dir (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"foo\\" }
"{ "ignored": false, "inferredParser": "foo" }
"
`;
@@ -103,7 +103,7 @@ exports[`extracts file-info with inferredParser=foo when plugins are loaded with
exports[`extracts file-info with inferredParser=null for file.foo (stderr) 1`] = `""`;
exports[`extracts file-info with inferredParser=null for file.foo (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": null }
"{ "ignored": false, "inferredParser": null }
"
`;
@@ -113,7 +113,7 @@ exports[`extracts file-info with inferredParser=null for file.foo (write) 1`] =
exports[`extracts file-info with with ignored=true for a file in node_modules (stderr) 1`] = `""`;
exports[`extracts file-info with with ignored=true for a file in node_modules (stdout) 1`] = `
"{ \\"ignored\\": true, \\"inferredParser\\": null }
"{ "ignored": true, "inferredParser": null }
"
`;
@@ -121,7 +121,7 @@ exports[`extracts file-info with with ignored=true for a file in node_modules (s
exports[`extracts file-info with with ignored=true for a file in node_modules (write) 1`] = `Array []`;
exports[`file-info should not try resolve config with --no-config (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -129,7 +129,7 @@ exports[`file-info should not try resolve config with --no-config (stdout) 1`] =
exports[`file-info should try resolve config (stderr) 1`] = `""`;
exports[`file-info should try resolve config (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"override-js-parser\\" }
"{ "ignored": false, "inferredParser": "override-js-parser" }
"
`;
@@ -139,7 +139,7 @@ exports[`file-info should try resolve config (write) 1`] = `Array []`;
exports[`non-exists ignore path (stderr) 1`] = `""`;
exports[`non-exists ignore path (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -11,11 +11,11 @@ exports[`formatAST Shorthand specifier 2 1`] = `
`;
exports[`formatAST Shorthand specifier 3 1`] = `
"export { \\"specifier\\" as specifier };
"export { "specifier" as specifier };
"
`;
exports[`formatAST Shorthand specifier 4 1`] = `
"export { \\"specifier\\" as \\"specifier\\" };
"export { "specifier" as "specifier" };
"
`;
@@ -7,9 +7,9 @@ exports[`'Adjacent JSX' error should not be swallowed by Babel's error recovery
| ^"
`;
exports[`html parser should handle CRLF correctly 1`] = `"\\"<!--\\\\r\\\\n test\\\\r\\\\n test\\\\r\\\\n-->\\\\r\\\\n\\""`;
exports[`html parser should handle CRLF correctly 1`] = `""<!--\\r\\n test\\r\\n test\\r\\n-->\\r\\n""`;
exports[`markdown parser should handle CRLF correctly 1`] = `"\\"\`\`\`\\\\r\\\\n\\\\r\\\\n\\\\r\\\\n\`\`\`\\\\r\\\\n\\""`;
exports[`markdown parser should handle CRLF correctly 1`] = `""\`\`\`\\r\\n\\r\\n\\r\\n\`\`\`\\r\\n""`;
exports[`typescript parser should throw the first error when both JSX and non-JSX mode failed 1`] = `
"Expression expected. (8:7)
@@ -19,4 +19,4 @@ exports[`typescript parser should throw the first error when both JSX and non-JS
| ^"
`;
exports[`yaml parser should handle CRLF correctly 1`] = `"\\"a: 123\\\\r\\\\n\\""`;
exports[`yaml parser should handle CRLF correctly 1`] = `""a: 123\\r\\n""`;
@@ -154,9 +154,9 @@ exports[`show detailed usage with --help end-of-line (stdout) 1`] = `
Valid options:
lf Line Feed only (\\\\n), common on Linux and macOS as well as inside git repos
crlf Carriage Return + Line Feed characters (\\\\r\\\\n), common on Windows
cr Carriage Return character only (\\\\r), used very rarely
lf Line Feed only (\\n), common on Linux and macOS as well as inside git repos
crlf Carriage Return + Line Feed characters (\\r\\n), common on Windows
cr Carriage Return character only (\\r), used very rarely
auto Maintain existing
(mixed values within one file are normalised by looking at what's used after the first line)
@@ -7,7 +7,7 @@ exports[`Ignored file (stdout) 1`] = `""`;
exports[`Ignored file (write) 1`] = `Array []`;
exports[`None exist file (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"non-exist-file\\".
"[error] No files matching the pattern were found: "non-exist-file".
"
`;
@@ -16,7 +16,7 @@ exports[`None exist file (stdout) 1`] = `""`;
exports[`None exist file (write) 1`] = `Array []`;
exports[`Not matching pattern (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"*.non-exist-pattern\\".
"[error] No files matching the pattern were found: "*.non-exist-pattern".
"
`;
@@ -61,7 +61,7 @@ exports[`ignore-unknown write (stdout) 1`] = `
exports[`ignore-unknown write (write) 1`] = `
Array [
Object {
"content": "const foo = \\"bar\\";
"content": "const foo = "bar";
",
"filename": "javascript.js",
},
@@ -129,7 +129,7 @@ Array [
`;
exports[`Interpreters (stdout) 1`] = `
"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" }
"{ "ignored": false, "inferredParser": "babel" }
"
`;
@@ -22,7 +22,7 @@ Object {
exports[`TOML throws error on incorrect toml 1`] = `
"TOML Error in example.toml:
Unknown character \\"47\\" at row 1, col 2, pos 1:
Unknown character "47" at row 1, col 2, pos 1:
1> ///ERROR///
^
@@ -15,6 +15,6 @@ Array [
`;
exports[`Should use default level logger to log \`--loglevel\` error (stderr) 1`] = `
"[error] Invalid --loglevel value. Expected \\"debug\\", \\"error\\", \\"log\\", \\"silent\\" or \\"warn\\", but received \\"a-unknown-log-level\\".
"[error] Invalid --loglevel value. Expected "debug", "error", "log", "silent" or "warn", but received "a-unknown-log-level".
"
`;
@@ -29,7 +29,7 @@ dir2/nested2/bn2.js
`;
exports[`1c: prettier dir1 empty (stderr) 1`] = `
"[error] No supported files were found in the directory: \\"empty\\".
"[error] No supported files were found in the directory: "empty".
"
`;
@@ -62,7 +62,7 @@ dir2/node-shebang
`;
exports[`3: prettier nonexistent-dir 'dir2/**/*' (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"nonexistent-dir\\".
"[error] No files matching the pattern were found: "nonexistent-dir".
[error] No parser could be inferred for file: dir2/a2.foo
"
`;
@@ -140,7 +140,7 @@ exports[`Negative patterns 4: prettier '!nonexistent-dir1 !nonexistent-dir2' (st
exports[`Negative patterns 4: prettier '!nonexistent-dir1 !nonexistent-dir2' (stdout) 1`] = `""`;
exports[`Negative patterns with explicit files: prettier dir1/a1.js dir2/a2.js '!dir1/*' (stderr) 1`] = `
"[error] Explicitly specified file was ignored due to negative glob patterns: \\"dir1/a1.js\\".
"[error] Explicitly specified file was ignored due to negative glob patterns: "dir1/a1.js".
"
`;
@@ -62,7 +62,7 @@ regular-module.js
exports[`multiple patterns with ignore nested directories pattern (write) 1`] = `Array []`;
exports[`multiple patterns with non exists pattern (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"non-existent.js\\".
"[error] No files matching the pattern were found: "non-existent.js".
"
`;
@@ -75,8 +75,8 @@ directory/nested-directory/nested-directory-file.js
exports[`multiple patterns with non exists pattern (write) 1`] = `Array []`;
exports[`multiple patterns, throw error and exit with non zero code on non existing files (stderr) 1`] = `
"[error] No files matching the pattern were found: \\"non-existent.js\\".
[error] No files matching the pattern were found: \\"other-non-existent.js\\".
"[error] No files matching the pattern were found: "non-existent.js".
[error] No files matching the pattern were found: "other-non-existent.js".
"
`;
@@ -63,19 +63,19 @@ This option cannot be used with --range-start and --range-end.",
"description": "Which end of line characters to apply.",
"oneOf": Array [
Object {
"description": "Line Feed only (\\\\n), common on Linux and macOS as well as inside git repos",
"description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos",
"enum": Array [
"lf",
],
},
Object {
"description": "Carriage Return + Line Feed characters (\\\\r\\\\n), common on Windows",
"description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows",
"enum": Array [
"crlf",
],
},
Object {
"description": "Carriage Return character only (\\\\r), used very rarely",
"description": "Carriage Return character only (\\r), used very rarely",
"enum": Array [
"cr",
],
@@ -6,14 +6,14 @@ exports[`apply editorconfig for stdin-filepath with a deep path (stderr) 2`] = `
exports[`apply editorconfig for stdin-filepath with a deep path (stdout) 1`] = `
"function f() {
console.log(\\"should be indented with a tab\\")
console.log("should be indented with a tab")
}
"
`;
exports[`apply editorconfig for stdin-filepath with a deep path (stdout) 2`] = `
"function f() {
console.log(\\"should be indented with a tab\\")
console.log("should be indented with a tab")
}
"
`;
@@ -26,7 +26,7 @@ exports[`apply editorconfig for stdin-filepath with nonexistent directory (stder
exports[`apply editorconfig for stdin-filepath with nonexistent directory (stdout) 1`] = `
"function f() {
console.log(\\"should be indented with a tab\\")
console.log("should be indented with a tab")
}
"
`;
@@ -37,7 +37,7 @@ exports[`apply editorconfig for stdin-filepath with nonexistent file (stderr) 1`
exports[`apply editorconfig for stdin-filepath with nonexistent file (stdout) 1`] = `
"function f() {
console.log(\\"should be indented with a tab\\")
console.log("should be indented with a tab")
}
"
`;
@@ -48,7 +48,7 @@ exports[`don’t apply editorconfig outside project for stdin-filepath with none
exports[`don’t apply editorconfig outside project for stdin-filepath with nonexistent directory (stdout) 1`] = `
"function f() {
console.log(\\"should be indented with 2 spaces\\")
console.log("should be indented with 2 spaces")
}
"
`;
File diff suppressed because it is too large. Load diff
@@ -7,7 +7,7 @@ exports[`cosmiconfig Invalid json file 1`] = `
| ^
2 |
Unexpected token \\"a\\" (0x61) in JSON at position 1 while parsing \\"{a':}/n\\"
Unexpected token "a" (0x61) in JSON at position 1 while parsing "{a':}/n"
> 1 | {a':}
| ^
@@ -25,7 +25,7 @@ exports[`CLI overrides are still applied when no config is found with --config-p
exports[`CLI overrides are still applied when no config is found with --config-precedence file-override (stdout) 1`] = `
"function noConfigJs() {
console.log(\\"no-config/file.js should have no semicolons\\")
console.log("no-config/file.js should have no semicolons")
}
"
`;
@@ -37,7 +37,7 @@ exports[`CLI overrides gets applied when no config exists with --config-preceden
exports[`CLI overrides gets applied when no config exists with --config-precedence prefer-file (stdout) 1`] = `
"function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
"no-config/file.js should have no semicolons"
);
}
"
@@ -49,12 +49,12 @@ exports[`CLI overrides gets ignored when config exists with --config-precedence
exports[`CLI overrides gets ignored when config exists with --config-precedence prefer-file (stdout) 1`] = `
"function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\");
console.log("js/file.js should have tab width 8 (1 if CLI)");
}
\\"use strict\\";
"use strict";
module.exports = {
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
"
@@ -66,12 +66,12 @@ exports[`CLI overrides take lower precedence with --config-precedence file-overr
exports[`CLI overrides take lower precedence with --config-precedence file-override (stdout) 1`] = `
"function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\");
console.log("js/file.js should have tab width 8 (1 if CLI)");
}
\\"use strict\\";
"use strict";
module.exports = {
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
"
@@ -84,59 +84,59 @@ exports[`CLI overrides take precedence with --config-precedence cli-override (st
exports[`CLI overrides take precedence with --config-precedence cli-override (stdout) 1`] = `
"function f() {
console.log(
\\"should have tab width 8\\"
"should have tab width 8"
)
}
function f() {
console.log(
\\"should have space width 2\\"
"should have space width 2"
)
}
function f() {
console.log(
\\"should have space width 8\\"
"should have space width 8"
)
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present"
)
}
console.log(
\\"should have no semi\\"
"should have no semi"
)
console.log(
\\"jest/__best-tests__/.file.js should have semi\\"
"jest/__best-tests__/.file.js should have semi"
);
console.log(
\\"jest/__best-tests__/file.js should have semi\\"
"jest/__best-tests__/file.js should have semi"
);
console.log(
\\"jest/Component.js should not have semi\\"
"jest/Component.js should not have semi"
)
console.log(
\\"jest/Component.test.js should have semi\\"
"jest/Component.test.js should have semi"
);
function js() {
console.log(
\\"js/file.js should have tab width 8 (1 if CLI)\\"
"js/file.js should have tab width 8 (1 if CLI)"
);
}
\\"use strict\\";
"use strict";
module.exports =
{
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
"no-config/file.js should have no semicolons"
)
}
function packageJs() {
console.log(
\\"package/file.js should have tab width 3\\"
"package/file.js should have tab width 3"
);
}
function rcJson() {
@@ -179,59 +179,59 @@ exports[`CLI overrides take precedence without --config-precedence (stderr) 1`]
exports[`CLI overrides take precedence without --config-precedence (stdout) 1`] = `
"function f() {
console.log(
\\"should have tab width 8\\"
"should have tab width 8"
)
}
function f() {
console.log(
\\"should have space width 2\\"
"should have space width 2"
)
}
function f() {
console.log(
\\"should have space width 8\\"
"should have space width 8"
)
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present"
)
}
console.log(
\\"should have no semi\\"
"should have no semi"
)
console.log(
\\"jest/__best-tests__/.file.js should have semi\\"
"jest/__best-tests__/.file.js should have semi"
);
console.log(
\\"jest/__best-tests__/file.js should have semi\\"
"jest/__best-tests__/file.js should have semi"
);
console.log(
\\"jest/Component.js should not have semi\\"
"jest/Component.js should not have semi"
)
console.log(
\\"jest/Component.test.js should have semi\\"
"jest/Component.test.js should have semi"
);
function js() {
console.log(
\\"js/file.js should have tab width 8 (1 if CLI)\\"
"js/file.js should have tab width 8 (1 if CLI)"
);
}
\\"use strict\\";
"use strict";
module.exports =
{
endOfLine: \\"auto\\",
endOfLine: "auto",
tabWidth: 8,
};
function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
"no-config/file.js should have no semicolons"
)
}
function packageJs() {
console.log(
\\"package/file.js should have tab width 3\\"
"package/file.js should have tab width 3"
);
}
function rcJson() {
@@ -4,7 +4,7 @@ exports[`infers postcss parser (stderr) 1`] = `""`;
exports[`infers postcss parser (stdout) 1`] = `
"/* JavaScript */
\\"use strict\\";
"use strict";
/* Stylesheet */
* {
outline: none;
@@ -4,7 +4,7 @@ exports[`preserves shebang (stderr) 1`] = `""`;
exports[`preserves shebang (stdout) 1`] = `
"#!/usr/bin/env node
\\"use strict\\";
"use strict";
"
`;
+1 -3
View File
@@ -56,9 +56,7 @@ test("should work with foo plugin instance", () => {
JSON.stringify(
prettier.format(input, { parser: "foo-parser", plugins: [fooPlugin] })
)
).toMatchInlineSnapshot(
'"\\"{\\\\\\"tabWidth\\\\\\":8,\\\\\\"bracketSpacing\\\\\\":false}\\""'
);
).toMatchInlineSnapshot('""{\\"tabWidth\\":8,\\"bracketSpacing\\":false}""');
});
test("'Adjacent JSX' error should not be swallowed by Babel's error recovery", () => {
+3 -3
View File
@@ -1861,9 +1861,9 @@ ansi-escapes@^4.2.1, ansi-escapes@^4.3.1:
type-fest "^0.21.3"
ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
version "3.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
ansi-regex@^4.1.0:
version "4.1.0"