diff --git a/crates/rome_js_formatter/tests/specs/js/module/arrow/params.js.snap b/crates/rome_js_formatter/tests/specs/js/module/arrow/params.js.snap index acfa9b8e3069..47e2808b7b79 100644 --- a/crates/rome_js_formatter/tests/specs/js/module/arrow/params.js.snap +++ b/crates/rome_js_formatter/tests/specs/js/module/arrow/params.js.snap @@ -337,35 +337,181 @@ fooooooooooooooooooooooooooooooooooooooooooooooooooo( (action) => (next) => dispatch(action), ); -foo(({ a, b }) => {}); +foo( + ( + { + a, + b, + }, + ) => {}, +); -foo(({ a, b }) => {}); +foo( + ( + { + a, + b, + }, + ) => {}, +); -foo(({ a, b }) => {}); +foo( + ( + { + a, + b, + }, + ) => {}, +); -foo(a, ({ a, b }) => {}); +foo( + a, + ( + { + a, + b, + }, + ) => {}, +); -foo(({ a, b }) => a); +foo( + ( + { + a, + b, + }, + ) => a, +); -foo(({ a, b }) => a); +foo( + ( + { + a, + b, + }, + ) => a, +); -foo(({ a, b }) => a); +foo( + ( + { + a, + b, + }, + ) => a, +); -foo(({ a: { a, b } }) => {}); +foo( + ( + { + a: { + a, + b, + }, + }, + ) => {}, +); -foo(({ a: { b: { c, d } } }) => {}); +foo( + ( + { + a: { + b: { + c, + d, + }, + }, + }, + ) => {}, +); -foo(({ a: { b: { c: { d, e } } } }) => {}); +foo( + ( + { + a: { + b: { + c: { + d, + e, + }, + }, + }, + }, + ) => {}, +); -foo(({ a: { a, b } }) => a); +foo( + ( + { + a: { + a, + b, + }, + }, + ) => a, +); -foo(({ a: { b: { c, d } } }) => a); +foo( + ( + { + a: { + b: { + c, + d, + }, + }, + }, + ) => a, +); -foo(({ a: { b: { c: { d, e } } } }) => a); +foo( + ( + { + a: { + b: { + c: { + d, + e, + }, + }, + }, + }, + ) => a, +); -foo(([{ a: { b: { c: { d, e } } } }]) => {}); +foo( + ( + [ + { + a: { + b: { + c: { + d, + e, + }, + }, + }, + }, + ], + ) => {}, +); -foo(([...{ a: { b: { c: { d, e } } } }]) => {}); +foo( + ( + [ + ...{ + a: { + b: { + c: { + d, + e, + }, + }, + }, + } + ], + ) => {}, +); foo( ( @@ -383,7 +529,18 @@ foo( ) => {}, ); -foo(({ x: [{ a, b }] }) => {}); +foo( + ( + { + x: [ + { + a, + b, + }, + ], + }, + ) => {}, +); foo( ( @@ -397,15 +554,74 @@ foo( ) => a, ); -foo(([[{ a, b }]]) => {}); +foo( + ( + [ + [ + { + a, + b, + }, + ], + ], + ) => {}, +); -foo(([[[[{ a, b: { c, d: { e, f } } }]]]]) => {}); +foo( + ( + [ + [ + [ + [ + { + a, + b: { + c, + d: { + e, + f, + }, + }, + }, + ], + ], + ], + ], + ) => {}, +); -foo((...{ a, b }) => {}); +foo( + ( + ...{ + a, + b, + } + ) => {}, +); -foo((...[{ a, b }]) => {}); +foo( + ( + ...[ + { + a, + b, + }, + ] + ) => {}, +); -foo(([...[{ a, b }]]) => {}); +foo( + ( + [ + ...[ + { + a, + b, + }, + ] + ], + ) => {}, +); foo( ( @@ -419,7 +635,18 @@ foo( ) => {}, ); -foo((a = (({ a, b }) => {})()) => {}); +foo( + ( + a = ( + ( + { + a, + b, + }, + ) => {} + )(), + ) => {}, +); foo( ( @@ -431,7 +658,16 @@ foo( ) => {}, ); -foo((a = ({ a, b }) => {}) => {}); +foo( + ( + a = ( + { + a, + b, + }, + ) => {}, + ) => {}, +); foo( ( diff --git a/crates/rome_js_formatter/tests/specs/js/module/import/bare_import.js.snap b/crates/rome_js_formatter/tests/specs/js/module/import/bare_import.js.snap index 3a5d7a39da6d..393bd74ca003 100644 --- a/crates/rome_js_formatter/tests/specs/js/module/import/bare_import.js.snap +++ b/crates/rome_js_formatter/tests/specs/js/module/import/bare_import.js.snap @@ -35,7 +35,9 @@ import "very_long_import_very_long_import_very_long_import_very_long_import_very import "very_long_import_very_long_import_very_long_import_very_long_import_very_long_import_very_long" assert { type: "json", }; -import "short" assert { type: "json" }; +import "short" assert { + type: "json", +}; import "very_long_import_very_long_import_very" assert { // something good is here @@ -56,5 +58,5 @@ import "very_long_import_very_long_import_very" assert { 1: import "very_long_import_very_long_import_very_long_import_very_long_import_very_long_import_very_long_import_very_long_import_"; 2: import "very_long_import_very_long_import_very_long_import_very_long_import_very_long_import_very_long" assert { - 18: "typetypetypetypetypetypetypetypetypetypetype": "typetypetypetypetypetypetypetypetypetypetypetypetypetype", /****/ + 20: "typetypetypetypetypetypetypetypetypetypetype": "typetypetypetypetypetypetypetypetypetypetypetypetypetype", /****/ diff --git a/crates/rome_js_formatter/tests/specs/js/module/import/default_import.js.snap b/crates/rome_js_formatter/tests/specs/js/module/import/default_import.js.snap index 01cbe3667bb6..04b61d3ba6f3 100644 --- a/crates/rome_js_formatter/tests/specs/js/module/import/default_import.js.snap +++ b/crates/rome_js_formatter/tests/specs/js/module/import/default_import.js.snap @@ -28,7 +28,9 @@ import hey from "hey"; import "x" assert { type: "json" }; import "foo" assert { "type": "json" }; import foo from "foo.json" assert { type: "json" }; -import foo from "foo.json" assert { type: "json" }; +import foo from "foo.json" assert { + type: "json", +}; import foo2 from "foo.json" assert { "type": "json", type: "html", diff --git a/crates/rome_js_formatter/tests/specs/js/module/object/object.js.snap b/crates/rome_js_formatter/tests/specs/js/module/object/object.js.snap index 3ddec127fe81..914ad7e38c48 100644 --- a/crates/rome_js_formatter/tests/specs/js/module/object/object.js.snap +++ b/crates/rome_js_formatter/tests/specs/js/module/object/object.js.snap @@ -25,12 +25,16 @@ let a = { ...spread, } -const x = {apple: "banana"} +const x = {apple: "banana"}; const y = { apple: "banana", -} +}; + +({a, b, c} = {a: 'apple', b: 'banana', c: 'coconut'}); +({ + a, b, c} = {a: 'apple', b: 'banana', c: 'coconut'}); ============================= # Outputs ## Output 1 @@ -65,3 +69,13 @@ const y = { apple: "banana", }; +({ a, b, c } = { a: "apple", b: "banana", c: "coconut" }); + +( + { + a, + b, + c, + } = { a: "apple", b: "banana", c: "coconut" } +); + diff --git a/crates/rome_js_formatter/tests/specs/js/module/string/string.js.snap b/crates/rome_js_formatter/tests/specs/js/module/string/string.js.snap index e4014fa37da1..f5cbfb51259c 100644 --- a/crates/rome_js_formatter/tests/specs/js/module/string/string.js.snap +++ b/crates/rome_js_formatter/tests/specs/js/module/string/string.js.snap @@ -61,7 +61,9 @@ import hey from "hey"; import "x" assert { type: "json" }; import "foo" assert { "type": "json" }; import foo from "foo.json" assert { type: "json" }; -import foo from "foo.json" assert { type: "json" }; +import foo from "foo.json" assert { + type: "json", +}; import foo2 from "foo.json" assert { "type": "json", type: "html", @@ -111,7 +113,7 @@ export * as something_bad_will_happen from "something_bad_might_not_happen" asse ## Lines exceeding width of 80 characters - 48: export * as something_bad_will_happen from "something_bad_might_not_happen" assert { + 50: export * as something_bad_will_happen from "something_bad_might_not_happen" assert { ## Output 2 ----- Indent style: Tab @@ -123,7 +125,9 @@ import hey from 'hey'; import 'x' assert { type: 'json' }; import 'foo' assert { 'type': 'json' }; import foo from 'foo.json' assert { type: 'json' }; -import foo from 'foo.json' assert { type: 'json' }; +import foo from 'foo.json' assert { + type: 'json', +}; import foo2 from 'foo.json' assert { 'type': 'json', type: "html", @@ -173,5 +177,5 @@ export * as something_bad_will_happen from 'something_bad_might_not_happen' asse ## Lines exceeding width of 80 characters - 48: export * as something_bad_will_happen from 'something_bad_might_not_happen' assert { + 50: export * as something_bad_will_happen from 'something_bad_might_not_happen' assert { diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/call-with-template.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/call-with-template.js.snap index 4ec6d7dce791..65d96651c750 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/call-with-template.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/call-with-template.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 57 expression: call-with-template.js - --- # Input ```js @@ -25,9 +23,13 @@ const result = template( ` if (SOME_VAR === "") {} `, -)({ SOME_VAR: value }); +)({ + SOME_VAR: value, +}); -const output = template(`function f() %%A%%`)({ A: t.blockStatement([]) }); +const output = template(`function f() %%A%%`)({ + A: t.blockStatement([]), +}); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/destructuring-heuristic.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/destructuring-heuristic.js.snap index 2fe389ebf444..07d1b3e68c88 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/destructuring-heuristic.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/destructuring-heuristic.js.snap @@ -39,27 +39,35 @@ expression: destructuring-heuristic.js ```js { { - const { id, static: isStatic, method: isMethod, methodId, getId, setId } = privateNamesMap.get( - name, - ); + const { + id, + static: isStatic, + method: isMethod, + methodId, + getId, + setId, + } = privateNamesMap.get(name); - const { id1, method: isMethod1, methodId1 } = privateNamesMap.get(name); + const { + id1, + method: isMethod1, + methodId1, + } = privateNamesMap.get(name); - const { id2, method: isMethod2, methodId2 } = privateNamesMap.get( - bifornCringerMoshedPerplexSawder, - ); + const { + id2, + method: isMethod2, + methodId2, + } = privateNamesMap.get(bifornCringerMoshedPerplexSawder); - const { id3, method: isMethod3, methodId3 } = anodyneCondosMalateOverateRetinol.get( - bifornCringerMoshedPerplexSawder, - ); + const { + id3, + method: isMethod3, + methodId3, + } = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder); } } ``` -# Lines exceeding max width of 80 characters -``` - 3: const { id, static: isStatic, method: isMethod, methodId, getId, setId } = privateNamesMap.get( - 13: const { id3, method: isMethod3, methodId3 } = anodyneCondosMalateOverateRetinol.get( -``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/issue-7091.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/issue-7091.js.snap index ff8d57e6d69b..3595b53fd49e 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/issue-7091.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/issue-7091.js.snap @@ -12,12 +12,12 @@ const { # Output ```js -const { imStore, showChat, customerServiceAccount } = store[config.reduxStoreName]; +const { + imStore, + showChat, + customerServiceAccount, +} = store[config.reduxStoreName]; ``` -# Lines exceeding max width of 80 characters -``` - 1: const { imStore, showChat, customerServiceAccount } = store[config.reduxStoreName]; -``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/lone-arg.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/lone-arg.js.snap index ab351da6e6cc..5c6932c4652c 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/assignment/lone-arg.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/assignment/lone-arg.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 57 expression: lone-arg.js - --- # Input ```js @@ -31,7 +29,11 @@ const bifornCringerMoshedPerplexSawderGlyphsHb = someBigFunctionName(`foo # Output ```js -let vgChannel = pointPositionDefaultRef({ model, defaultPos, channel })(); +let vgChannel = pointPositionDefaultRef({ + model, + defaultPos, + channel, +})(); let vgChannel2 = pointPositionDefaultRef({ model, defaultPos, channel })(); diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/async/async-shorthand-method.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/async/async-shorthand-method.js.snap index 2653d14d7786..b7972f2de606 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/async/async-shorthand-method.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/async/async-shorthand-method.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 57 expression: async-shorthand-method.js - --- # Input ```js @@ -15,7 +13,10 @@ expression: async-shorthand-method.js # Output ```js -({ async get() {}, async set() {} }); +({ + async get() {}, + async set() {}, +}); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/babel-plugins/optional-chaining.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/babel-plugins/optional-chaining.js.snap index e7650c28ed09..12e1dd515adb 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/babel-plugins/optional-chaining.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/babel-plugins/optional-chaining.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 121 expression: optional-chaining.js - --- # Input ```js @@ -75,7 +73,13 @@ const ret = delete obj?.foo?.bar?.baz; // true ```js // https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining -const obj = { foo: { bar: { baz: 42 } } }; +const obj = { + foo: { + bar: { + baz: 42, + }, + }, +}; const baz = obj?.foo?.bar?.baz; // 42 @@ -113,9 +117,19 @@ test?.(); // 42 exists?.(); // undefined -const obj3 = { foo: { bar: { baz: class {} } } }; +const obj3 = { + foo: { + bar: { + baz: class {}, + }, + }, +}; -const obj4 = { foo: { bar: {} } }; +const obj4 = { + foo: { + bar: {}, + }, +}; const ret = delete obj?.foo?.bar?.baz; // true diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/arrow.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/arrow.js.snap index b99738cd6ace..65e7f5a8facf 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/arrow.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/arrow.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 125 expression: arrow.js - --- # Input ```js @@ -38,14 +36,17 @@ function f() { } function f2() { - const appEntities = getAppEntities(loadObject).map( - (entity) => - entity && - entity.isInstallAvailable() && - !entity.isQueue() && - entity.isDisabled() && - { id: entity.id }, - ); + const appEntities = getAppEntities(loadObject) + .map( + (entity) => + entity && + entity.isInstallAvailable() && + !entity.isQueue() && + entity.isDisabled() && + { + id: entity.id, + }, + ); } ((x) => x) + ""; diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/inline-object-array.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/inline-object-array.js.snap index 4a67e9ee2d19..48eb268f67e4 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/inline-object-array.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/inline-object-array.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 144 expression: inline-object-array.js - --- # Input ```js @@ -142,20 +140,42 @@ prevState = selectedCatalog: null, }; -this.steps = steps || [{ name: "mock-module", path: "/nux/mock-module" }]; +this.steps = + steps || [ + { + name: "mock-module", + path: "/nux/mock-module", + }, + ]; this.steps = - steps || (checkStep && [{ name: "mock-module", path: "/nux/mock-module" }]); + steps || ( + checkStep && [ + { + name: "mock-module", + path: "/nux/mock-module", + }, + ] + ); this.steps = - (steps && checkStep) || [{ name: "mock-module", path: "/nux/mock-module" }]; + (steps && checkStep) || [ + { + name: "mock-module", + path: "/nux/mock-module", + }, + ]; const create = () => { const result = doSomething(); return ( shouldReturn && result.ok && - { status: "ok", createdAt: result.createdAt, updatedAt: result.updatedAt } + { + status: "ok", + createdAt: result.createdAt, + updatedAt: result.updatedAt, + } ); }; @@ -171,8 +191,15 @@ const create2 = () => { }; const obj = { - state: shouldHaveState && stateIsOK && { loadState: LOADED, opened: false }, - loadNext: (stateIsOK && hasNext) || { skipNext: true }, + state: shouldHaveState && + stateIsOK && + { + loadState: LOADED, + opened: false, + }, + loadNext: (stateIsOK && hasNext) || { + skipNext: true, + }, loaded: true, }; diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/jsx_parent.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/jsx_parent.js.snap index c57c9fe3b5d8..2e4b3430ca43 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/jsx_parent.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/binary-expressions/jsx_parent.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 153 expression: jsx_parent.js - --- # Input ```js @@ -62,7 +60,10 @@ expression: jsx_parent.js style={ !isJellyfishEnabled && diffUpdateMessageInput && - { fontSize: 14, color: "#fff" } + { + fontSize: 14, + color: "#fff", + } } />; diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/classes/method.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/classes/method.js.snap index a80d721b800c..a25247a9b7fc 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/classes/method.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/classes/method.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 121 expression: method.js - --- # Input ```js @@ -26,7 +24,9 @@ class C { name /*comment*/ () {} } -({ name /*comment*/ () {} }); +({ + name /*comment*/ () {}, +}); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/closure-compiler-type-cast.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/closure-compiler-type-cast.js.snap index b2e90ad793cb..271de49030b4 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/closure-compiler-type-cast.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/closure-compiler-type-cast.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 144 expression: closure-compiler-type-cast.js - --- # Input ```js @@ -123,13 +121,19 @@ const style = /** @type {{ marginLeft: number, marginRight: number, marginBottom: number, -}} */ ({ width, height, ...margins }); +}} */ ({ + width, + height, + ...margins, +}); const style2 = /** * @type {{ * width: number, * }} -*/ ({ width }); +*/ ({ + width, +}); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/object-with-comment.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/object-with-comment.js.snap index c6aad9cbe748..c78ef0a81e8c 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/object-with-comment.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments-closure-typecast/object-with-comment.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 144 expression: object-with-comment.js - --- # Input ```js @@ -24,10 +22,17 @@ const objectWithComment2 = /** @type MyType */ ( /* comment */ { ```js const objectWithComment = /** @type MyType */ ( /* comment */ - { foo: bar } + { + foo: bar, + } ); -const objectWithComment2 = /** @type MyType */ ( /* comment */ { foo: bar }); +const objectWithComment2 = /** @type MyType */ ( + /* comment */ + { + foo: bar, + } +); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/issue-3532.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/issue-3532.js.snap index 06c72c4b8fa1..161085242e26 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/comments/issue-3532.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/issue-3532.js.snap @@ -74,7 +74,13 @@ const AspectRatioBox = styled.div` `; */ -const AspectRatioBox = ({ aspectRatio, children, ...props }) => ( +const AspectRatioBox = ( + { + aspectRatio, + children, + ...props + }, +) => (
{}, -); +beep + .boop() + .baz( + "foo", + { + some: { + thing: { + nested: true, + }, + }, + }, + { another: { thing: true } }, + () => {}, + ); //https://github.com/prettier/prettier/issues/2984 db .collection("indexOptionDefault") .createIndex( { a: 1 }, - { indexOptionDefaults: true, w: 2, wtimeout: 1000 }, + { + indexOptionDefaults: true, + w: 2, + wtimeout: 1000, + }, function (err) { test.equal(null, err); test.deepEqual({ w: 2, wtimeout: 1000 }, commandResult.writeConcern); diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/object.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/object.js.snap index f4f58d73055d..4d7ab4717f90 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/object.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/object.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 151 expression: object.js - --- # Input ```js @@ -109,7 +107,9 @@ function StatelessFunctionalComponent3( searchFilters = null, title = "", items = [], - } = { isActive: true }, + } = { + isActive: true, + }, ) { return
; } diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/functional-composition/ramda_compose.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/functional-composition/ramda_compose.js.snap index 088d05d5f05e..b4b94c0d0dd2 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/functional-composition/ramda_compose.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/functional-composition/ramda_compose.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 125 expression: ramda_compose.js - --- # Input ```js @@ -74,7 +72,14 @@ var getStateCode = R.composeK( getStateCode({ user: { address: { state: "ny" } } }); //=> Maybe.Just("NY") getStateCode({}); //=> Maybe.Nothing() -var db = { users: { JOE: { name: "Joe", followers: ["STEVE", "SUZY"] } } }; +var db = { + users: { + JOE: { + name: "Joe", + followers: ["STEVE", "SUZY"], + }, + }, +}; // We'll pretend to do a db lookup which returns a promise var lookupUser = (userId) => Promise.resolve(db.users[userId]); diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/break-parent.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/break-parent.js.snap index 01db462ced45..4a8566228f21 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/break-parent.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/break-parent.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 153 expression: break-parent.js - --- # Input ```js @@ -40,7 +38,9 @@ true processors: [ require( "autoprefixer", - { browsers: ["> 1%", "last 2 versions", "ie >= 11", "Firefox ESR"] }, + { + browsers: ["> 1%", "last 2 versions", "ie >= 11", "Firefox ESR"], + }, ), require("postcss-url")({ url: (url) => @@ -49,7 +49,9 @@ true ], }); -true ? test({ a: 1 }) :
{ # Output ```js export default (store) => { - return callApi(endpoint, schema).then( - (response) => next(actionWith({ response, type: successType })), - (error) => - next( - actionWith({ - type: failureType, - error: error.message || "Something bad happened", - }), - ), - ); + return callApi(endpoint, schema) + .then( + (response) => + next( + actionWith({ + response, + type: successType, + }), + ), + (error) => + next( + actionWith({ + type: failureType, + error: error.message || "Something bad happened", + }), + ), + ); }; it( "should group messages with same created time", () => { - expect(groupMessages(messages).toJS()).toEqual({ - "11/01/2017 13:36": [ - { - message: "test", - messageType: "SMS", - status: "Unknown", - created: "11/01/2017 13:36", - }, - { - message: "test", - messageType: "Email", - status: "Unknown", - created: "11/01/2017 13:36", - }, - ], - "09/01/2017 17:25": [ - { - message: "te", - messageType: "SMS", - status: "Unknown", - created: "09/01/2017 17:25", - }, - { - message: "te", - messageType: "Email", - status: "Unknown", - created: "09/01/2017 17:25", - }, - ], - "11/01/2017 13:33": [ - { - message: "test", - messageType: "SMS", - status: "Unknown", - created: "11/01/2017 13:33", - }, - { - message: "test", - messageType: "Email", - status: "Unknown", - created: "11/01/2017 13:33", - }, - ], - "11/01/2017 13:37": [ - { - message: "test", - messageType: "SMS", - status: "Unknown", - created: "11/01/2017 13:37", - }, - { - message: "test", - messageType: "Email", - status: "Unknown", - created: "11/01/2017 13:37", - }, - ], - }); + expect(groupMessages(messages).toJS()) + .toEqual({ + "11/01/2017 13:36": [ + { + message: "test", + messageType: "SMS", + status: "Unknown", + created: "11/01/2017 13:36", + }, + { + message: "test", + messageType: "Email", + status: "Unknown", + created: "11/01/2017 13:36", + }, + ], + "09/01/2017 17:25": [ + { + message: "te", + messageType: "SMS", + status: "Unknown", + created: "09/01/2017 17:25", + }, + { + message: "te", + messageType: "Email", + status: "Unknown", + created: "09/01/2017 17:25", + }, + ], + "11/01/2017 13:33": [ + { + message: "test", + messageType: "SMS", + status: "Unknown", + created: "11/01/2017 13:33", + }, + { + message: "test", + messageType: "Email", + status: "Unknown", + created: "11/01/2017 13:33", + }, + ], + "11/01/2017 13:37": [ + { + message: "test", + messageType: "SMS", + status: "Unknown", + created: "11/01/2017 13:37", + }, + { + message: "test", + messageType: "Email", + status: "Unknown", + created: "11/01/2017 13:37", + }, + ], + }); }, ); diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/computed.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/computed.js.snap index 874ab26f0f0f..27f9b0153c7c 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/computed.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/computed.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 57 expression: computed.js - --- # Input ```js @@ -17,9 +15,14 @@ nock(/test/) # Output ```js -nock(/test/).matchHeader("Accept", "application/json")[httpMethodNock(method)]( - "/foo", -).reply(200, { foo: "bar" }); +nock(/test/) + .matchHeader("Accept", "application/json")[httpMethodNock(method)]("/foo") + .reply( + 200, + { + foo: "bar", + }, + ); ``` diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/first_long.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/first_long.js.snap index 77b3a4959ab5..1149c9c53ce2 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/first_long.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/first_long.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 125 expression: first_long.js - --- # Input ```js @@ -46,18 +44,24 @@ function f() { # Output ```js export default function theFunction(action$, store) { - return action$.ofType(THE_ACTION).switchMap( - (action) => - Observable - .webSocket({ - url: THE_URL, - more: stuff(), - evenMore: stuff({ value1: true, value2: false, value3: false }), - }) - .filter((data) => theFilter(data)) - .map(({ theType, ...data }) => theMap(theType, data)) - .retryWhen((errors) => errors), - ); + return action$ + .ofType(THE_ACTION) + .switchMap( + (action) => + Observable + .webSocket({ + url: THE_URL, + more: stuff(), + evenMore: stuff({ + value1: true, + value2: false, + value3: false, + }), + }) + .filter((data) => theFilter(data)) + .map(({ theType, ...data }) => theMap(theType, data)) + .retryWhen((errors) => errors), + ); } function f() { diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/inline_merge.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/inline_merge.js.snap index 8777bc70c4c5..6b35532d2585 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/inline_merge.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/inline_merge.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 125 expression: inline_merge.js - --- # Input ```js @@ -30,7 +28,11 @@ var jqxhr = $.ajax("example.php") # Output ```js Object - .keys(availableLocales({ test: true })) + .keys( + availableLocales({ + test: true, + }), + ) .forEach( (locale) => { // ... diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/issue-4125.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/issue-4125.js.snap index 16663a9f4a21..6bbc400e7394 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/issue-4125.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/issue-4125.js.snap @@ -239,13 +239,18 @@ fetchUser(id).then(fetchAccountForUser).catch(handleFetchError); // // examples from https://github.com/prettier/prettier/issues/3107 function HelloWorld() { - window.FooClient.setVars({ - locale: getFooLocale({ page }), - authorizationToken: data.token, - }).initVerify("foo_container"); + window.FooClient + .setVars({ + locale: getFooLocale({ page }), + authorizationToken: data.token, + }) + .initVerify("foo_container"); fejax - .ajax({ url: "/verification/", dataType: "json" }) + .ajax({ + url: "/verification/", + dataType: "json", + }) .then( (data) => { this.setState({ isLoading: false }); @@ -278,10 +283,12 @@ action$ ), ); -window.FooClient.setVars({ - locale: getFooLocale({ page }), - authorizationToken: data.token, -}).initVerify("foo_container"); +window.FooClient + .setVars({ + locale: getFooLocale({ page }), + authorizationToken: data.token, + }) + .initVerify("foo_container"); it( "gets triggered by mouseenter", diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/multiple-members.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/multiple-members.js.snap index 50909f849e6d..ce6de7777745 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/multiple-members.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/method-chain/multiple-members.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 125 expression: multiple-members.js - --- # Input ```js @@ -51,14 +49,16 @@ if (testConfig.ENABLE_ONLINE_TESTS === "true") { "saves pet", function () { function assert(pet) { - expect(pet).to.have.property("OwnerAddress").that.deep.equals({ - AddressLine1: "Alexanderstrasse", - AddressLine2: "", - PostalCode: "10999", - Region: "Berlin", - City: "Berlin", - Country: "DE", - }); + expect(pet).to.have + .property("OwnerAddress") + .that.deep.equals({ + AddressLine1: "Alexanderstrasse", + AddressLine2: "", + PostalCode: "10999", + Region: "Berlin", + City: "Berlin", + Country: "DE", + }); } }, ); diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-graphql/graphql-tag.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-graphql/graphql-tag.js.snap index 869a0af1a242..7e5a5c3a21e3 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-graphql/graphql-tag.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-graphql/graphql-tag.js.snap @@ -1,8 +1,6 @@ --- source: crates/rome_js_formatter/tests/prettier_tests.rs -assertion_line: 121 expression: graphql-tag.js - --- # Input ```js @@ -307,7 +305,9 @@ ${USER_DETAILS_FRAGMENT} # and has a blank line in the middle ${FRIENDS_FRAGMENT} - ${generateFragment({ totally: "a good idea" })} + ${generateFragment({ + totally: "a good idea", +})} ${fragment}#comment diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-html/lit-html.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-html/lit-html.js.snap index a53411144ac7..9167778a183d 100644 --- a/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-html/lit-html.js.snap +++ b/crates/rome_js_formatter/tests/specs/prettier/js/multiparser-html/lit-html.js.snap @@ -115,7 +115,9 @@ import { LitElement, html } from "@polymer/lit-element"; class MyElement extends LitElement { static get properties() { - return { mood: { type: String } }; + return { + mood: { type: String }, + }; } constructor() { @@ -216,7 +218,7 @@ ${foo}:${bar}; # Lines exceeding max width of 80 characters ``` - 68: const nestedFun = /* HTML */ `${outerExpr(1)}