diff --git a/jest.config.js b/jest.config.js index cef136fd3..4916c5915 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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, diff --git a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index c7d338bb5..2e11f5dbf 100644 --- a/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -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 diff --git a/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap index 2c2ef6537..44dad6613 100644 --- a/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/call/invalid/__snapshots__/jsfmt.spec.js.snap @@ -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" `; diff --git a/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap index 2900df233..37af8ce7c 100644 --- a/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap @@ -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 |" diff --git a/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap index 128e914c1..c8cbc76bb 100644 --- a/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorator-auto-accessors/__snapshots__/jsfmt.spec.js.snap @@ -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 | } diff --git a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap index 62aab4d14..913adbb6d 100644 --- a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap @@ -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 { | ^ diff --git a/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap index b73a8ff8c..e975afc7e 100644 --- a/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/do/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap index f4d7d3870..2f14318ed 100644 --- a/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap index 1763a573f..e45c64b19 100644 --- a/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/export-default/escaped/__snapshots__/jsfmt.spec.js.snap @@ -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"; | ^" `; diff --git a/tests/format/js/export-star/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/export-star/__snapshots__/jsfmt.spec.js.snap index 9562c0d9d..c0b2eac46 100644 --- a/tests/format/js/export-star/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/export-star/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap index eeab830d1..711cd20ba 100644 --- a/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/exports/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap index b92499e61..df7c21072 100644 --- a/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap index 26fa4d66e..70b4ed781 100644 --- a/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap index 439ae2c5d..541e7ff44 100644 --- a/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/module-blocks/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap index 084e2f09d..59fca2ebe 100644 --- a/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/module-string-names/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap index b60f0193a..9d80b4ef6 100644 --- a/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap index 4a848e587..066838221 100644 --- a/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/record/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/js/strings/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/strings/__snapshots__/jsfmt.spec.js.snap index 115e2a3c6..dc97633de 100644 --- a/tests/format/js/strings/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/strings/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap index 7c47a75fc..301a291c6 100644 --- a/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap index 4b1c18496..f002c2f49 100644 --- a/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap @@ -2,7 +2,7 @@ exports[`trailing.js [acorn] format 1`] = ` "Unexpected token (1:8) -> 1 | export type Result = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; +> 1 | export type Result = | { 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 = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; +> 1 | export type Result = | { 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 = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; +> 1 | export type Result = | { kind: "not-test-editor1" } | { kind: "not-test-editor2" }; | ^ 2 | 3 | // Note: there are trailing whitespace in this file diff --git a/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap index efda7f5ab..db1946abe 100644 --- a/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/misc/errors/broken-plugin/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/broken-plugin/__snapshots__/jsfmt.spec.js.snap index d305d8102..c192ba24b 100644 --- a/tests/format/misc/errors/broken-plugin/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/broken-plugin/__snapshots__/jsfmt.spec.js.snap @@ -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!"`; diff --git a/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap index c781f4850..763008391 100644 --- a/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap @@ -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 |" `; diff --git a/tests/format/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap index 0e7fd398c..063d84267 100644 --- a/tests/format/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap @@ -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 { diff --git a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap index 4d8238bde..62bb784b9 100644 --- a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap @@ -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) {} | ^" `; diff --git a/tests/format/misc/errors/js/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/__snapshots__/jsfmt.spec.js.snap index e63c49c23..7ab7d242e 100644 --- a/tests/format/misc/errors/js/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/__snapshots__/jsfmt.spec.js.snap @@ -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`] = ` diff --git a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap index 2b8f6bc79..0d7e1c3bb 100644 --- a/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap @@ -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; | ^" `; diff --git a/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap index a12b158fb..3f0e1d752 100644 --- a/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap @@ -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 []); | ^" `; diff --git a/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap index 6bcd3e8b8..7ff9239cd 100644 --- a/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap @@ -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"; | ^" `; diff --git a/tests/format/misc/errors/json/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/json/__snapshots__/jsfmt.spec.js.snap index 128c9cbd2..8976835c9 100644 --- a/tests/format/misc/errors/json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/json/__snapshots__/jsfmt.spec.js.snap @@ -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 | {} | ^" `; diff --git a/tests/format/misc/errors/json/json-stringify/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/json/json-stringify/__snapshots__/jsfmt.spec.js.snap index 2f1c24a06..5d8ae819e 100644 --- a/tests/format/misc/errors/json/json-stringify/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/json/json-stringify/__snapshots__/jsfmt.spec.js.snap @@ -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} | ^^^^^^^^^^^^^" `; diff --git a/tests/format/misc/errors/less/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/less/__snapshots__/jsfmt.spec.js.snap index 20833d225..3e407275f 100644 --- a/tests/format/misc/errors/less/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/less/__snapshots__/jsfmt.spec.js.snap @@ -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 |" diff --git a/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap index 842ce1a00..e5586b5f9 100644 --- a/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap @@ -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 =
{\\"foo\\"}}
; +> 1 | let x3 =
{"foo"}}
; | ^" `; exports[`snippet: #3 [typescript] format 1`] = ` "':' expected. (1:21) -> 1 | let x4 =
{\\"foo\\"}>
; +> 1 | let x4 =
{"foo"}>
; | ^" `; exports[`snippet: #4 [typescript] format 1`] = ` "Expression expected. (1:15) -> 1 | let x5 =
}{\\"foo\\"}
; +> 1 | let x5 =
}{"foo"}
; | ^" `; exports[`snippet: #5 [typescript] format 1`] = ` "Expression expected. (1:15) -> 1 | let x6 =
>{\\"foo\\"}
; +> 1 | let x6 =
>{"foo"}
; | ^" `; diff --git a/tests/format/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap index 6c157b5db..11aef9f65 100644 --- a/tests/format/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap @@ -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 |
2 | | ^" `; exports[`unclosed_tag_in_template.vue [vue] format 1`] = ` -"Unexpected character \\"/\\" (4:2) +"Unexpected character "/" (4:2) 2 |

Templates are formatted as well... 3 | 4 | @@ -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 |

