Skip to content

Commit b3976e8

Browse files
authored
Run Prettier from command line and remove VS Code plugin which provides inconsistent fromatting (#322)
1 parent 9c8ef39 commit b3976e8

File tree

13 files changed

+54
-59
lines changed

13 files changed

+54
-59
lines changed

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.formatOnSave": true,
4-
"cSpell.words": ["Konva"]
2+
"cSpell.words": ["Konva"]
53
}

integration_tests/fixtures/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ type Fixtures = {
1212
registerPage: RegisterPage;
1313
openProjectPage: (id: string) => Promise<ProjectPage>;
1414
openTestVariationListPage: (
15-
projectId: string
15+
projectId: string,
1616
) => Promise<TestVariationListPage>;
1717
openTestVariationDetailsPage: (
18-
id: string
18+
id: string,
1919
) => Promise<TestVariationDetailsPage>;
2020
projectListPage: ProjectListPage;
2121
profilePage: ProfilePage;
@@ -95,8 +95,8 @@ export const test = base.extend<Fixtures>({
9595
apiKey: "ASJDHGAKJSDGASD",
9696
role: "admin",
9797
token: "eyJsgOE8Bw2bFwhZAugRRGm8U",
98-
})
99-
)
98+
}),
99+
),
100100
);
101101

102102
await use();

integration_tests/test/projectList.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ test("can delete project", async ({ projectListPage, page }) => {
2121
await projectListPage.modal.confirmBtn.click();
2222

2323
await expect(projectListPage.notification.message).toHaveText(
24-
"Project name deleted"
24+
"Project name deleted",
2525
);
2626
});

integration_tests/utils/mocks.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ export const mockDeleteProject = async (page: Page, project: Project) => {
2424
route.fulfill({
2525
status: 200,
2626
body: JSON.stringify(project),
27-
})
27+
}),
2828
);
2929
};
3030

3131
export const mockGetBuilds = async (
3232
page: Page,
3333
projectId: string,
34-
builds: Build[]
34+
builds: Build[],
3535
) => {
3636
return page.route(
3737
`${API_URL}/builds?projectId=${projectId}&take=10&skip=0`,
@@ -43,77 +43,77 @@ export const mockGetBuilds = async (
4343
take: 10,
4444
total: 3,
4545
}),
46-
})
46+
}),
4747
);
4848
};
4949

5050
export const mockGetBuildDetails = async (page: Page, build: Build) => {
5151
return page.route(`${API_URL}/builds/${build.id}`, (route) =>
5252
route.fulfill({
5353
body: JSON.stringify(build),
54-
})
54+
}),
5555
);
5656
};
5757

5858
export const mockGetTestRuns = async (
5959
page: Page,
6060
buildId: string,
61-
testRuns: TestRun[]
61+
testRuns: TestRun[],
6262
) => {
6363
return page.route(`${API_URL}/test-runs?buildId=${buildId}`, (route) =>
6464
route.fulfill({
6565
body: JSON.stringify(testRuns),
66-
})
66+
}),
6767
);
6868
};
6969

7070
export const mockTestRun = async (page: Page, testRun: TestRun) => {
7171
return page.route(`${API_URL}/test-runs/${testRun.id}`, (route) =>
7272
route.fulfill({
7373
body: JSON.stringify(testRun),
74-
})
74+
}),
7575
);
7676
};
7777

7878
export const mockImage = async (page: Page, image: string) => {
7979
return page.route(`${API_URL}/${image}`, (route) =>
8080
route.fulfill({
8181
path: `integration_tests/images/${image}`,
82-
})
82+
}),
8383
);
8484
};
8585

8686
export const mockGetUsers = async (page: Page, users: User[]) => {
8787
return page.route(`${API_URL}/users/all`, (route) =>
8888
route.fulfill({
8989
body: JSON.stringify(users),
90-
})
90+
}),
9191
);
9292
};
9393

9494
export const mockGetTestVariations = async (
9595
page: Page,
9696
projectId: string,
97-
testVariations: TestVariation[]
97+
testVariations: TestVariation[],
9898
) => {
9999
return page.route(
100100
`${API_URL}/test-variations?projectId=${projectId}`,
101101
(route) =>
102102
route.fulfill({
103103
body: JSON.stringify(testVariations),
104-
})
104+
}),
105105
);
106106
};
107107

108108
export const mockGetTestVariationDetails = async (
109109
page: Page,
110-
testVariation: TestVariation
110+
testVariation: TestVariation,
111111
) => {
112112
return page.route(
113113
`${API_URL}/test-variations/details/${testVariation.id}`,
114114
(route) =>
115115
route.fulfill({
116116
body: JSON.stringify(testVariation),
117-
})
117+
}),
118118
);
119119
};

