Skip to content

Commit ffd44d7

Browse files
committed
Add dangling commas to functions (new prettier default)
1 parent 6afacbc commit ffd44d7

File tree

23 files changed

+46
-47
lines changed

23 files changed

+46
-47
lines changed

.prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"printWidth": 250,
3-
"tabWidth": 4,
4-
"trailingComma": "es5"
3+
"tabWidth": 4
54
}

resources/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MainBenchmarkClient {
3939
message,
4040
params.suites,
4141
"\nValid values:",
42-
Suites.map((each) => each.name)
42+
Suites.map((each) => each.name),
4343
);
4444

4545
return false;

resources/metric-ui.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function renderMetricView(viewParams) {
3232
<td>±</td>
3333
<td>${metric.deltaString}</td>
3434
<td>${metric.unit}</td>
35-
</tr>`
35+
</tr>`,
3636
)
3737
.join("");
3838
return `

resources/scripts/sanitize-language/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function getFiles(dir) {
2020
dirents.map((dirent) => {
2121
const res = resolve(dir, dirent.name);
2222
return dirent.isDirectory() ? getFiles(res) : res;
23-
})
23+
}),
2424
);
2525
return Array.prototype.concat(...files);
2626
}

resources/todomvc/architecture-examples/angular/src/app/todo-footer/todo-footer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { TodosService } from "../todos.service";
1010
export class TodoFooterComponent {
1111
constructor(
1212
private todosService: TodosService,
13-
private location: Location
13+
private location: Location,
1414
) {}
1515

1616
get todos(): Todo[] {

resources/todomvc/architecture-examples/angular/src/app/todo-list/todo-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { TodosService } from "../todos.service";
1010
export class TodoListComponent {
1111
constructor(
1212
private todosService: TodosService,
13-
private location: Location
13+
private location: Location,
1414
) {}
1515

1616
get todos(): Todo[] {

resources/todomvc/architecture-examples/backbone/src/views/app-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var app = app || {};
6464
this.statsTemplate({
6565
completed: completed,
6666
remaining: remaining,
67-
})
67+
}),
6868
);
6969

7070
this.$(".filters li a")

resources/todomvc/architecture-examples/lit/src/lib/todo-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class TodoList extends LitElement {
102102
${repeat(
103103
this.todoList?.filtered() ?? [],
104104
(todo) => todo.id,
105-
(todo, index) => html`<todo-item data-priority=${4 - (index % 5)} .todoId=${todo.id} .text=${todo.text} .completed=${todo.completed}></todo-item>`
105+
(todo, index) => html`<todo-item data-priority=${4 - (index % 5)} .todoId=${todo.id} .text=${todo.text} .completed=${todo.completed}></todo-item>`,
106106
)}
107107
</ul>
108108
`;

resources/todomvc/architecture-examples/react-redux/src/components/footer.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const setup = (propOverrides) => {
1010
filter: SHOW_ALL,
1111
onClearCompleted: jest.fn(),
1212
},
13-
propOverrides
13+
propOverrides,
1414
);
1515

1616
const { rerender } = render(<Footer {...props} />);

resources/todomvc/architecture-examples/react-redux/src/components/main.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ const setup = (propOverrides) => {
3636
activeCount,
3737
visibleTodos,
3838
},
39-
propOverrides
39+
propOverrides,
4040
);
4141

4242
const { rerender } = render(
4343
<HashRouter>
4444
<WrappedComponent {...props} />
45-
</HashRouter>
45+
</HashRouter>,
4646
);
4747

4848
return {

resources/todomvc/architecture-examples/react-redux/src/components/text-input.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const setup = (propOverrides) => {
1111
editing: false,
1212
newTodo: false,
1313
},
14-
propOverrides
14+
propOverrides,
1515
);
1616

1717
const { rerender } = render(<TextInput {...props} />);

resources/todomvc/architecture-examples/react-redux/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ render(
1414
<Route path="*" component={App} />
1515
</HashRouter>
1616
</Provider>,
17-
document.getElementById("root")
17+
document.getElementById("root"),
1818
);