+"Void elements do not have end tags "Input" (8:21) + 6 |
7 | > 8 | {{value}} | ^^^^^^^^ 9 |
10 | - 11 | " + 11 | " `; diff --git a/tests/format/typescript/class/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/class/__snapshots__/jsfmt.spec.js.snap index 4a507d8cc..1c468fe7f 100644 --- a/tests/format/typescript/class/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/class/__snapshots__/jsfmt.spec.js.snap @@ -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 { > 6 | export [Symbol.iterator](): Iterator; diff --git a/tests/format/typescript/compiler/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/compiler/__snapshots__/jsfmt.spec.js.snap index bf313dca1..93d1d0e4d 100644 --- a/tests/format/typescript/compiler/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/compiler/__snapshots__/jsfmt.spec.js.snap @@ -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; | ^ diff --git a/tests/format/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap index 5ff496cbd..e70791f7c 100644 --- a/tests/format/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap @@ -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; diff --git a/tests/format/typescript/keywords/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/keywords/__snapshots__/jsfmt.spec.js.snap index cc2961ef2..e3ee77eac 100644 --- a/tests/format/typescript/keywords/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/keywords/__snapshots__/jsfmt.spec.js.snap @@ -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 { } diff --git a/tests/integration/__tests__/__snapshots__/arg-parsing.js.snap b/tests/integration/__tests__/__snapshots__/arg-parsing.js.snap index f9685bf09..74cd8f0f7 100644 --- a/tests/integration/__tests__/__snapshots__/arg-parsing.js.snap +++ b/tests/integration/__tests__/__snapshots__/arg-parsing.js.snap @@ -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"); " `; diff --git a/tests/integration/__tests__/__snapshots__/config-invalid.js.snap b/tests/integration/__tests__/__snapshots__/config-invalid.js.snap index 27ebc38fc..eb8f9a690 100644 --- a/tests/integration/__tests__/__snapshots__/config-invalid.js.snap +++ b/tests/integration/__tests__/__snapshots__/config-invalid.js.snap @@ -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 \`/tests/integration/cli/config/invalid\`: No loader specified for extension \\".unsupported\\" +"[error] Invalid configuration file \`/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". " `; diff --git a/tests/integration/__tests__/__snapshots__/config-resolution.js.snap b/tests/integration/__tests__/__snapshots__/config-resolution.js.snap index 08d2fb229..bdec0cd3b 100644 --- a/tests/integration/__tests__/__snapshots__/config-resolution.js.snap +++ b/tests/integration/__tests__/__snapshots__/config-resolution.js.snap @@ -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") " `; diff --git a/tests/integration/__tests__/__snapshots__/cursor-offset.js.snap b/tests/integration/__tests__/__snapshots__/cursor-offset.js.snap index ec16c601c..7f36dbfe7 100644 --- a/tests/integration/__tests__/__snapshots__/cursor-offset.js.snap +++ b/tests/integration/__tests__/__snapshots__/cursor-offset.js.snap @@ -2,17 +2,17 @@ exports[`cursorOffset should not be affected by full-width character (stdout) 1`] = ` "const x = [ - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", - \\"中文\\", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", + "中文", ]; " `; diff --git a/tests/integration/__tests__/__snapshots__/debug-api.js.snap b/tests/integration/__tests__/__snapshots__/debug-api.js.snap index 6f66f17ca..8357d3948 100644 --- a/tests/integration/__tests__/__snapshots__/debug-api.js.snap +++ b/tests/integration/__tests__/__snapshots__/debug-api.js.snap @@ -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, ]" diff --git a/tests/integration/__tests__/__snapshots__/debug-print-ast.js.snap b/tests/integration/__tests__/__snapshots__/debug-print-ast.js.snap index 6c4c00f94..6e4781352 100644 --- a/tests/integration/__tests__/__snapshots__/debug-print-ast.js.snap +++ b/tests/integration/__tests__/__snapshots__/debug-print-ast.js.snap @@ -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 []`; diff --git a/tests/integration/__tests__/__snapshots__/debug-print-comments.js.snap b/tests/integration/__tests__/__snapshots__/debug-print-comments.js.snap index 260d1cc9d..fd5ce3845 100644 --- a/tests/integration/__tests__/__snapshots__/debug-print-comments.js.snap +++ b/tests/integration/__tests__/__snapshots__/debug-print-comments.js.snap @@ -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" } ] " diff --git a/tests/integration/__tests__/__snapshots__/early-exit.js.snap b/tests/integration/__tests__/__snapshots__/early-exit.js.snap index 1f88c4859..ba09493f3 100644 --- a/tests/integration/__tests__/__snapshots__/early-exit.js.snap +++ b/tests/integration/__tests__/__snapshots__/early-exit.js.snap @@ -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". " `; diff --git a/tests/integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap b/tests/integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap index ddce6fcc5..3c92dbe64 100644 --- a/tests/integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap +++ b/tests/integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap @@ -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 " diff --git a/tests/integration/__tests__/__snapshots__/file-info.js.snap b/tests/integration/__tests__/__snapshots__/file-info.js.snap index 7a3c7901c..d10bc2c3a 100644 --- a/tests/integration/__tests__/__snapshots__/file-info.js.snap +++ b/tests/integration/__tests__/__snapshots__/file-info.js.snap @@ -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" } " `; diff --git a/tests/integration/__tests__/__snapshots__/format-ast.js.snap b/tests/integration/__tests__/__snapshots__/format-ast.js.snap index 422eaeb0b..e8eb191cf 100644 --- a/tests/integration/__tests__/__snapshots__/format-ast.js.snap +++ b/tests/integration/__tests__/__snapshots__/format-ast.js.snap @@ -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" }; " `; diff --git a/tests/integration/__tests__/__snapshots__/format.js.snap b/tests/integration/__tests__/__snapshots__/format.js.snap index 40cafac78..fc7cb935d 100644 --- a/tests/integration/__tests__/__snapshots__/format.js.snap +++ b/tests/integration/__tests__/__snapshots__/format.js.snap @@ -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\\""`; +exports[`html parser should handle CRLF correctly 1`] = `""\\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""`; diff --git a/tests/integration/__tests__/__snapshots__/help-options.js.snap b/tests/integration/__tests__/__snapshots__/help-options.js.snap index e4821dc24..98fbd7470 100644 --- a/tests/integration/__tests__/__snapshots__/help-options.js.snap +++ b/tests/integration/__tests__/__snapshots__/help-options.js.snap @@ -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) diff --git a/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap b/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap index 7fe86de9f..9f7ab764e 100644 --- a/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap +++ b/tests/integration/__tests__/__snapshots__/ignore-unknown.js.snap @@ -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", }, diff --git a/tests/integration/__tests__/__snapshots__/infer-parser.js.snap b/tests/integration/__tests__/__snapshots__/infer-parser.js.snap index 21c86bbf1..44ca2f3e9 100644 --- a/tests/integration/__tests__/__snapshots__/infer-parser.js.snap +++ b/tests/integration/__tests__/__snapshots__/infer-parser.js.snap @@ -129,7 +129,7 @@ Array [ `; exports[`Interpreters (stdout) 1`] = ` -"{ \\"ignored\\": false, \\"inferredParser\\": \\"babel\\" } +"{ "ignored": false, "inferredParser": "babel" } " `; diff --git a/tests/integration/__tests__/__snapshots__/load-toml.js.snap b/tests/integration/__tests__/__snapshots__/load-toml.js.snap index 8b0ab33d3..75b5b616b 100644 --- a/tests/integration/__tests__/__snapshots__/load-toml.js.snap +++ b/tests/integration/__tests__/__snapshots__/load-toml.js.snap @@ -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/// ^ diff --git a/tests/integration/__tests__/__snapshots__/loglevel.js.snap b/tests/integration/__tests__/__snapshots__/loglevel.js.snap index 8e63b3cd6..f4030895b 100644 --- a/tests/integration/__tests__/__snapshots__/loglevel.js.snap +++ b/tests/integration/__tests__/__snapshots__/loglevel.js.snap @@ -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". " `; diff --git a/tests/integration/__tests__/__snapshots__/patterns-dirs.js.snap b/tests/integration/__tests__/__snapshots__/patterns-dirs.js.snap index 8be8bd58f..c52084b2b 100644 --- a/tests/integration/__tests__/__snapshots__/patterns-dirs.js.snap +++ b/tests/integration/__tests__/__snapshots__/patterns-dirs.js.snap @@ -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". " `; diff --git a/tests/integration/__tests__/__snapshots__/patterns.js.snap b/tests/integration/__tests__/__snapshots__/patterns.js.snap index b8c00ca8f..d2ebdb3c7 100644 --- a/tests/integration/__tests__/__snapshots__/patterns.js.snap +++ b/tests/integration/__tests__/__snapshots__/patterns.js.snap @@ -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". " `; diff --git a/tests/integration/__tests__/__snapshots__/schema.js.snap b/tests/integration/__tests__/__snapshots__/schema.js.snap index d76f18954..d73ae2338 100644 --- a/tests/integration/__tests__/__snapshots__/schema.js.snap +++ b/tests/integration/__tests__/__snapshots__/schema.js.snap @@ -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", ], diff --git a/tests/integration/__tests__/__snapshots__/stdin-filepath.js.snap b/tests/integration/__tests__/__snapshots__/stdin-filepath.js.snap index f27f5e90f..ddb528da5 100644 --- a/tests/integration/__tests__/__snapshots__/stdin-filepath.js.snap +++ b/tests/integration/__tests__/__snapshots__/stdin-filepath.js.snap @@ -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") } " `; diff --git a/tests/integration/__tests__/__snapshots__/support-info.js.snap b/tests/integration/__tests__/__snapshots__/support-info.js.snap index dbf1347b3..934e89e62 100644 --- a/tests/integration/__tests__/__snapshots__/support-info.js.snap +++ b/tests/integration/__tests__/__snapshots__/support-info.js.snap @@ -283,861 +283,861 @@ exports[`CLI --support-info (stderr) 1`] = `""`; exports[`CLI --support-info (stdout) 1`] = ` "{ - \\"languages\\": [ + "languages": [ { - \\"aceMode\\": \\"javascript\\", - \\"aliases\\": [\\"js\\", \\"node\\"], - \\"codemirrorMimeType\\": \\"text/javascript\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"color\\": \\"#f1e05a\\", - \\"extensions\\": [ - \\".js\\", - \\"._js\\", - \\".bones\\", - \\".cjs\\", - \\".es\\", - \\".es6\\", - \\".frag\\", - \\".gs\\", - \\".jake\\", - \\".jsb\\", - \\".jscad\\", - \\".jsfl\\", - \\".jsm\\", - \\".jss\\", - \\".mjs\\", - \\".njs\\", - \\".pac\\", - \\".sjs\\", - \\".ssjs\\", - \\".xsjs\\", - \\".xsjslib\\", - \\".wxs\\" + "aceMode": "javascript", + "aliases": ["js", "node"], + "codemirrorMimeType": "text/javascript", + "codemirrorMode": "javascript", + "color": "#f1e05a", + "extensions": [ + ".js", + "._js", + ".bones", + ".cjs", + ".es", + ".es6", + ".frag", + ".gs", + ".jake", + ".jsb", + ".jscad", + ".jsfl", + ".jsm", + ".jss", + ".mjs", + ".njs", + ".pac", + ".sjs", + ".ssjs", + ".xsjs", + ".xsjslib", + ".wxs" ], - \\"filenames\\": [\\"Jakefile\\"], - \\"interpreters\\": [ - \\"chakra\\", - \\"d8\\", - \\"gjs\\", - \\"js\\", - \\"node\\", - \\"nodejs\\", - \\"qjs\\", - \\"rhino\\", - \\"v8\\", - \\"v8-shell\\", - \\"zx\\" + "filenames": ["Jakefile"], + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell", + "zx" ], - \\"linguistLanguageId\\": 183, - \\"name\\": \\"JavaScript\\", - \\"parsers\\": [ - \\"babel\\", - \\"acorn\\", - \\"espree\\", - \\"meriyah\\", - \\"babel-flow\\", - \\"babel-ts\\", - \\"flow\\", - \\"typescript\\" + "linguistLanguageId": 183, + "name": "JavaScript", + "parsers": [ + "babel", + "acorn", + "espree", + "meriyah", + "babel-flow", + "babel-ts", + "flow", + "typescript" ], - \\"since\\": \\"0.0.0\\", - \\"tmScope\\": \\"source.js\\", - \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"javascript\\", \\"mongo\\"] + "since": "0.0.0", + "tmScope": "source.js", + "type": "programming", + "vscodeLanguageIds": ["javascript", "mongo"] }, { - \\"aceMode\\": \\"javascript\\", - \\"aliases\\": [], - \\"codemirrorMimeType\\": \\"text/javascript\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"color\\": \\"#f1e05a\\", - \\"extensions\\": [\\".js.flow\\"], - \\"filenames\\": [], - \\"interpreters\\": [ - \\"chakra\\", - \\"d8\\", - \\"gjs\\", - \\"js\\", - \\"node\\", - \\"nodejs\\", - \\"qjs\\", - \\"rhino\\", - \\"v8\\", - \\"v8-shell\\" + "aceMode": "javascript", + "aliases": [], + "codemirrorMimeType": "text/javascript", + "codemirrorMode": "javascript", + "color": "#f1e05a", + "extensions": [".js.flow"], + "filenames": [], + "interpreters": [ + "chakra", + "d8", + "gjs", + "js", + "node", + "nodejs", + "qjs", + "rhino", + "v8", + "v8-shell" ], - \\"linguistLanguageId\\": 183, - \\"name\\": \\"Flow\\", - \\"parsers\\": [\\"flow\\", \\"babel-flow\\"], - \\"since\\": \\"0.0.0\\", - \\"tmScope\\": \\"source.js\\", - \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"javascript\\"] + "linguistLanguageId": 183, + "name": "Flow", + "parsers": ["flow", "babel-flow"], + "since": "0.0.0", + "tmScope": "source.js", + "type": "programming", + "vscodeLanguageIds": ["javascript"] }, { - \\"aceMode\\": \\"javascript\\", - \\"codemirrorMimeType\\": \\"text/jsx\\", - \\"codemirrorMode\\": \\"jsx\\", - \\"extensions\\": [\\".jsx\\"], - \\"group\\": \\"JavaScript\\", - \\"linguistLanguageId\\": 183, - \\"name\\": \\"JSX\\", - \\"parsers\\": [ - \\"babel\\", - \\"babel-flow\\", - \\"babel-ts\\", - \\"flow\\", - \\"typescript\\", - \\"espree\\", - \\"meriyah\\" + "aceMode": "javascript", + "codemirrorMimeType": "text/jsx", + "codemirrorMode": "jsx", + "extensions": [".jsx"], + "group": "JavaScript", + "linguistLanguageId": 183, + "name": "JSX", + "parsers": [ + "babel", + "babel-flow", + "babel-ts", + "flow", + "typescript", + "espree", + "meriyah" ], - \\"since\\": \\"0.0.0\\", - \\"tmScope\\": \\"source.js.jsx\\", - \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"javascriptreact\\"] + "since": "0.0.0", + "tmScope": "source.js.jsx", + "type": "programming", + "vscodeLanguageIds": ["javascriptreact"] }, { - \\"aceMode\\": \\"typescript\\", - \\"aliases\\": [\\"ts\\"], - \\"codemirrorMimeType\\": \\"application/typescript\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"color\\": \\"#2b7489\\", - \\"extensions\\": [\\".ts\\", \\".mts\\", \\".cts\\"], - \\"interpreters\\": [\\"deno\\", \\"ts-node\\"], - \\"linguistLanguageId\\": 378, - \\"name\\": \\"TypeScript\\", - \\"parsers\\": [\\"typescript\\", \\"babel-ts\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.ts\\", - \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"typescript\\"] + "aceMode": "typescript", + "aliases": ["ts"], + "codemirrorMimeType": "application/typescript", + "codemirrorMode": "javascript", + "color": "#2b7489", + "extensions": [".ts", ".mts", ".cts"], + "interpreters": ["deno", "ts-node"], + "linguistLanguageId": 378, + "name": "TypeScript", + "parsers": ["typescript", "babel-ts"], + "since": "1.4.0", + "tmScope": "source.ts", + "type": "programming", + "vscodeLanguageIds": ["typescript"] }, { - \\"aceMode\\": \\"javascript\\", - \\"codemirrorMimeType\\": \\"text/jsx\\", - \\"codemirrorMode\\": \\"jsx\\", - \\"extensions\\": [\\".tsx\\"], - \\"group\\": \\"TypeScript\\", - \\"linguistLanguageId\\": 94901924, - \\"name\\": \\"TSX\\", - \\"parsers\\": [\\"typescript\\", \\"babel-ts\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.tsx\\", - \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"typescriptreact\\"] + "aceMode": "javascript", + "codemirrorMimeType": "text/jsx", + "codemirrorMode": "jsx", + "extensions": [".tsx"], + "group": "TypeScript", + "linguistLanguageId": 94901924, + "name": "TSX", + "parsers": ["typescript", "babel-ts"], + "since": "1.4.0", + "tmScope": "source.tsx", + "type": "programming", + "vscodeLanguageIds": ["typescriptreact"] }, { - \\"aceMode\\": \\"json\\", - \\"codemirrorMimeType\\": \\"application/json\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"extensions\\": [\\".importmap\\"], - \\"filenames\\": [\\"package.json\\", \\"package-lock.json\\", \\"composer.json\\"], - \\"linguistLanguageId\\": 174, - \\"name\\": \\"JSON.stringify\\", - \\"parsers\\": [\\"json-stringify\\"], - \\"since\\": \\"1.13.0\\", - \\"tmScope\\": \\"source.json\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"json\\"] + "aceMode": "json", + "codemirrorMimeType": "application/json", + "codemirrorMode": "javascript", + "extensions": [".importmap"], + "filenames": ["package.json", "package-lock.json", "composer.json"], + "linguistLanguageId": 174, + "name": "JSON.stringify", + "parsers": ["json-stringify"], + "since": "1.13.0", + "tmScope": "source.json", + "type": "data", + "vscodeLanguageIds": ["json"] }, { - \\"aceMode\\": \\"json\\", - \\"codemirrorMimeType\\": \\"application/json\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"extensions\\": [ - \\".json\\", - \\".avsc\\", - \\".geojson\\", - \\".gltf\\", - \\".har\\", - \\".ice\\", - \\".JSON-tmLanguage\\", - \\".mcmeta\\", - \\".tfstate\\", - \\".tfstate.backup\\", - \\".topojson\\", - \\".webapp\\", - \\".webmanifest\\", - \\".yy\\", - \\".yyp\\" + "aceMode": "json", + "codemirrorMimeType": "application/json", + "codemirrorMode": "javascript", + "extensions": [ + ".json", + ".avsc", + ".geojson", + ".gltf", + ".har", + ".ice", + ".JSON-tmLanguage", + ".mcmeta", + ".tfstate", + ".tfstate.backup", + ".topojson", + ".webapp", + ".webmanifest", + ".yy", + ".yyp" ], - \\"filenames\\": [ - \\".arcconfig\\", - \\".htmlhintrc\\", - \\".imgbotconfig\\", - \\".tern-config\\", - \\".tern-project\\", - \\".watchmanconfig\\", - \\"Pipfile.lock\\", - \\"composer.lock\\", - \\"mcmod.info\\" + "filenames": [ + ".arcconfig", + ".htmlhintrc", + ".imgbotconfig", + ".tern-config", + ".tern-project", + ".watchmanconfig", + "Pipfile.lock", + "composer.lock", + "mcmod.info" ], - \\"linguistLanguageId\\": 174, - \\"name\\": \\"JSON\\", - \\"parsers\\": [\\"json\\"], - \\"since\\": \\"1.5.0\\", - \\"tmScope\\": \\"source.json\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"json\\"] + "linguistLanguageId": 174, + "name": "JSON", + "parsers": ["json"], + "since": "1.5.0", + "tmScope": "source.json", + "type": "data", + "vscodeLanguageIds": ["json"] }, { - \\"aceMode\\": \\"javascript\\", - \\"aliases\\": [\\"jsonc\\"], - \\"codemirrorMimeType\\": \\"text/javascript\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"extensions\\": [ - \\".jsonc\\", - \\".sublime-build\\", - \\".sublime-commands\\", - \\".sublime-completions\\", - \\".sublime-keymap\\", - \\".sublime-macro\\", - \\".sublime-menu\\", - \\".sublime-mousemap\\", - \\".sublime-project\\", - \\".sublime-settings\\", - \\".sublime-theme\\", - \\".sublime-workspace\\", - \\".sublime_metrics\\", - \\".sublime_session\\" + "aceMode": "javascript", + "aliases": ["jsonc"], + "codemirrorMimeType": "text/javascript", + "codemirrorMode": "javascript", + "extensions": [ + ".jsonc", + ".sublime-build", + ".sublime-commands", + ".sublime-completions", + ".sublime-keymap", + ".sublime-macro", + ".sublime-menu", + ".sublime-mousemap", + ".sublime-project", + ".sublime-settings", + ".sublime-theme", + ".sublime-workspace", + ".sublime_metrics", + ".sublime_session" ], - \\"filenames\\": [ - \\".babelrc\\", - \\".eslintrc.json\\", - \\".jscsrc\\", - \\".jshintrc\\", - \\".jslintrc\\", - \\"api-extractor.json\\", - \\"devcontainer.json\\", - \\"jsconfig.json\\", - \\"language-configuration.json\\", - \\"tsconfig.json\\", - \\"tslint.json\\", - \\".eslintrc\\", - \\".swcrc\\" + "filenames": [ + ".babelrc", + ".eslintrc.json", + ".jscsrc", + ".jshintrc", + ".jslintrc", + "api-extractor.json", + "devcontainer.json", + "jsconfig.json", + "language-configuration.json", + "tsconfig.json", + "tslint.json", + ".eslintrc", + ".swcrc" ], - \\"group\\": \\"JSON\\", - \\"linguistLanguageId\\": 423, - \\"name\\": \\"JSON with Comments\\", - \\"parsers\\": [\\"json\\"], - \\"since\\": \\"1.5.0\\", - \\"tmScope\\": \\"source.js\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"jsonc\\"] + "group": "JSON", + "linguistLanguageId": 423, + "name": "JSON with Comments", + "parsers": ["json"], + "since": "1.5.0", + "tmScope": "source.js", + "type": "data", + "vscodeLanguageIds": ["jsonc"] }, { - \\"aceMode\\": \\"javascript\\", - \\"codemirrorMimeType\\": \\"application/json\\", - \\"codemirrorMode\\": \\"javascript\\", - \\"extensions\\": [\\".json5\\"], - \\"linguistLanguageId\\": 175, - \\"name\\": \\"JSON5\\", - \\"parsers\\": [\\"json5\\"], - \\"since\\": \\"1.13.0\\", - \\"tmScope\\": \\"source.js\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"json5\\"] + "aceMode": "javascript", + "codemirrorMimeType": "application/json", + "codemirrorMode": "javascript", + "extensions": [".json5"], + "linguistLanguageId": 175, + "name": "JSON5", + "parsers": ["json5"], + "since": "1.13.0", + "tmScope": "source.js", + "type": "data", + "vscodeLanguageIds": ["json5"] }, { - \\"aceMode\\": \\"css\\", - \\"codemirrorMimeType\\": \\"text/css\\", - \\"codemirrorMode\\": \\"css\\", - \\"color\\": \\"#563d7c\\", - \\"extensions\\": [\\".css\\", \\".wxss\\"], - \\"linguistLanguageId\\": 50, - \\"name\\": \\"CSS\\", - \\"parsers\\": [\\"css\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.css\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"css\\"] + "aceMode": "css", + "codemirrorMimeType": "text/css", + "codemirrorMode": "css", + "color": "#563d7c", + "extensions": [".css", ".wxss"], + "linguistLanguageId": 50, + "name": "CSS", + "parsers": ["css"], + "since": "1.4.0", + "tmScope": "source.css", + "type": "markup", + "vscodeLanguageIds": ["css"] }, { - \\"aceMode\\": \\"text\\", - \\"extensions\\": [\\".pcss\\", \\".postcss\\"], - \\"group\\": \\"CSS\\", - \\"linguistLanguageId\\": 262764437, - \\"name\\": \\"PostCSS\\", - \\"parsers\\": [\\"css\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.postcss\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"postcss\\"] + "aceMode": "text", + "extensions": [".pcss", ".postcss"], + "group": "CSS", + "linguistLanguageId": 262764437, + "name": "PostCSS", + "parsers": ["css"], + "since": "1.4.0", + "tmScope": "source.postcss", + "type": "markup", + "vscodeLanguageIds": ["postcss"] }, { - \\"aceMode\\": \\"less\\", - \\"codemirrorMimeType\\": \\"text/css\\", - \\"codemirrorMode\\": \\"css\\", - \\"color\\": \\"#1d365d\\", - \\"extensions\\": [\\".less\\"], - \\"linguistLanguageId\\": 198, - \\"name\\": \\"Less\\", - \\"parsers\\": [\\"less\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.css.less\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"less\\"] + "aceMode": "less", + "codemirrorMimeType": "text/css", + "codemirrorMode": "css", + "color": "#1d365d", + "extensions": [".less"], + "linguistLanguageId": 198, + "name": "Less", + "parsers": ["less"], + "since": "1.4.0", + "tmScope": "source.css.less", + "type": "markup", + "vscodeLanguageIds": ["less"] }, { - \\"aceMode\\": \\"scss\\", - \\"codemirrorMimeType\\": \\"text/x-scss\\", - \\"codemirrorMode\\": \\"css\\", - \\"color\\": \\"#c6538c\\", - \\"extensions\\": [\\".scss\\"], - \\"linguistLanguageId\\": 329, - \\"name\\": \\"SCSS\\", - \\"parsers\\": [\\"scss\\"], - \\"since\\": \\"1.4.0\\", - \\"tmScope\\": \\"source.css.scss\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"scss\\"] + "aceMode": "scss", + "codemirrorMimeType": "text/x-scss", + "codemirrorMode": "css", + "color": "#c6538c", + "extensions": [".scss"], + "linguistLanguageId": 329, + "name": "SCSS", + "parsers": ["scss"], + "since": "1.4.0", + "tmScope": "source.css.scss", + "type": "markup", + "vscodeLanguageIds": ["scss"] }, { - \\"aceMode\\": \\"handlebars\\", - \\"aliases\\": [\\"hbs\\", \\"htmlbars\\"], - \\"color\\": \\"#f7931e\\", - \\"extensions\\": [\\".handlebars\\", \\".hbs\\"], - \\"linguistLanguageId\\": 155, - \\"name\\": \\"Handlebars\\", - \\"parsers\\": [\\"glimmer\\"], - \\"since\\": \\"2.3.0\\", - \\"tmScope\\": \\"text.html.handlebars\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"handlebars\\"] + "aceMode": "handlebars", + "aliases": ["hbs", "htmlbars"], + "color": "#f7931e", + "extensions": [".handlebars", ".hbs"], + "linguistLanguageId": 155, + "name": "Handlebars", + "parsers": ["glimmer"], + "since": "2.3.0", + "tmScope": "text.html.handlebars", + "type": "markup", + "vscodeLanguageIds": ["handlebars"] }, { - \\"aceMode\\": \\"text\\", - \\"color\\": \\"#e10098\\", - \\"extensions\\": [\\".graphql\\", \\".gql\\", \\".graphqls\\"], - \\"linguistLanguageId\\": 139, - \\"name\\": \\"GraphQL\\", - \\"parsers\\": [\\"graphql\\"], - \\"since\\": \\"1.5.0\\", - \\"tmScope\\": \\"source.graphql\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"graphql\\"] + "aceMode": "text", + "color": "#e10098", + "extensions": [".graphql", ".gql", ".graphqls"], + "linguistLanguageId": 139, + "name": "GraphQL", + "parsers": ["graphql"], + "since": "1.5.0", + "tmScope": "source.graphql", + "type": "data", + "vscodeLanguageIds": ["graphql"] }, { - \\"aceMode\\": \\"markdown\\", - \\"aliases\\": [\\"pandoc\\"], - \\"codemirrorMimeType\\": \\"text/x-gfm\\", - \\"codemirrorMode\\": \\"gfm\\", - \\"color\\": \\"#083fa1\\", - \\"extensions\\": [ - \\".md\\", - \\".markdown\\", - \\".mdown\\", - \\".mdwn\\", - \\".mkd\\", - \\".mkdn\\", - \\".mkdown\\", - \\".ronn\\", - \\".scd\\", - \\".workbook\\" + "aceMode": "markdown", + "aliases": ["pandoc"], + "codemirrorMimeType": "text/x-gfm", + "codemirrorMode": "gfm", + "color": "#083fa1", + "extensions": [ + ".md", + ".markdown", + ".mdown", + ".mdwn", + ".mkd", + ".mkdn", + ".mkdown", + ".ronn", + ".scd", + ".workbook" ], - \\"filenames\\": [\\"contents.lr\\", \\"README\\"], - \\"linguistLanguageId\\": 222, - \\"name\\": \\"Markdown\\", - \\"parsers\\": [\\"markdown\\"], - \\"since\\": \\"1.8.0\\", - \\"tmScope\\": \\"source.gfm\\", - \\"type\\": \\"prose\\", - \\"vscodeLanguageIds\\": [\\"markdown\\"], - \\"wrap\\": true + "filenames": ["contents.lr", "README"], + "linguistLanguageId": 222, + "name": "Markdown", + "parsers": ["markdown"], + "since": "1.8.0", + "tmScope": "source.gfm", + "type": "prose", + "vscodeLanguageIds": ["markdown"], + "wrap": true }, { - \\"aceMode\\": \\"markdown\\", - \\"aliases\\": [\\"pandoc\\"], - \\"codemirrorMimeType\\": \\"text/x-gfm\\", - \\"codemirrorMode\\": \\"gfm\\", - \\"color\\": \\"#083fa1\\", - \\"extensions\\": [\\".mdx\\"], - \\"filenames\\": [], - \\"linguistLanguageId\\": 222, - \\"name\\": \\"MDX\\", - \\"parsers\\": [\\"mdx\\"], - \\"since\\": \\"1.15.0\\", - \\"tmScope\\": \\"source.gfm\\", - \\"type\\": \\"prose\\", - \\"vscodeLanguageIds\\": [\\"mdx\\"], - \\"wrap\\": true + "aceMode": "markdown", + "aliases": ["pandoc"], + "codemirrorMimeType": "text/x-gfm", + "codemirrorMode": "gfm", + "color": "#083fa1", + "extensions": [".mdx"], + "filenames": [], + "linguistLanguageId": 222, + "name": "MDX", + "parsers": ["mdx"], + "since": "1.15.0", + "tmScope": "source.gfm", + "type": "prose", + "vscodeLanguageIds": ["mdx"], + "wrap": true }, { - \\"aceMode\\": \\"html\\", - \\"aliases\\": [\\"xhtml\\"], - \\"codemirrorMimeType\\": \\"text/html\\", - \\"codemirrorMode\\": \\"htmlmixed\\", - \\"color\\": \\"#e34c26\\", - \\"extensions\\": [\\".component.html\\"], - \\"filenames\\": [], - \\"linguistLanguageId\\": 146, - \\"name\\": \\"Angular\\", - \\"parsers\\": [\\"angular\\"], - \\"since\\": \\"1.15.0\\", - \\"tmScope\\": \\"text.html.basic\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"html\\"] + "aceMode": "html", + "aliases": ["xhtml"], + "codemirrorMimeType": "text/html", + "codemirrorMode": "htmlmixed", + "color": "#e34c26", + "extensions": [".component.html"], + "filenames": [], + "linguistLanguageId": 146, + "name": "Angular", + "parsers": ["angular"], + "since": "1.15.0", + "tmScope": "text.html.basic", + "type": "markup", + "vscodeLanguageIds": ["html"] }, { - \\"aceMode\\": \\"html\\", - \\"aliases\\": [\\"xhtml\\"], - \\"codemirrorMimeType\\": \\"text/html\\", - \\"codemirrorMode\\": \\"htmlmixed\\", - \\"color\\": \\"#e34c26\\", - \\"extensions\\": [ - \\".html\\", - \\".htm\\", - \\".html.hl\\", - \\".inc\\", - \\".xht\\", - \\".xhtml\\", - \\".mjml\\" + "aceMode": "html", + "aliases": ["xhtml"], + "codemirrorMimeType": "text/html", + "codemirrorMode": "htmlmixed", + "color": "#e34c26", + "extensions": [ + ".html", + ".htm", + ".html.hl", + ".inc", + ".xht", + ".xhtml", + ".mjml" ], - \\"linguistLanguageId\\": 146, - \\"name\\": \\"HTML\\", - \\"parsers\\": [\\"html\\"], - \\"since\\": \\"1.15.0\\", - \\"tmScope\\": \\"text.html.basic\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"html\\"] + "linguistLanguageId": 146, + "name": "HTML", + "parsers": ["html"], + "since": "1.15.0", + "tmScope": "text.html.basic", + "type": "markup", + "vscodeLanguageIds": ["html"] }, { - \\"aceMode\\": \\"html\\", - \\"aliases\\": [\\"xhtml\\"], - \\"codemirrorMimeType\\": \\"text/html\\", - \\"codemirrorMode\\": \\"htmlmixed\\", - \\"color\\": \\"#e34c26\\", - \\"extensions\\": [], - \\"filenames\\": [], - \\"linguistLanguageId\\": 146, - \\"name\\": \\"Lightning Web Components\\", - \\"parsers\\": [\\"lwc\\"], - \\"since\\": \\"1.17.0\\", - \\"tmScope\\": \\"text.html.basic\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"html\\"] + "aceMode": "html", + "aliases": ["xhtml"], + "codemirrorMimeType": "text/html", + "codemirrorMode": "htmlmixed", + "color": "#e34c26", + "extensions": [], + "filenames": [], + "linguistLanguageId": 146, + "name": "Lightning Web Components", + "parsers": ["lwc"], + "since": "1.17.0", + "tmScope": "text.html.basic", + "type": "markup", + "vscodeLanguageIds": ["html"] }, { - \\"aceMode\\": \\"html\\", - \\"color\\": \\"#41b883\\", - \\"extensions\\": [\\".vue\\"], - \\"linguistLanguageId\\": 391, - \\"name\\": \\"Vue\\", - \\"parsers\\": [\\"vue\\"], - \\"since\\": \\"1.10.0\\", - \\"tmScope\\": \\"text.html.vue\\", - \\"type\\": \\"markup\\", - \\"vscodeLanguageIds\\": [\\"vue\\"] + "aceMode": "html", + "color": "#41b883", + "extensions": [".vue"], + "linguistLanguageId": 391, + "name": "Vue", + "parsers": ["vue"], + "since": "1.10.0", + "tmScope": "text.html.vue", + "type": "markup", + "vscodeLanguageIds": ["vue"] }, { - \\"aceMode\\": \\"yaml\\", - \\"aliases\\": [\\"yml\\"], - \\"codemirrorMimeType\\": \\"text/x-yaml\\", - \\"codemirrorMode\\": \\"yaml\\", - \\"color\\": \\"#cb171e\\", - \\"extensions\\": [ - \\".yml\\", - \\".mir\\", - \\".reek\\", - \\".rviz\\", - \\".sublime-syntax\\", - \\".syntax\\", - \\".yaml\\", - \\".yaml-tmlanguage\\", - \\".yaml.sed\\", - \\".yml.mysql\\" + "aceMode": "yaml", + "aliases": ["yml"], + "codemirrorMimeType": "text/x-yaml", + "codemirrorMode": "yaml", + "color": "#cb171e", + "extensions": [ + ".yml", + ".mir", + ".reek", + ".rviz", + ".sublime-syntax", + ".syntax", + ".yaml", + ".yaml-tmlanguage", + ".yaml.sed", + ".yml.mysql" ], - \\"filenames\\": [ - \\".clang-format\\", - \\".clang-tidy\\", - \\".gemrc\\", - \\"glide.lock\\", - \\".prettierrc\\", - \\".stylelintrc\\" + "filenames": [ + ".clang-format", + ".clang-tidy", + ".gemrc", + "glide.lock", + ".prettierrc", + ".stylelintrc" ], - \\"linguistLanguageId\\": 407, - \\"name\\": \\"YAML\\", - \\"parsers\\": [\\"yaml\\"], - \\"since\\": \\"1.14.0\\", - \\"tmScope\\": \\"source.yaml\\", - \\"type\\": \\"data\\", - \\"vscodeLanguageIds\\": [\\"yaml\\", \\"ansible\\", \\"home-assistant\\"] + "linguistLanguageId": 407, + "name": "YAML", + "parsers": ["yaml"], + "since": "1.14.0", + "tmScope": "source.yaml", + "type": "data", + "vscodeLanguageIds": ["yaml", "ansible", "home-assistant"] } ], - \\"options\\": [ + "options": [ { - \\"category\\": \\"JavaScript\\", - \\"choices\\": [ + "category": "JavaScript", + "choices": [ { - \\"description\\": \\"Always include parens. Example: \`(x) => x\`\\", - \\"value\\": \\"always\\" + "description": "Always include parens. Example: \`(x) => x\`", + "value": "always" }, { - \\"description\\": \\"Omit parens when possible. Example: \`x => x\`\\", - \\"value\\": \\"avoid\\" + "description": "Omit parens when possible. Example: \`x => x\`", + "value": "avoid" } ], - \\"default\\": \\"always\\", - \\"description\\": \\"Include parentheses around a sole arrow function parameter.\\", - \\"name\\": \\"arrowParens\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.9.0\\", - \\"type\\": \\"choice\\" + "default": "always", + "description": "Include parentheses around a sole arrow function parameter.", + "name": "arrowParens", + "pluginDefaults": {}, + "since": "1.9.0", + "type": "choice" }, { - \\"category\\": \\"Common\\", - \\"default\\": false, - \\"description\\": \\"Put > of opening tags on the last line instead of on a new line.\\", - \\"name\\": \\"bracketSameLine\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"2.4.0\\", - \\"type\\": \\"boolean\\" + "category": "Common", + "default": false, + "description": "Put > of opening tags on the last line instead of on a new line.", + "name": "bracketSameLine", + "pluginDefaults": {}, + "since": "2.4.0", + "type": "boolean" }, { - \\"category\\": \\"Common\\", - \\"default\\": true, - \\"description\\": \\"Print spaces between brackets.\\", - \\"name\\": \\"bracketSpacing\\", - \\"oppositeDescription\\": \\"Do not print spaces between brackets.\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"0.0.0\\", - \\"type\\": \\"boolean\\" + "category": "Common", + "default": true, + "description": "Print spaces between brackets.", + "name": "bracketSpacing", + "oppositeDescription": "Do not print spaces between brackets.", + "pluginDefaults": {}, + "since": "0.0.0", + "type": "boolean" }, { - \\"category\\": \\"Special\\", - \\"default\\": -1, - \\"description\\": \\"Print (to stderr) where a cursor at the given position would move to after formatting.\\\\nThis option cannot be used with --range-start and --range-end.\\", - \\"name\\": \\"cursorOffset\\", - \\"pluginDefaults\\": {}, - \\"range\\": { \\"end\\": null, \\"start\\": -1, \\"step\\": 1 }, - \\"since\\": \\"1.4.0\\", - \\"type\\": \\"int\\" + "category": "Special", + "default": -1, + "description": "Print (to stderr) where a cursor at the given position would move to after formatting.\\nThis option cannot be used with --range-start and --range-end.", + "name": "cursorOffset", + "pluginDefaults": {}, + "range": { "end": null, "start": -1, "step": 1 }, + "since": "1.4.0", + "type": "int" }, { - \\"category\\": \\"Global\\", - \\"choices\\": [ + "category": "Global", + "choices": [ { - \\"description\\": \\"Format embedded code if Prettier can automatically identify it.\\", - \\"value\\": \\"auto\\" + "description": "Format embedded code if Prettier can automatically identify it.", + "value": "auto" }, { - \\"description\\": \\"Never automatically format embedded code.\\", - \\"value\\": \\"off\\" + "description": "Never automatically format embedded code.", + "value": "off" } ], - \\"default\\": \\"auto\\", - \\"description\\": \\"Control how Prettier formats quoted code embedded in the file.\\", - \\"name\\": \\"embeddedLanguageFormatting\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"2.1.0\\", - \\"type\\": \\"choice\\" + "default": "auto", + "description": "Control how Prettier formats quoted code embedded in the file.", + "name": "embeddedLanguageFormatting", + "pluginDefaults": {}, + "since": "2.1.0", + "type": "choice" }, { - \\"category\\": \\"Global\\", - \\"choices\\": [ + "category": "Global", + "choices": [ { - \\"description\\": \\"Line Feed only (\\\\\\\\n), common on Linux and macOS as well as inside git repos\\", - \\"value\\": \\"lf\\" + "description": "Line Feed only (\\\\n), common on Linux and macOS as well as inside git repos", + "value": "lf" }, { - \\"description\\": \\"Carriage Return + Line Feed characters (\\\\\\\\r\\\\\\\\n), common on Windows\\", - \\"value\\": \\"crlf\\" + "description": "Carriage Return + Line Feed characters (\\\\r\\\\n), common on Windows", + "value": "crlf" }, { - \\"description\\": \\"Carriage Return character only (\\\\\\\\r), used very rarely\\", - \\"value\\": \\"cr\\" + "description": "Carriage Return character only (\\\\r), used very rarely", + "value": "cr" }, { - \\"description\\": \\"Maintain existing\\\\n(mixed values within one file are normalised by looking at what's used after the first line)\\", - \\"value\\": \\"auto\\" + "description": "Maintain existing\\n(mixed values within one file are normalised by looking at what's used after the first line)", + "value": "auto" } ], - \\"default\\": \\"lf\\", - \\"description\\": \\"Which end of line characters to apply.\\", - \\"name\\": \\"endOfLine\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.15.0\\", - \\"type\\": \\"choice\\" + "default": "lf", + "description": "Which end of line characters to apply.", + "name": "endOfLine", + "pluginDefaults": {}, + "since": "1.15.0", + "type": "choice" }, { - \\"category\\": \\"Special\\", - \\"description\\": \\"Specify the input filepath. This will be used to do parser inference.\\", - \\"name\\": \\"filepath\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.4.0\\", - \\"type\\": \\"path\\" + "category": "Special", + "description": "Specify the input filepath. This will be used to do parser inference.", + "name": "filepath", + "pluginDefaults": {}, + "since": "1.4.0", + "type": "path" }, { - \\"category\\": \\"HTML\\", - \\"choices\\": [ + "category": "HTML", + "choices": [ { - \\"description\\": \\"Respect the default value of CSS display property.\\", - \\"value\\": \\"css\\" + "description": "Respect the default value of CSS display property.", + "value": "css" }, { - \\"description\\": \\"Whitespaces are considered sensitive.\\", - \\"value\\": \\"strict\\" + "description": "Whitespaces are considered sensitive.", + "value": "strict" }, { - \\"description\\": \\"Whitespaces are considered insensitive.\\", - \\"value\\": \\"ignore\\" + "description": "Whitespaces are considered insensitive.", + "value": "ignore" } ], - \\"default\\": \\"css\\", - \\"description\\": \\"How to handle whitespaces in HTML.\\", - \\"name\\": \\"htmlWhitespaceSensitivity\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.15.0\\", - \\"type\\": \\"choice\\" + "default": "css", + "description": "How to handle whitespaces in HTML.", + "name": "htmlWhitespaceSensitivity", + "pluginDefaults": {}, + "since": "1.15.0", + "type": "choice" }, { - \\"category\\": \\"Special\\", - \\"default\\": false, - \\"description\\": \\"Insert @format pragma into file's first docblock comment.\\", - \\"name\\": \\"insertPragma\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.8.0\\", - \\"type\\": \\"boolean\\" + "category": "Special", + "default": false, + "description": "Insert @format pragma into file's first docblock comment.", + "name": "insertPragma", + "pluginDefaults": {}, + "since": "1.8.0", + "type": "boolean" }, { - \\"category\\": \\"JavaScript\\", - \\"default\\": false, - \\"description\\": \\"Use single quotes in JSX.\\", - \\"name\\": \\"jsxSingleQuote\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.15.0\\", - \\"type\\": \\"boolean\\" + "category": "JavaScript", + "default": false, + "description": "Use single quotes in JSX.", + "name": "jsxSingleQuote", + "pluginDefaults": {}, + "since": "1.15.0", + "type": "boolean" }, { - \\"category\\": \\"Global\\", - \\"choices\\": [ - { \\"description\\": \\"Flow\\", \\"value\\": \\"flow\\" }, - { \\"description\\": \\"JavaScript\\", \\"since\\": \\"1.16.0\\", \\"value\\": \\"babel\\" }, - { \\"description\\": \\"Flow\\", \\"since\\": \\"1.16.0\\", \\"value\\": \\"babel-flow\\" }, - { \\"description\\": \\"TypeScript\\", \\"since\\": \\"2.0.0\\", \\"value\\": \\"babel-ts\\" }, + "category": "Global", + "choices": [ + { "description": "Flow", "value": "flow" }, + { "description": "JavaScript", "since": "1.16.0", "value": "babel" }, + { "description": "Flow", "since": "1.16.0", "value": "babel-flow" }, + { "description": "TypeScript", "since": "2.0.0", "value": "babel-ts" }, { - \\"description\\": \\"TypeScript\\", - \\"since\\": \\"1.4.0\\", - \\"value\\": \\"typescript\\" + "description": "TypeScript", + "since": "1.4.0", + "value": "typescript" }, - { \\"description\\": \\"JavaScript\\", \\"since\\": \\"2.6.0\\", \\"value\\": \\"acorn\\" }, - { \\"description\\": \\"JavaScript\\", \\"since\\": \\"2.2.0\\", \\"value\\": \\"espree\\" }, - { \\"description\\": \\"JavaScript\\", \\"since\\": \\"2.2.0\\", \\"value\\": \\"meriyah\\" }, - { \\"description\\": \\"CSS\\", \\"since\\": \\"1.7.1\\", \\"value\\": \\"css\\" }, - { \\"description\\": \\"Less\\", \\"since\\": \\"1.7.1\\", \\"value\\": \\"less\\" }, - { \\"description\\": \\"SCSS\\", \\"since\\": \\"1.7.1\\", \\"value\\": \\"scss\\" }, - { \\"description\\": \\"JSON\\", \\"since\\": \\"1.5.0\\", \\"value\\": \\"json\\" }, - { \\"description\\": \\"JSON5\\", \\"since\\": \\"1.13.0\\", \\"value\\": \\"json5\\" }, + { "description": "JavaScript", "since": "2.6.0", "value": "acorn" }, + { "description": "JavaScript", "since": "2.2.0", "value": "espree" }, + { "description": "JavaScript", "since": "2.2.0", "value": "meriyah" }, + { "description": "CSS", "since": "1.7.1", "value": "css" }, + { "description": "Less", "since": "1.7.1", "value": "less" }, + { "description": "SCSS", "since": "1.7.1", "value": "scss" }, + { "description": "JSON", "since": "1.5.0", "value": "json" }, + { "description": "JSON5", "since": "1.13.0", "value": "json5" }, { - \\"description\\": \\"JSON.stringify\\", - \\"since\\": \\"1.13.0\\", - \\"value\\": \\"json-stringify\\" + "description": "JSON.stringify", + "since": "1.13.0", + "value": "json-stringify" }, - { \\"description\\": \\"GraphQL\\", \\"since\\": \\"1.5.0\\", \\"value\\": \\"graphql\\" }, - { \\"description\\": \\"Markdown\\", \\"since\\": \\"1.8.0\\", \\"value\\": \\"markdown\\" }, - { \\"description\\": \\"MDX\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"mdx\\" }, - { \\"description\\": \\"Vue\\", \\"since\\": \\"1.10.0\\", \\"value\\": \\"vue\\" }, - { \\"description\\": \\"YAML\\", \\"since\\": \\"1.14.0\\", \\"value\\": \\"yaml\\" }, + { "description": "GraphQL", "since": "1.5.0", "value": "graphql" }, + { "description": "Markdown", "since": "1.8.0", "value": "markdown" }, + { "description": "MDX", "since": "1.15.0", "value": "mdx" }, + { "description": "Vue", "since": "1.10.0", "value": "vue" }, + { "description": "YAML", "since": "1.14.0", "value": "yaml" }, { - \\"description\\": \\"Ember / Handlebars\\", - \\"since\\": \\"2.3.0\\", - \\"value\\": \\"glimmer\\" + "description": "Ember / Handlebars", + "since": "2.3.0", + "value": "glimmer" }, - { \\"description\\": \\"HTML\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"html\\" }, - { \\"description\\": \\"Angular\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"angular\\" }, + { "description": "HTML", "since": "1.15.0", "value": "html" }, + { "description": "Angular", "since": "1.15.0", "value": "angular" }, { - \\"description\\": \\"Lightning Web Components\\", - \\"since\\": \\"1.17.0\\", - \\"value\\": \\"lwc\\" + "description": "Lightning Web Components", + "since": "1.17.0", + "value": "lwc" } ], - \\"description\\": \\"Which parser to use.\\", - \\"name\\": \\"parser\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"0.0.10\\", - \\"type\\": \\"choice\\" + "description": "Which parser to use.", + "name": "parser", + "pluginDefaults": {}, + "since": "0.0.10", + "type": "choice" }, { - \\"array\\": true, - \\"category\\": \\"Global\\", - \\"default\\": [], - \\"description\\": \\"Custom directory that contains prettier plugins in node_modules subdirectory.\\\\nOverrides default behavior when plugins are searched relatively to the location of Prettier.\\\\nMultiple values are accepted.\\", - \\"name\\": \\"pluginSearchDirs\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.13.0\\", - \\"type\\": \\"path\\" + "array": true, + "category": "Global", + "default": [], + "description": "Custom directory that contains prettier plugins in node_modules subdirectory.\\nOverrides default behavior when plugins are searched relatively to the location of Prettier.\\nMultiple values are accepted.", + "name": "pluginSearchDirs", + "pluginDefaults": {}, + "since": "1.13.0", + "type": "path" }, { - \\"array\\": true, - \\"category\\": \\"Global\\", - \\"default\\": [], - \\"description\\": \\"Add a plugin. Multiple plugins can be passed as separate \`--plugin\`s.\\", - \\"name\\": \\"plugins\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.10.0\\", - \\"type\\": \\"path\\" + "array": true, + "category": "Global", + "default": [], + "description": "Add a plugin. Multiple plugins can be passed as separate \`--plugin\`s.", + "name": "plugins", + "pluginDefaults": {}, + "since": "1.10.0", + "type": "path" }, { - \\"category\\": \\"Global\\", - \\"default\\": 80, - \\"description\\": \\"The line length where Prettier will try wrap.\\", - \\"name\\": \\"printWidth\\", - \\"pluginDefaults\\": {}, - \\"range\\": { \\"end\\": null, \\"start\\": 0, \\"step\\": 1 }, - \\"since\\": \\"0.0.0\\", - \\"type\\": \\"int\\" + "category": "Global", + "default": 80, + "description": "The line length where Prettier will try wrap.", + "name": "printWidth", + "pluginDefaults": {}, + "range": { "end": null, "start": 0, "step": 1 }, + "since": "0.0.0", + "type": "int" }, { - \\"category\\": \\"Common\\", - \\"choices\\": [ + "category": "Common", + "choices": [ { - \\"description\\": \\"Wrap prose if it exceeds the print width.\\", - \\"since\\": \\"1.9.0\\", - \\"value\\": \\"always\\" + "description": "Wrap prose if it exceeds the print width.", + "since": "1.9.0", + "value": "always" }, { - \\"description\\": \\"Do not wrap prose.\\", - \\"since\\": \\"1.9.0\\", - \\"value\\": \\"never\\" + "description": "Do not wrap prose.", + "since": "1.9.0", + "value": "never" }, { - \\"description\\": \\"Wrap prose as-is.\\", - \\"since\\": \\"1.9.0\\", - \\"value\\": \\"preserve\\" + "description": "Wrap prose as-is.", + "since": "1.9.0", + "value": "preserve" } ], - \\"default\\": \\"preserve\\", - \\"description\\": \\"How to wrap prose.\\", - \\"name\\": \\"proseWrap\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.8.2\\", - \\"type\\": \\"choice\\" + "default": "preserve", + "description": "How to wrap prose.", + "name": "proseWrap", + "pluginDefaults": {}, + "since": "1.8.2", + "type": "choice" }, { - \\"category\\": \\"JavaScript\\", - \\"choices\\": [ + "category": "JavaScript", + "choices": [ { - \\"description\\": \\"Only add quotes around object properties where required.\\", - \\"value\\": \\"as-needed\\" + "description": "Only add quotes around object properties where required.", + "value": "as-needed" }, { - \\"description\\": \\"If at least one property in an object requires quotes, quote all properties.\\", - \\"value\\": \\"consistent\\" + "description": "If at least one property in an object requires quotes, quote all properties.", + "value": "consistent" }, { - \\"description\\": \\"Respect the input use of quotes in object properties.\\", - \\"value\\": \\"preserve\\" + "description": "Respect the input use of quotes in object properties.", + "value": "preserve" } ], - \\"default\\": \\"as-needed\\", - \\"description\\": \\"Change when properties in objects are quoted.\\", - \\"name\\": \\"quoteProps\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.17.0\\", - \\"type\\": \\"choice\\" + "default": "as-needed", + "description": "Change when properties in objects are quoted.", + "name": "quoteProps", + "pluginDefaults": {}, + "since": "1.17.0", + "type": "choice" }, { - \\"category\\": \\"Special\\", - \\"default\\": null, - \\"description\\": \\"Format code ending at a given character offset (exclusive).\\\\nThe range will extend forwards to the end of the selected statement.\\\\nThis option cannot be used with --cursor-offset.\\", - \\"name\\": \\"rangeEnd\\", - \\"pluginDefaults\\": {}, - \\"range\\": { \\"end\\": null, \\"start\\": 0, \\"step\\": 1 }, - \\"since\\": \\"1.4.0\\", - \\"type\\": \\"int\\" + "category": "Special", + "default": null, + "description": "Format code ending at a given character offset (exclusive).\\nThe range will extend forwards to the end of the selected statement.\\nThis option cannot be used with --cursor-offset.", + "name": "rangeEnd", + "pluginDefaults": {}, + "range": { "end": null, "start": 0, "step": 1 }, + "since": "1.4.0", + "type": "int" }, { - \\"category\\": \\"Special\\", - \\"default\\": 0, - \\"description\\": \\"Format code starting at a given character offset.\\\\nThe range will extend backwards to the start of the first line containing the selected statement.\\\\nThis option cannot be used with --cursor-offset.\\", - \\"name\\": \\"rangeStart\\", - \\"pluginDefaults\\": {}, - \\"range\\": { \\"end\\": null, \\"start\\": 0, \\"step\\": 1 }, - \\"since\\": \\"1.4.0\\", - \\"type\\": \\"int\\" + "category": "Special", + "default": 0, + "description": "Format code starting at a given character offset.\\nThe range will extend backwards to the start of the first line containing the selected statement.\\nThis option cannot be used with --cursor-offset.", + "name": "rangeStart", + "pluginDefaults": {}, + "range": { "end": null, "start": 0, "step": 1 }, + "since": "1.4.0", + "type": "int" }, { - \\"category\\": \\"Special\\", - \\"default\\": false, - \\"description\\": \\"Require either '@prettier' or '@format' to be present in the file's first docblock comment\\\\nin order for it to be formatted.\\", - \\"name\\": \\"requirePragma\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.7.0\\", - \\"type\\": \\"boolean\\" + "category": "Special", + "default": false, + "description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment\\nin order for it to be formatted.", + "name": "requirePragma", + "pluginDefaults": {}, + "since": "1.7.0", + "type": "boolean" }, { - \\"category\\": \\"JavaScript\\", - \\"default\\": true, - \\"description\\": \\"Print semicolons.\\", - \\"name\\": \\"semi\\", - \\"oppositeDescription\\": \\"Do not print semicolons, except at the beginning of lines which may need them.\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.0.0\\", - \\"type\\": \\"boolean\\" + "category": "JavaScript", + "default": true, + "description": "Print semicolons.", + "name": "semi", + "oppositeDescription": "Do not print semicolons, except at the beginning of lines which may need them.", + "pluginDefaults": {}, + "since": "1.0.0", + "type": "boolean" }, { - \\"category\\": \\"Common\\", - \\"default\\": false, - \\"description\\": \\"Enforce single attribute per line in HTML, Vue and JSX.\\", - \\"name\\": \\"singleAttributePerLine\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"2.6.0\\", - \\"type\\": \\"boolean\\" + "category": "Common", + "default": false, + "description": "Enforce single attribute per line in HTML, Vue and JSX.", + "name": "singleAttributePerLine", + "pluginDefaults": {}, + "since": "2.6.0", + "type": "boolean" }, { - \\"category\\": \\"Common\\", - \\"default\\": false, - \\"description\\": \\"Use single quotes instead of double quotes.\\", - \\"name\\": \\"singleQuote\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"0.0.0\\", - \\"type\\": \\"boolean\\" + "category": "Common", + "default": false, + "description": "Use single quotes instead of double quotes.", + "name": "singleQuote", + "pluginDefaults": {}, + "since": "0.0.0", + "type": "boolean" }, { - \\"category\\": \\"Global\\", - \\"default\\": 2, - \\"description\\": \\"Number of spaces per indentation level.\\", - \\"name\\": \\"tabWidth\\", - \\"pluginDefaults\\": {}, - \\"range\\": { \\"end\\": null, \\"start\\": 0, \\"step\\": 1 }, - \\"type\\": \\"int\\" + "category": "Global", + "default": 2, + "description": "Number of spaces per indentation level.", + "name": "tabWidth", + "pluginDefaults": {}, + "range": { "end": null, "start": 0, "step": 1 }, + "type": "int" }, { - \\"category\\": \\"JavaScript\\", - \\"choices\\": [ + "category": "JavaScript", + "choices": [ { - \\"description\\": \\"Trailing commas where valid in ES5 (objects, arrays, etc.)\\", - \\"value\\": \\"es5\\" + "description": "Trailing commas where valid in ES5 (objects, arrays, etc.)", + "value": "es5" }, - { \\"description\\": \\"No trailing commas.\\", \\"value\\": \\"none\\" }, + { "description": "No trailing commas.", "value": "none" }, { - \\"description\\": \\"Trailing commas wherever possible (including function arguments).\\", - \\"value\\": \\"all\\" + "description": "Trailing commas wherever possible (including function arguments).", + "value": "all" } ], - \\"default\\": \\"es5\\", - \\"description\\": \\"Print trailing commas wherever possible when multi-line.\\", - \\"name\\": \\"trailingComma\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"0.0.0\\", - \\"type\\": \\"choice\\" + "default": "es5", + "description": "Print trailing commas wherever possible when multi-line.", + "name": "trailingComma", + "pluginDefaults": {}, + "since": "0.0.0", + "type": "choice" }, { - \\"category\\": \\"Global\\", - \\"default\\": false, - \\"description\\": \\"Indent with tabs instead of spaces.\\", - \\"name\\": \\"useTabs\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.0.0\\", - \\"type\\": \\"boolean\\" + "category": "Global", + "default": false, + "description": "Indent with tabs instead of spaces.", + "name": "useTabs", + "pluginDefaults": {}, + "since": "1.0.0", + "type": "boolean" }, { - \\"category\\": \\"HTML\\", - \\"default\\": false, - \\"description\\": \\"Indent script and style tags in Vue files.\\", - \\"name\\": \\"vueIndentScriptAndStyle\\", - \\"pluginDefaults\\": {}, - \\"since\\": \\"1.19.0\\", - \\"type\\": \\"boolean\\" + "category": "HTML", + "default": false, + "description": "Indent script and style tags in Vue files.", + "name": "vueIndentScriptAndStyle", + "pluginDefaults": {}, + "since": "1.19.0", + "type": "boolean" } ] } diff --git a/tests/integration/__tests__/__snapshots__/third-party.js.snap b/tests/integration/__tests__/__snapshots__/third-party.js.snap index c7863ffc5..d9088f3a7 100644 --- a/tests/integration/__tests__/__snapshots__/third-party.js.snap +++ b/tests/integration/__tests__/__snapshots__/third-party.js.snap @@ -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':} | ^ diff --git a/tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap b/tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap index 919bcf67e..4bb4d2895 100644 --- a/tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap +++ b/tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap @@ -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() { diff --git a/tests/integration/__tests__/__snapshots__/with-parser-inference.js.snap b/tests/integration/__tests__/__snapshots__/with-parser-inference.js.snap index ae829f1ee..e3c050ee0 100644 --- a/tests/integration/__tests__/__snapshots__/with-parser-inference.js.snap +++ b/tests/integration/__tests__/__snapshots__/with-parser-inference.js.snap @@ -4,7 +4,7 @@ exports[`infers postcss parser (stderr) 1`] = `""`; exports[`infers postcss parser (stdout) 1`] = ` "/* JavaScript */ -\\"use strict\\"; +"use strict"; /* Stylesheet */ * { outline: none; diff --git a/tests/integration/__tests__/__snapshots__/with-shebang.js.snap b/tests/integration/__tests__/__snapshots__/with-shebang.js.snap index 807b89adc..f479a6255 100644 --- a/tests/integration/__tests__/__snapshots__/with-shebang.js.snap +++ b/tests/integration/__tests__/__snapshots__/with-shebang.js.snap @@ -4,7 +4,7 @@ exports[`preserves shebang (stderr) 1`] = `""`; exports[`preserves shebang (stdout) 1`] = ` "#!/usr/bin/env node -\\"use strict\\"; +"use strict"; " `; diff --git a/tests/integration/__tests__/format.js b/tests/integration/__tests__/format.js index ea7c7f7a2..5f2d2dd2f 100644 --- a/tests/integration/__tests__/format.js +++ b/tests/integration/__tests__/format.js @@ -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", () => { diff --git a/yarn.lock b/yarn.lock index f77dab94b..2d7981a15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"