jest.transform-nothing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default {};
1+
export default {};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"scripts": {
4242
"start": "node generate-env-browser.js && cp env-config.js ./public/ && vite",
4343
"test": "jest",
44+
"format": "prettier --write integration_tests src *.js *.ts *.md",
4445
"build": "vite build",
4546
"lint": "eslint --ignore-path .gitignore . --ext .ts,.tsx,.jsx,.js",
4647
"typescheck": "tsc --noEmit",

src/components/BaseModal.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ export const BaseModal: React.FunctionComponent<IProps> = ({
3939
<Button onClick={onCancel} color="primary">
4040
Cancel
4141
</Button>
42-
<Button
43-
type="submit"
44-
color="primary"
45-
data-testId="submitButton"
46-
>
42+
<Button type="submit" color="primary" data-testId="submitButton">
4743
{submitButtonText}
4844
</Button>
4945
</DialogActions>

src/components/BuildList/index.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const useStyles = makeStyles((theme: Theme) =>
5050
visibility: "inherit",
5151
},
5252
},
53-
})
53+
}),
5454
);
5555

5656
const BuildList: FunctionComponent = () => {
@@ -69,7 +69,7 @@ const BuildList: FunctionComponent = () => {
6969

7070
const handleMenuClick = (
7171
event: React.MouseEvent<HTMLElement>,
72-
build: Build
72+
build: Build,
7373
) => {
7474
event.stopPropagation();
7575
setAnchorEl(event.currentTarget);
@@ -90,7 +90,7 @@ const BuildList: FunctionComponent = () => {
9090

9191
const selectBuildCalback = React.useCallback(
9292
(id?: string) => navigate(buildTestRunLocation(id)),
93-
[navigate]
93+
[navigate],
9494
);
9595

9696
const handlePaginationChange = React.useCallback(
@@ -106,11 +106,11 @@ const BuildList: FunctionComponent = () => {
106106
.catch((err: string) =>
107107
enqueueSnackbar(err, {
108108
variant: "error",
109-
})
109+
}),
110110
);
111111
}
112112
},
113-
[buildDispatch, enqueueSnackbar, selectedProjectId, take]
113+
[buildDispatch, enqueueSnackbar, selectedProjectId, take],
114114
);
115115

116116
React.useEffect(() => {
@@ -215,12 +215,12 @@ const BuildList: FunctionComponent = () => {
215215
.then((b) =>
216216
enqueueSnackbar(`${menuBuild.id} finished`, {
217217
variant: "success",
218-
})
218+
}),
219219
)
220220
.catch((err) =>
221221
enqueueSnackbar(err, {
222222
variant: "error",
223-
})
223+
}),
224224
);
225225
handleMenuClose();
226226
}}
@@ -273,7 +273,7 @@ const BuildList: FunctionComponent = () => {
273273
.catch((err) =>
274274
enqueueSnackbar(err, {
275275
variant: "error",
276-
})
276+
}),
277277
);
278278
handleMenuClose();
279279
}}
@@ -298,7 +298,7 @@ const BuildList: FunctionComponent = () => {
298298
`Build #${menuBuild.number || menuBuild.id} deleted`,
299299
{
300300
variant: "success",
301-
}
301+
},
302302
);
303303
})
304304
.then(() => handlePaginationChange(paginationPage))
@@ -310,7 +310,7 @@ const BuildList: FunctionComponent = () => {
310310
.catch((err) =>
311311
enqueueSnackbar(err, {
312312
variant: "error",
313-
})
313+
}),
314314
);
315315
handleMenuClose();
316316
}}

src/components/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {
2424

2525
const Header: FunctionComponent = () => {
2626
const [avatarMenuRef, setAvatarMenuRef] = React.useState<null | HTMLElement>(
27-
null
27+
null,
2828
);
2929
const [helpMenuRef, setHelpMenuRef] = React.useState<null | HTMLElement>(
30-
null
30+
null,
3131
);
3232
const { loggedIn, user } = useUserState();
3333
const authDispatch = useUserDispatch();
@@ -46,7 +46,7 @@ const Header: FunctionComponent = () => {
4646
handleMenuClose();
4747
window.open(
4848
"https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/new",
49-
"_blank"
49+
"_blank",
5050
);
5151
};
5252

src/components/LoginForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const LoginForm = () => {
3232
.catch((err) =>
3333
enqueueSnackbar(err, {
3434
variant: "error",
35-
})
35+
}),
3636
);
3737
};
3838

0 commit comments

Comments
 (0)