diff --git a/.vscode/settings.json b/.vscode/settings.json index 8ce3c2d3..72f403af 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,3 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true, - "cSpell.words": ["Konva"] + "cSpell.words": ["Konva"] } diff --git a/integration_tests/fixtures/index.ts b/integration_tests/fixtures/index.ts index c436e254..ad184932 100644 --- a/integration_tests/fixtures/index.ts +++ b/integration_tests/fixtures/index.ts @@ -12,10 +12,10 @@ type Fixtures = { registerPage: RegisterPage; openProjectPage: (id: string) => Promise; openTestVariationListPage: ( - projectId: string + projectId: string, ) => Promise; openTestVariationDetailsPage: ( - id: string + id: string, ) => Promise; projectListPage: ProjectListPage; profilePage: ProfilePage; @@ -95,8 +95,8 @@ export const test = base.extend({ apiKey: "ASJDHGAKJSDGASD", role: "admin", token: "eyJsgOE8Bw2bFwhZAugRRGm8U", - }) - ) + }), + ), ); await use(); diff --git a/integration_tests/test/projectList.spec.ts b/integration_tests/test/projectList.spec.ts index 308262ba..19e9ca61 100644 --- a/integration_tests/test/projectList.spec.ts +++ b/integration_tests/test/projectList.spec.ts @@ -21,6 +21,6 @@ test("can delete project", async ({ projectListPage, page }) => { await projectListPage.modal.confirmBtn.click(); await expect(projectListPage.notification.message).toHaveText( - "Project name deleted" + "Project name deleted", ); }); diff --git a/integration_tests/utils/mocks.ts b/integration_tests/utils/mocks.ts index 348dd93c..8d2cf965 100644 --- a/integration_tests/utils/mocks.ts +++ b/integration_tests/utils/mocks.ts @@ -24,14 +24,14 @@ export const mockDeleteProject = async (page: Page, project: Project) => { route.fulfill({ status: 200, body: JSON.stringify(project), - }) + }), ); }; export const mockGetBuilds = async ( page: Page, projectId: string, - builds: Build[] + builds: Build[], ) => { return page.route( `${API_URL}/builds?projectId=${projectId}&take=10&skip=0`, @@ -43,7 +43,7 @@ export const mockGetBuilds = async ( take: 10, total: 3, }), - }) + }), ); }; @@ -51,19 +51,19 @@ export const mockGetBuildDetails = async (page: Page, build: Build) => { return page.route(`${API_URL}/builds/${build.id}`, (route) => route.fulfill({ body: JSON.stringify(build), - }) + }), ); }; export const mockGetTestRuns = async ( page: Page, buildId: string, - testRuns: TestRun[] + testRuns: TestRun[], ) => { return page.route(`${API_URL}/test-runs?buildId=${buildId}`, (route) => route.fulfill({ body: JSON.stringify(testRuns), - }) + }), ); }; @@ -71,7 +71,7 @@ export const mockTestRun = async (page: Page, testRun: TestRun) => { return page.route(`${API_URL}/test-runs/${testRun.id}`, (route) => route.fulfill({ body: JSON.stringify(testRun), - }) + }), ); }; @@ -79,7 +79,7 @@ export const mockImage = async (page: Page, image: string) => { return page.route(`${API_URL}/${image}`, (route) => route.fulfill({ path: `integration_tests/images/${image}`, - }) + }), ); }; @@ -87,33 +87,33 @@ export const mockGetUsers = async (page: Page, users: User[]) => { return page.route(`${API_URL}/users/all`, (route) => route.fulfill({ body: JSON.stringify(users), - }) + }), ); }; export const mockGetTestVariations = async ( page: Page, projectId: string, - testVariations: TestVariation[] + testVariations: TestVariation[], ) => { return page.route( `${API_URL}/test-variations?projectId=${projectId}`, (route) => route.fulfill({ body: JSON.stringify(testVariations), - }) + }), ); }; export const mockGetTestVariationDetails = async ( page: Page, - testVariation: TestVariation + testVariation: TestVariation, ) => { return page.route( `${API_URL}/test-variations/details/${testVariation.id}`, (route) => route.fulfill({ body: JSON.stringify(testVariation), - }) + }), ); }; diff --git a/jest.transform-nothing.js b/jest.transform-nothing.js index 7c645e42..ff8b4c56 100644 --- a/jest.transform-nothing.js +++ b/jest.transform-nothing.js @@ -1 +1 @@ -export default {}; \ No newline at end of file +export default {}; diff --git a/package.json b/package.json index 6824fcf3..aac05629 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "scripts": { "start": "node generate-env-browser.js && cp env-config.js ./public/ && vite", "test": "jest", + "format": "prettier --write integration_tests src *.js *.ts *.md", "build": "vite build", "lint": "eslint --ignore-path .gitignore . --ext .ts,.tsx,.jsx,.js", "typescheck": "tsc --noEmit", diff --git a/src/components/BaseModal.tsx b/src/components/BaseModal.tsx index 13608821..183f9815 100644 --- a/src/components/BaseModal.tsx +++ b/src/components/BaseModal.tsx @@ -39,11 +39,7 @@ export const BaseModal: React.FunctionComponent = ({ - diff --git a/src/components/BuildList/index.tsx b/src/components/BuildList/index.tsx index 905b4096..04422a95 100644 --- a/src/components/BuildList/index.tsx +++ b/src/components/BuildList/index.tsx @@ -50,7 +50,7 @@ const useStyles = makeStyles((theme: Theme) => visibility: "inherit", }, }, - }) + }), ); const BuildList: FunctionComponent = () => { @@ -69,7 +69,7 @@ const BuildList: FunctionComponent = () => { const handleMenuClick = ( event: React.MouseEvent, - build: Build + build: Build, ) => { event.stopPropagation(); setAnchorEl(event.currentTarget); @@ -90,7 +90,7 @@ const BuildList: FunctionComponent = () => { const selectBuildCalback = React.useCallback( (id?: string) => navigate(buildTestRunLocation(id)), - [navigate] + [navigate], ); const handlePaginationChange = React.useCallback( @@ -106,11 +106,11 @@ const BuildList: FunctionComponent = () => { .catch((err: string) => enqueueSnackbar(err, { variant: "error", - }) + }), ); } }, - [buildDispatch, enqueueSnackbar, selectedProjectId, take] + [buildDispatch, enqueueSnackbar, selectedProjectId, take], ); React.useEffect(() => { @@ -215,12 +215,12 @@ const BuildList: FunctionComponent = () => { .then((b) => enqueueSnackbar(`${menuBuild.id} finished`, { variant: "success", - }) + }), ) .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); handleMenuClose(); }} @@ -273,7 +273,7 @@ const BuildList: FunctionComponent = () => { .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); handleMenuClose(); }} @@ -298,7 +298,7 @@ const BuildList: FunctionComponent = () => { `Build #${menuBuild.number || menuBuild.id} deleted`, { variant: "success", - } + }, ); }) .then(() => handlePaginationChange(paginationPage)) @@ -310,7 +310,7 @@ const BuildList: FunctionComponent = () => { .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); handleMenuClose(); }} diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 64780de0..407c182f 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -24,10 +24,10 @@ import { const Header: FunctionComponent = () => { const [avatarMenuRef, setAvatarMenuRef] = React.useState( - null + null, ); const [helpMenuRef, setHelpMenuRef] = React.useState( - null + null, ); const { loggedIn, user } = useUserState(); const authDispatch = useUserDispatch(); @@ -46,7 +46,7 @@ const Header: FunctionComponent = () => { handleMenuClose(); window.open( "https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/new", - "_blank" + "_blank", ); }; diff --git a/src/components/LoginForm.tsx b/src/components/LoginForm.tsx index 67b79d80..8c9ab8fd 100644 --- a/src/components/LoginForm.tsx +++ b/src/components/LoginForm.tsx @@ -32,7 +32,7 @@ const LoginForm = () => { .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); }; diff --git a/src/components/RegisterForm.tsx b/src/components/RegisterForm.tsx index 448645d2..1cff87cf 100644 --- a/src/components/RegisterForm.tsx +++ b/src/components/RegisterForm.tsx @@ -35,7 +35,7 @@ const RegisterForm = () => { .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); }; diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 8c5476b4..80660ef2 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -51,12 +51,12 @@ const ProfilePage = () => { .then(() => enqueueSnackbar("User updated", { variant: "success", - }) + }), ) .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); } }; @@ -72,12 +72,12 @@ const ProfilePage = () => { .then(() => enqueueSnackbar("Password updated", { variant: "success", - }) + }), ) .catch((err) => enqueueSnackbar(err, { variant: "error", - }) + }), ); } }; @@ -110,7 +110,7 @@ const ProfilePage = () => { inputProps={{ onChange: (event: any) => setFirstName( - (event.target as HTMLInputElement).value + (event.target as HTMLInputElement).value, ), "data-testId": "firstName", }} @@ -131,7 +131,7 @@ const ProfilePage = () => { inputProps={{ onChange: (event: any) => setLastName( - (event.target as HTMLInputElement).value + (event.target as HTMLInputElement).value, ), "data-testId": "lastName", }} @@ -152,7 +152,7 @@ const ProfilePage = () => { inputProps={{ onChange: (event: any) => setEmail( - (event.target as HTMLInputElement).value + (event.target as HTMLInputElement).value, ), "data-testId": "email", }} @@ -217,7 +217,7 @@ const ProfilePage = () => { inputProps={{ onChange: (event: any) => setPassword( - (event.target as HTMLInputElement).value + (event.target as HTMLInputElement).value, ), "data-testId": "password", }} @@ -268,7 +268,7 @@ const ProfilePage = () => { textColor="primary" onChange={( event: React.ChangeEvent<{}>, - newValue: number + newValue: number, ) => { setTabIndex(newValue); }} diff --git a/vite.config.ts b/vite.config.ts index a031edb0..b76ed95d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import {defineConfig} from "vite"; +import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; @@ -17,18 +17,18 @@ function manualChunks(id : string) { // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], - build: { - outDir: 'build', - sourcemap: true, + plugins: [react()], + build: { + outDir: "build", + sourcemap: true, - // https://rollupjs.org/configuration-options/ - /* + // https://rollupjs.org/configuration-options/ + /* rollupOptions: { output: { manualChunks: manualChunks } } */ - } + }, });