Add test fixtures for arrays formatting
MODIFY
packages/@romejs/js-formatter/index.test.ts
packages/@romejs/js-formatter/index.test.ts
@@ -84,5 +84,5 @@ const promise = createFixtureTests((fixture, t) => {
}
});
-// @ts-ignore allow top level promise
+// @ts-ignore allow top level await
await promise;
\ No newline at end of file

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/array-spread/input.js
+let a = [...a, ...b,];
+let b = [...a, ...b];
\ No newline at end of file

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/array-spread/output.js
+let a = [...a, ...b];
+let b = [...a, ...b];

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/empty-lines/input.js
+let a = [
+
+ 1,
+ 2,
+
+ 3,
+
+
+ 4,
+
+
+ ];
\ No newline at end of file

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/empty-lines/output.js
+let a = [
+ 1,
+ 2,
+
+ 3,
+
+ 4,
+];

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/nested/input.js
+let a = [[]];
+let b = [[], []];
+let c = [[], [], []];
+let d = [[], [0], []];
+let e = [[], [0], [0]];
+let f = [[], [0, 1], [0]];
+let g = [[], [0, 1], [0, 1]];
+let h = [[0]];
+let i = [[0], []];
+let j = [[0], [], []];
+let k = [[0], [0], []];
+let l = [[0], [0], [0]];
+let m = [[0], [0, 1], [0]];
+let n = [[0], [0, 1], [0, 1]];
+let o = [[0, 1]];
+let p = [[0, 1], []];
+let q = [[0, 1], [], []];
+let r = [[0, 1], [0], []];
+let s = [[0, 1], [0], [0]];
+let t = [[0, 1], [0, 1], [0]];
+let u = [[0, 1], [0, 1], [0, 1]];
+let v = [[], [1, 2, 3]];
+let w = [[1], [1]];
+let x = [[1, 2], [1, 2, 3]];
+let y = [[1, 0], [1, 0]];
+let z = [{}];
+let a1 = [{}, {}];
+let b1 = [{}, {}, {}];
+let c1 = [{}, { a }];
+let d1 = [{}, { a, b }];
+let e1 = [{}, { a, b, c }];
+let f1 = [{ a }];
+let g1 = [{ a }, { a }];
+let h1 = [{ a }, { a }, { a }];
+let i1 = [{ a }, { a, b }];
+let j1 = [{ a }, { a, b, c}];
+let k1 = [{ a, b }];
+let l1 = [{ a, b }, { a }];
+let m1 = [{ a, b }, { a }, { a }];
+let n1 = [{ a, b }, { a, b }];
+let o1 = [{ a, b }, { a, b, c }];

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/nested/output.js
+let a = [[]];
+let b = [[], []];
+let c = [[], [], []];
+let d = [[], [0], []];
+let e = [[], [0], [0]];
+let f = [[], [0, 1], [0]];
+let g = [[], [0, 1], [0, 1]];
+let h = [[0]];
+let i = [[0], []];
+let j = [[0], [], []];
+let k = [[0], [0], []];
+let l = [[0], [0], [0]];
+let m = [[0], [0, 1], [0]];
+let n = [[0], [0, 1], [0, 1]];
+let o = [[0, 1]];
+let p = [[0, 1], []];
+let q = [[0, 1], [], []];
+let r = [[0, 1], [0], []];
+let s = [[0, 1], [0], [0]];
+let t = [[0, 1], [0, 1], [0]];
+let u = [[0, 1], [0, 1], [0, 1]];
+let v = [[], [1, 2, 3]];
+let w = [[1], [1]];
+let x = [[1, 2], [1, 2, 3]];
+let y = [[1, 0], [1, 0]];
+let z = [{}];
+let a1 = [{}, {}];
+let b1 = [{}, {}, {}];
+let c1 = [{}, {a}];
+let d1 = [{}, {a, b}];
+let e1 = [{}, {a, b, c}];
+let f1 = [{a}];
+let g1 = [{a}, {a}];
+let h1 = [{a}, {a}, {a}];
+let i1 = [{a}, {a, b}];
+let j1 = [{a}, {a, b, c}];
+let k1 = [{a, b}];
+let l1 = [{a, b}, {a}];
+let m1 = [{a, b}, {a}, {a}];
+let n1 = [{a, b}, {a, b}];
+let o1 = [{a, b}, {a, b, c}];

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/spaces/input.js
+let a = [,];
+let b = [,,];
+let c = [,,1,];
+let d = [,,1,1];
\ No newline at end of file

ADD
packages/@romejs/js-formatter/test-fixtures/arrays/spaces/output.js
+let a = [];
+let b = [, ];
+let c = [, , 1];
+let d = [, , 1, 1];

Add test fixtures for arrays formatting