Skip to content

Commit

Permalink
Add dangling commas to functions (new prettier default)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienw committed Mar 7, 2024
1 parent eff6a5a commit 572701f
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 47 deletions.
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"printWidth": 250,
"tabWidth": 4,
"trailingComma": "es5"
"tabWidth": 4
}
2 changes: 1 addition & 1 deletion resources/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MainBenchmarkClient {
message,
params.suites,
"\nValid values:",
Suites.map((each) => each.name)
Suites.map((each) => each.name),
);

return false;
Expand Down
2 changes: 1 addition & 1 deletion resources/metric-ui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function renderMetricView(viewParams) {
<td>±</td>
<td>${metric.deltaString}</td>
<td>${metric.unit}</td>
</tr>`
</tr>`,
)
.join("");
return `
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/sanitize-language/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function getFiles(dir) {
dirents.map((dirent) => {
const res = resolve(dir, dirent.name);
return dirent.isDirectory() ? getFiles(res) : res;
})
}),
);
return Array.prototype.concat(...files);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TodosService } from "../todos.service";
export class TodoFooterComponent {
constructor(
private todosService: TodosService,
private location: Location
private location: Location,
) {}

get todos(): Todo[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TodosService } from "../todos.service";
export class TodoListComponent {
constructor(
private todosService: TodosService,
private location: Location
private location: Location,
) {}

get todos(): Todo[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var app = app || {};
this.statsTemplate({
completed: completed,
remaining: remaining,
})
}),
);

this.$(".filters li a")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class TodoList extends LitElement {
${repeat(
this.todoList?.filtered() ?? [],
(todo) => todo.id,
(todo, index) => html`<todo-item data-priority=${4 - (index % 5)} .todoId=${todo.id} .text=${todo.text} .completed=${todo.completed}></todo-item>`
(todo, index) => html`<todo-item data-priority=${4 - (index % 5)} .todoId=${todo.id} .text=${todo.text} .completed=${todo.completed}></todo-item>`,
)}
</ul>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const setup = (propOverrides) => {
filter: SHOW_ALL,
onClearCompleted: jest.fn(),
},
propOverrides
propOverrides,
);

const { rerender } = render(<Footer {...props} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ const setup = (propOverrides) => {
activeCount,
visibleTodos,
},
propOverrides
propOverrides,
);

const { rerender } = render(
<HashRouter>
<WrappedComponent {...props} />
</HashRouter>
</HashRouter>,
);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const setup = (propOverrides) => {
editing: false,
newTodo: false,
},
propOverrides
propOverrides,
);

const { rerender } = render(<TextInput {...props} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ render(
<Route path="*" component={App} />
</HashRouter>
</Provider>,
document.getElementById("root")
document.getElementById("root"),
);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("todos reducer", () => {
todos([], {
type: types.ADD_TODO,
text: "Run the tests",
})
}),
).toMatchObject([
{
completed: false,
Expand All @@ -31,8 +31,8 @@ describe("todos reducer", () => {
{
type: types.ADD_TODO,
text: "Run the tests",
}
)
},
),
).toMatchObject([
{
completed: false,
Expand Down Expand Up @@ -61,8 +61,8 @@ describe("todos reducer", () => {
{
type: types.ADD_TODO,
text: "Fix the tests",
}
)
},
),
).toMatchObject([
{
text: "Use Redux",
Expand Down Expand Up @@ -97,8 +97,8 @@ describe("todos reducer", () => {
{
type: types.DELETE_TODO,
id: 1,
}
)
},
),
).toEqual([
{
text: "Use Redux",
Expand Down Expand Up @@ -127,8 +127,8 @@ describe("todos reducer", () => {
type: types.EDIT_TODO,
text: "Fix the tests",
id: 1,
}
)
},
),
).toEqual([
{
text: "Fix the tests",
Expand Down Expand Up @@ -161,8 +161,8 @@ describe("todos reducer", () => {
{
type: types.TOGGLE_TODO,
id: 1,
}
)
},
),
).toEqual([
{
text: "Run the tests",
Expand Down Expand Up @@ -194,8 +194,8 @@ describe("todos reducer", () => {
],
{
type: types.TOGGLE_ALL,
}
)
},
),
).toMatchObject([
{
text: "Run the tests",
Expand Down Expand Up @@ -226,8 +226,8 @@ describe("todos reducer", () => {
],
{
type: types.TOGGLE_ALL,
}
)
},
),
).toEqual([
{
text: "Run the tests",
Expand Down Expand Up @@ -259,8 +259,8 @@ describe("todos reducer", () => {
],
{
type: types.CLEAR_COMPLETED,
}
)
},
),
).toEqual([
{
text: "Use Redux",
Expand Down Expand Up @@ -295,7 +295,7 @@ describe("todos reducer", () => {
completed: false,
text: "Write tests",
},
])
]),
).toMatchObject([
{
text: "Write tests",
Expand Down
2 changes: 1 addition & 1 deletion resources/todomvc/architecture-examples/react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ render(
<Route path="*" element={<App />} />
</Routes>
</HashRouter>,
document.getElementById("root")
document.getElementById("root"),
);
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function Input({ onSubmit, placeholder, label, defaultValue, onBlur }) {
e.target.value = "";
}
},
[onSubmit]
[onSubmit],
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Item = memo(function Item({ todo, dispatch, index }) {

setIsWritable(false);
},
[id, removeItem, updateItem]
[id, removeItem, updateItem],
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Main({ todos, dispatch }) {

return todo;
}),
[todos, route]
[todos, route],
);

const toggleAll = useCallback((e) => dispatch({ type: "TOGGLE_ALL", payload: { completed: e.target.checked } }), [dispatch]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const BacklogPopOver = ({ className }) => {
</button>
</ActionGroup>
</div>
</li>
</li>,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const OptionsPopOver = ({ numOptions, className, startRight }) => {
options.push(
<li key={i} className="spectrum-Menu-item" role="menuitem" tabIndex="0">
<span className="spectrum-Menu-itemLabel">Hidden Option {i}</span>
</li>
</li>,
);
}
const classNamePopOver = classnames("spectrum-Popover", { "spectrum-Popover--bottom": !startRight }, { "spectrum-Popover--bottom-right": startRight }, className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}

return true;
})
}),
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Store {
}

return true;
})
}),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TodoItem extends HTMLElement {
new CustomEvent("toggle-item", {
detail: { id: this.itemid, completed: this.toggleInput.checked },
bubbles: true,
})
}),
);
}

Expand All @@ -105,7 +105,7 @@ class TodoItem extends HTMLElement {
new CustomEvent("remove-item", {
detail: { id: this.itemid },
bubbles: true,
})
}),
);
this.remove();
}
Expand All @@ -120,7 +120,7 @@ class TodoItem extends HTMLElement {
new CustomEvent("update-item", {
detail: { id: this.itemid, title: event.target.value },
bubbles: true,
})
}),
);
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ class TodoItem extends HTMLElement {
callbacks: {
[" "]: this.startEdit, // this feels weird
},
})
}),
);

this.addListeners();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TodoTopbar extends HTMLElement {
this.dispatchEvent(
new CustomEvent("toggle-all", {
detail: { completed: event.target.checked },
})
}),
);
}

Expand All @@ -51,7 +51,7 @@ class TodoTopbar extends HTMLElement {
title: event.target.value,
completed: false,
},
})
}),
);

event.target.value = "";
Expand Down Expand Up @@ -112,7 +112,7 @@ class TodoTopbar extends HTMLElement {
callbacks: {
["Enter"]: this.addItem,
},
})
}),
);

this.updateDisplay();
Expand Down

0 comments on commit 572701f

Please sign in to comment.