resources/todomvc/architecture-examples/react-redux/src/reducers/todos.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("todos reducer", () => {
1111
todos([], {
1212
type: types.ADD_TODO,
1313
text: "Run the tests",
14-
})
14+
}),
1515
).toMatchObject([
1616
{
1717
completed: false,
@@ -31,8 +31,8 @@ describe("todos reducer", () => {
3131
{
3232
type: types.ADD_TODO,
3333
text: "Run the tests",
34-
}
35-
)
34+
},
35+
),
3636
).toMatchObject([
3737
{
3838
completed: false,
@@ -61,8 +61,8 @@ describe("todos reducer", () => {
6161
{
6262
type: types.ADD_TODO,
6363
text: "Fix the tests",
64-
}
65-
)
64+
},
65+
),
6666
).toMatchObject([
6767
{
6868
text: "Use Redux",
@@ -97,8 +97,8 @@ describe("todos reducer", () => {
9797
{
9898
type: types.DELETE_TODO,
9999
id: 1,
100-
}
101-
)
100+
},
101+
),
102102
).toEqual([
103103
{
104104
text: "Use Redux",
@@ -127,8 +127,8 @@ describe("todos reducer", () => {
127127
type: types.EDIT_TODO,
128128
text: "Fix the tests",
129129
id: 1,
130-
}
131-
)
130+
},
131+
),
132132
).toEqual([
133133
{
134134
text: "Fix the tests",
@@ -161,8 +161,8 @@ describe("todos reducer", () => {
161161
{
162162
type: types.TOGGLE_TODO,
163163
id: 1,
164-
}
165-
)
164+
},
165+
),
166166
).toEqual([
167167
{
168168
text: "Run the tests",
@@ -194,8 +194,8 @@ describe("todos reducer", () => {
194194
],
195195
{
196196
type: types.TOGGLE_ALL,
197-
}
198-
)
197+
},
198+
),
199199
).toMatchObject([
200200
{
201201
text: "Run the tests",
@@ -226,8 +226,8 @@ describe("todos reducer", () => {
226226
],
227227
{
228228
type: types.TOGGLE_ALL,
229-
}
230-
)
229+
},
230+
),
231231
).toEqual([
232232
{
233233
text: "Run the tests",
@@ -259,8 +259,8 @@ describe("todos reducer", () => {
259259
],
260260
{
261261
type: types.CLEAR_COMPLETED,
262-
}
263-
)
262+
},
263+
),
264264
).toEqual([
265265
{
266266
text: "Use Redux",
@@ -295,7 +295,7 @@ describe("todos reducer", () => {
295295
completed: false,
296296
text: "Write tests",
297297
},
298-
])
298+
]),
299299
).toMatchObject([
300300
{
301301
text: "Write tests",

resources/todomvc/architecture-examples/react/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ render(
1111
<Route path="*" element={<App />} />
1212
</Routes>
1313
</HashRouter>,
14-
document.getElementById("root")
14+
document.getElementById("root"),
1515
);

resources/todomvc/architecture-examples/react/src/todo/components/input.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function Input({ onSubmit, placeholder, label, defaultValue, onBlur }) {
3535
e.target.value = "";
3636
}
3737
},
38-
[onSubmit]
38+
[onSubmit],
3939
);
4040

4141
return (

resources/todomvc/architecture-examples/react/src/todo/components/item.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const Item = memo(function Item({ todo, dispatch, index }) {
2828

2929
setIsWritable(false);
3030
},
31-
[id, removeItem, updateItem]
31+
[id, removeItem, updateItem],
3232
);
3333

3434
return (

resources/todomvc/architecture-examples/react/src/todo/components/main.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function Main({ todos, dispatch }) {
1818

1919
return todo;
2020
}),
21-
[todos, route]
21+
[todos, route],
2222
);
2323

2424
const toggleAll = useCallback((e) => dispatch({ type: "TOGGLE_ALL", payload: { completed: e.target.checked } }), [dispatch]);

resources/todomvc/big-dom-generator/src/components/popovers/backlog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const BacklogPopOver = ({ className }) => {
2727
</button>
2828
</ActionGroup>
2929
</div>
30-
</li>
30+
</li>,
3131
);
3232
}
3333

resources/todomvc/big-dom-generator/src/components/popovers/popover.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const OptionsPopOver = ({ numOptions, className, startRight }) => {
2929
options.push(
3030
<li key={i} className="spectrum-Menu-item" role="menuitem" tabIndex="0">
3131
<span className="spectrum-Menu-itemLabel">Hidden Option {i}</span>
32-
</li>
32+
</li>,
3333
);
3434
}
3535
const classNamePopOver = classnames("spectrum-Popover", { "spectrum-Popover--bottom": !startRight }, { "spectrum-Popover--bottom-right": startRight }, className);

resources/todomvc/vanilla-examples/javascript-es5/src/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}
5858

5959
return true;
60-
})
60+
}),
6161
);
6262
};
6363

resources/todomvc/vanilla-examples/javascript-es6-webpack/src/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class Store {
5656
}
5757

5858
return true;
59-
})
59+
}),
6060
);
6161
}
6262

resources/todomvc/vanilla-examples/javascript-web-components/src/components/todo-item/todo-item.component.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class TodoItem extends HTMLElement {
9494
new CustomEvent("toggle-item", {
9595
detail: { id: this.itemid, completed: this.toggleInput.checked },
9696
bubbles: true,
97-
})
97+
}),
9898
);
9999
}
100100

@@ -105,7 +105,7 @@ class TodoItem extends HTMLElement {
105105
new CustomEvent("remove-item", {
106106
detail: { id: this.itemid },
107107
bubbles: true,
108-
})
108+
}),
109109
);
110110
this.remove();
111111
}
@@ -120,7 +120,7 @@ class TodoItem extends HTMLElement {
120120
new CustomEvent("update-item", {
121121
detail: { id: this.itemid, title: event.target.value },
122122
bubbles: true,
123-
})
123+
}),
124124
);
125125
}
126126
}
@@ -173,7 +173,7 @@ class TodoItem extends HTMLElement {
173173
callbacks: {
174174
[" "]: this.startEdit, // this feels weird
175175
},
176-
})
176+
}),
177177
);
178178

179179
this.addListeners();

resources/todomvc/vanilla-examples/javascript-web-components/src/components/todo-topbar/todo-topbar.component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TodoTopbar extends HTMLElement {
3636
this.dispatchEvent(
3737
new CustomEvent("toggle-all", {
3838
detail: { completed: event.target.checked },
39-
})
39+
}),
4040
);
4141
}
4242

@@ -51,7 +51,7 @@ class TodoTopbar extends HTMLElement {
5151
title: event.target.value,
5252
completed: false,
5353
},
54-
})
54+
}),
5555
);
5656

5757
event.target.value = "";
@@ -112,7 +112,7 @@ class TodoTopbar extends HTMLElement {
112112
callbacks: {
113113
["Enter"]: this.addItem,
114114
},
115-
})
115+
}),
116116
);
117117

118118
this.updateDisplay();

0 commit comments

Comments
 (0)