From 3ded3feb9d65697de826778638660d3eafd89a06 Mon Sep 17 00:00:00 2001 From: Krizza B <29673385+sirbully@users.noreply.github.com> Date: Sat, 6 Jul 2024 22:51:50 +0900 Subject: [PATCH 1/3] vite-bundle-visualizer (#52) --- package-lock.json | 315 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 +- 2 files changed, 319 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb9132e..70a2647 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "lint-staged": "15.2.2", "typescript": "5.2.2", "vite": "5.2.6", + "vite-bundle-visualizer": "1.2.1", "vitest": "1.5.0" } }, @@ -3058,6 +3059,99 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/clsx": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", @@ -3310,6 +3404,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -4254,6 +4357,15 @@ "node": ">=6.9.0" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-east-asian-width": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", @@ -4657,6 +4769,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-from-esm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.4.tgz", + "integrity": "sha512-7EyUlPFC0HOlBDpUFGfYstsU7XHxZJKAAMzCT8wZ0hMW7b+hG51LIKTDcsgtz8Pu6YC0HqRVbX+rVUtsGMUKvg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=16.20" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -4820,6 +4955,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5082,6 +5232,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -5902,6 +6064,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -6413,6 +6592,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -6554,6 +6742,41 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-visualizer": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.12.0.tgz", + "integrity": "sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==", + "dev": true, + "dependencies": { + "open": "^8.4.0", + "picomatch": "^2.3.1", + "source-map": "^0.7.4", + "yargs": "^17.5.1" + }, + "bin": { + "rollup-plugin-visualizer": "dist/bin/cli.js" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "rollup": "2.x || 3.x || 4.x" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/rollup-plugin-visualizer/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", @@ -7189,6 +7412,15 @@ "node": ">=14.0.0" } }, + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "engines": { + "node": ">=14.14" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -7517,6 +7749,24 @@ } } }, + "node_modules/vite-bundle-visualizer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vite-bundle-visualizer/-/vite-bundle-visualizer-1.2.1.tgz", + "integrity": "sha512-cwz/Pg6+95YbgIDp+RPwEToc4TKxfsFWSG/tsl2DSZd9YZicUag1tQXjJ5xcL7ydvEoaC2FOZeaXOU60t9BRXw==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "import-from-esm": "^1.3.3", + "rollup-plugin-visualizer": "^5.11.0", + "tmp": "^0.2.1" + }, + "bin": { + "vite-bundle-visualizer": "bin.js" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + } + }, "node_modules/vite-node": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.0.tgz", @@ -7870,6 +8120,15 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "devOptional": true }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -7883,6 +8142,62 @@ "node": ">= 6" } }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index f2e6f1b..f96c92a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "test": "vitest", "test:ui": "vitest --ui", "test:e2e": "npx playwright test", - "test:e2e:ui": "npx playwright test --ui" + "test:e2e:ui": "npx playwright test --ui", + "visualize": "vite-bundle-visualizer --port 5000" }, "lint-staged": { "*.{ts,tsx,js,cjs}": "eslint" @@ -53,6 +54,7 @@ "lint-staged": "15.2.2", "typescript": "5.2.2", "vite": "5.2.6", + "vite-bundle-visualizer": "1.2.1", "vitest": "1.5.0" } -} \ No newline at end of file +} From 1281ab4449bb92b259175378b60d5113efc763f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ann=20Kilzer=20=E3=82=AD=E3=83=AB=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E6=9D=8F?= Date: Thu, 11 Jul 2024 12:07:22 +0900 Subject: [PATCH 2/3] 51 eslint stylistic semi rule (#53) * add semi rule * autofix semi rule --- .eslintrc.cjs | 1 + e2e/home.spec.ts | 8 +- package-lock.json | 441 +++++++++++++++++- playwright.config.ts | 4 +- src/@types/i18next.d.ts | 2 +- src/components/Footer/Footer.tsx | 14 +- src/components/Footer/FooterIcon.tsx | 2 +- src/components/Header/DesktopHeader.tsx | 12 +- src/components/Header/Header.tsx | 8 +- src/components/ImageCard/ImageCard.tsx | 2 +- src/components/LocaleToggle/LocaleToggle.tsx | 20 +- .../__test__/LocaleToggle.test.tsx | 22 +- src/components/SideDrawer/SideDrawer.tsx | 4 +- .../StyledNavLink/StyledNavLink.tsx | 4 +- src/components/TextBlock/Body1.tsx | 2 +- src/i18n/config.ts | 2 +- src/main.tsx | 10 +- src/routes/BaseLayout.tsx | 2 +- src/routes/CodeOfConduct/CodeOfConduct.tsx | 4 +- src/routes/Home/Home.tsx | 8 +- src/routes/ThemePreview/ColorSwatch.tsx | 4 +- src/routes/ThemePreview/ThemePreview.tsx | 10 +- src/tests/customRender.tsx | 8 +- src/theme/customColorConfig.ts | 2 +- src/theme/theme.ts | 6 +- src/theme/typography/default.ts | 2 +- 26 files changed, 520 insertions(+), 84 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5441443..db09b1c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -27,6 +27,7 @@ module.exports = { '@typescript-eslint/prefer-nullish-coalescing': 'off', '@typescript-eslint/no-unsafe-call': ['off'], '@stylistic/ts/indent': ['error', 4], + '@stylistic/ts/semi': ['error', 'never'], }, settings: { react: { diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts index 555f7c6..8a7ad09 100644 --- a/e2e/home.spec.ts +++ b/e2e/home.spec.ts @@ -1,8 +1,8 @@ -import { test, expect } from '@playwright/test'; +import { test, expect } from '@playwright/test' test('has title', async ({ page }) => { - await page.goto('/'); + await page.goto('/') // Expect a title "to contain" a substring. - await expect(page).toHaveTitle(/WiSE/); -}); + await expect(page).toHaveTitle(/WiSE/) +}) diff --git a/package-lock.json b/package-lock.json index 70a2647..5648b32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ }, "devDependencies": { "@playwright/test": "1.44.1", + "@stylistic/eslint-plugin": "^2.3.0", "@stylistic/eslint-plugin-ts": "1.7.2", "@testing-library/jest-dom": "6.4.2", "@testing-library/react": "15.0.2", @@ -1679,6 +1680,26 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, + "node_modules/@stylistic/eslint-plugin": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-2.3.0.tgz", + "integrity": "sha512-rtiz6u5gRyyEZp36FcF1/gHJbsbT3qAgXZ1qkad6Nr/xJ9wrSJkiSFFQhpYVTIZ7FJNRJurEcumZDCwN9dEI4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@stylistic/eslint-plugin-js": "2.3.0", + "@stylistic/eslint-plugin-jsx": "2.3.0", + "@stylistic/eslint-plugin-plus": "2.3.0", + "@stylistic/eslint-plugin-ts": "2.3.0", + "@types/eslint": "^8.56.10" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, "node_modules/@stylistic/eslint-plugin-js": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.7.2.tgz", @@ -1710,6 +1731,220 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@stylistic/eslint-plugin-jsx": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-jsx/-/eslint-plugin-jsx-2.3.0.tgz", + "integrity": "sha512-tsQ0IEKB195H6X9A4iUSgLLLKBc8gUBWkBIU8tp1/3g2l8stu+PtMQVV/VmK1+3bem5FJCyvfcZIQ/WF1fsizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@stylistic/eslint-plugin-js": "^2.3.0", + "@types/eslint": "^8.56.10", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin-jsx/node_modules/@stylistic/eslint-plugin-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.3.0.tgz", + "integrity": "sha512-lQwoiYb0Fs6Yc5QS3uT8+T9CPKK2Eoxc3H8EnYJgM26v/DgtW+1lvy2WNgyBflU+ThShZaHm3a6CdD9QeKx23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "^8.56.10", + "acorn": "^8.11.3", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin-jsx/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-jsx/node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-jsx/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@stylistic/eslint-plugin-plus": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-plus/-/eslint-plugin-plus-2.3.0.tgz", + "integrity": "sha512-xboPWGUU5yaPlR+WR57GwXEuY4PSlPqA0C3IdNA/+1o2MuBi95XgDJcZiJ9N+aXsqBXAPIpFFb+WQ7QEHo4f7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "^8.56.10", + "@typescript-eslint/utils": "^7.12.0" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/@typescript-eslint/scope-manager": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.15.0.tgz", + "integrity": "sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/@typescript-eslint/types": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.15.0.tgz", + "integrity": "sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.15.0.tgz", + "integrity": "sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/@typescript-eslint/utils": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.15.0.tgz", + "integrity": "sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.15.0", + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/typescript-estree": "7.15.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.15.0.tgz", + "integrity": "sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-plus/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@stylistic/eslint-plugin-ts": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-1.7.2.tgz", @@ -1827,6 +2062,205 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@stylistic/eslint-plugin/node_modules/@stylistic/eslint-plugin-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.3.0.tgz", + "integrity": "sha512-lQwoiYb0Fs6Yc5QS3uT8+T9CPKK2Eoxc3H8EnYJgM26v/DgtW+1lvy2WNgyBflU+ThShZaHm3a6CdD9QeKx23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "^8.56.10", + "acorn": "^8.11.3", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@stylistic/eslint-plugin-ts": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-2.3.0.tgz", + "integrity": "sha512-wqOR38/uz/0XPnHX68ftp8sNMSAqnYGjovOTN7w00xnjS6Lxr3Sk7q6AaxWWqbMvOj7V2fQiMC5HWAbTruJsCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@stylistic/eslint-plugin-js": "2.3.0", + "@types/eslint": "^8.56.10", + "@typescript-eslint/utils": "^7.12.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.15.0.tgz", + "integrity": "sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.15.0.tgz", + "integrity": "sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.15.0.tgz", + "integrity": "sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/visitor-keys": "7.15.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.15.0.tgz", + "integrity": "sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.15.0", + "@typescript-eslint/types": "7.15.0", + "@typescript-eslint/typescript-estree": "7.15.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.15.0.tgz", + "integrity": "sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.15.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@testing-library/dom": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.0.0.tgz", @@ -2575,9 +3009,10 @@ } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, diff --git a/playwright.config.ts b/playwright.config.ts index d15a1f5..be5f67d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,4 +1,4 @@ -import { defineConfig, devices } from '@playwright/test'; +import { defineConfig, devices } from '@playwright/test' /** * Read environment variables from file. @@ -74,4 +74,4 @@ export default defineConfig({ // url: 'http://127.0.0.1:3000', // reuseExistingServer: !process.env.CI, // }, -}); +}) diff --git a/src/@types/i18next.d.ts b/src/@types/i18next.d.ts index 83f8147..0c60e5e 100644 --- a/src/@types/i18next.d.ts +++ b/src/@types/i18next.d.ts @@ -1,4 +1,4 @@ -import { resources, defaultNS } from './i18n'; +import { resources, defaultNS } from './i18n' declare module 'i18next' { interface CustomTypeOptions { diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index f238086..9756a08 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,12 +1,12 @@ -import { FC } from 'react'; +import { FC } from 'react' import BottomNavigation from '@mui/material/BottomNavigation' import Paper from '@mui/material/Paper' -import InstagramIcon from '@mui/icons-material/Instagram'; -import LinkedInIcon from '@mui/icons-material/LinkedIn'; -import FacebookIcon from '@mui/icons-material/Facebook'; -import GitHubIcon from '@mui/icons-material/GitHub'; -import EventIcon from '@mui/icons-material/Event'; -import FooterIcon from './FooterIcon'; +import InstagramIcon from '@mui/icons-material/Instagram' +import LinkedInIcon from '@mui/icons-material/LinkedIn' +import FacebookIcon from '@mui/icons-material/Facebook' +import GitHubIcon from '@mui/icons-material/GitHub' +import EventIcon from '@mui/icons-material/Event' +import FooterIcon from './FooterIcon' const Footer: FC = () => { diff --git a/src/components/Footer/FooterIcon.tsx b/src/components/Footer/FooterIcon.tsx index 068b113..ca272f5 100644 --- a/src/components/Footer/FooterIcon.tsx +++ b/src/components/Footer/FooterIcon.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import { FC } from 'react' import BottomNavigationAction from '@mui/material/BottomNavigationAction' interface FooterIconProps { diff --git a/src/components/Header/DesktopHeader.tsx b/src/components/Header/DesktopHeader.tsx index 3e18361..883c1da 100644 --- a/src/components/Header/DesktopHeader.tsx +++ b/src/components/Header/DesktopHeader.tsx @@ -1,12 +1,12 @@ -import { FC } from 'react'; +import { FC } from 'react' import Stack from '@mui/material/Stack' import Toolbar from '@mui/material/Toolbar' -import Typography from '@mui/material/Typography'; -import { styled } from '@mui/material/styles'; -import SideDrawer from '../SideDrawer/SideDrawer'; +import Typography from '@mui/material/Typography' +import { styled } from '@mui/material/styles' +import SideDrawer from '../SideDrawer/SideDrawer' import StyledNavLink from '@/components/StyledNavLink/StyledNavLink' -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next' const StyledToolbar = styled(Toolbar)(({ theme }) => ({ @@ -23,7 +23,7 @@ const StyledToolbar = styled(Toolbar)(({ theme }) => ({ const DesktopHeader: FC = () => { - const { t } = useTranslation(); + const { t } = useTranslation() return diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index f980038..e99b03a 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,9 +1,9 @@ import { FC } from 'react' import AppBar from '@mui/material/AppBar' -import { useTheme } from '@mui/material/styles'; -import useMediaQuery from '@mui/material/useMediaQuery'; -import MobileHeader from './MobileHeader'; -import DesktopHeader from './DesktopHeader'; +import { useTheme } from '@mui/material/styles' +import useMediaQuery from '@mui/material/useMediaQuery' +import MobileHeader from './MobileHeader' +import DesktopHeader from './DesktopHeader' diff --git a/src/components/ImageCard/ImageCard.tsx b/src/components/ImageCard/ImageCard.tsx index bbe4c45..3287029 100644 --- a/src/components/ImageCard/ImageCard.tsx +++ b/src/components/ImageCard/ImageCard.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import { FC } from 'react' import Card from '@mui/material/Card' interface ImageCardProps { diff --git a/src/components/LocaleToggle/LocaleToggle.tsx b/src/components/LocaleToggle/LocaleToggle.tsx index a39c419..bac981a 100644 --- a/src/components/LocaleToggle/LocaleToggle.tsx +++ b/src/components/LocaleToggle/LocaleToggle.tsx @@ -1,28 +1,28 @@ import { FC, useEffect, useState, useCallback } from 'react' import ToggleButton from '@mui/material/ToggleButton' import ToggleButtonGroup from '@mui/material/ToggleButtonGroup' -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next' import Locale from '@/i18n/locales' const LocaleToggle: FC = () => { - const [locale, setLocale] = useState(Locale.EN); - const { i18n } = useTranslation(); + const [locale, setLocale] = useState(Locale.EN) + const { i18n } = useTranslation() const changeLanguage = useCallback(async (nextLocale: Locale) => { await i18n.changeLanguage(nextLocale).then(() => { - setLocale(nextLocale); - localStorage.setItem('locale', nextLocale); - }); - }, [i18n]); + setLocale(nextLocale) + localStorage.setItem('locale', nextLocale) + }) + }, [i18n]) useEffect(() => { - const savedLocale = localStorage.getItem('locale'); + const savedLocale = localStorage.getItem('locale') if (savedLocale) { changeLanguage(savedLocale as Locale).catch((e: Error) => { console.error(e) }) } - }, [changeLanguage]); + }, [changeLanguage]) const handleChange = (_: React.MouseEvent, nextLocale: Locale) => { changeLanguage(nextLocale).catch((e: Error) => { @@ -38,7 +38,7 @@ const LocaleToggle: FC = () => { English 日本語 - ); + ) } export default LocaleToggle diff --git a/src/components/LocaleToggle/__test__/LocaleToggle.test.tsx b/src/components/LocaleToggle/__test__/LocaleToggle.test.tsx index 662cef3..c4355bc 100644 --- a/src/components/LocaleToggle/__test__/LocaleToggle.test.tsx +++ b/src/components/LocaleToggle/__test__/LocaleToggle.test.tsx @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { render } from '@/tests/customRender' -import LocaleToggle from '../LocaleToggle'; +import LocaleToggle from '../LocaleToggle' import userEvent from '@testing-library/user-event' import { screen } from '@testing-library/react' @@ -8,20 +8,20 @@ describe('LocaleToggle', () => { it('renders correctly', async () => { render() - const english = await screen.findByText('English'); - const japanese = await screen.findByText('日本語'); - expect(english).toBeInTheDocument(); - expect(japanese).toBeInTheDocument(); - }); + const english = await screen.findByText('English') + const japanese = await screen.findByText('日本語') + expect(english).toBeInTheDocument() + expect(japanese).toBeInTheDocument() + }) }) it('changes locale when toggling', async () => { - render(); - const japaneseButton = screen.getByText('日本語'); + render() + const japaneseButton = screen.getByText('日本語') const user = userEvent.setup() await user.click(japaneseButton) - expect(localStorage.getItem('locale')).toBe('ja'); + expect(localStorage.getItem('locale')).toBe('ja') - localStorage.removeItem('locale'); -}); + localStorage.removeItem('locale') +}) diff --git a/src/components/SideDrawer/SideDrawer.tsx b/src/components/SideDrawer/SideDrawer.tsx index 2653624..7b0604c 100644 --- a/src/components/SideDrawer/SideDrawer.tsx +++ b/src/components/SideDrawer/SideDrawer.tsx @@ -17,11 +17,11 @@ const SideDrawer: FC = () => { ((event as React.KeyboardEvent).key === 'Tab' || (event as React.KeyboardEvent).key === 'Shift') ) { - return; + return } setOpen(open) - }; + } return <> ({ color: 'white', diff --git a/src/components/TextBlock/Body1.tsx b/src/components/TextBlock/Body1.tsx index 5f47807..0a7fe3d 100644 --- a/src/components/TextBlock/Body1.tsx +++ b/src/components/TextBlock/Body1.tsx @@ -1,5 +1,5 @@ import { FC, ReactNode } from 'react' -import Typography from '@mui/material/Typography'; +import Typography from '@mui/material/Typography' interface Body1Props { children: ReactNode diff --git a/src/i18n/config.ts b/src/i18n/config.ts index 8058636..6ede738 100644 --- a/src/i18n/config.ts +++ b/src/i18n/config.ts @@ -20,4 +20,4 @@ i18next.use(initReactI18next).init({ // if you see an error like: "Argument of type 'DefaultTFuncReturn' is not assignable to parameter of type xyz" // set returnNull to false (and also in the i18next.d.ts options) // returnNull: false, -}); +}) diff --git a/src/main.tsx b/src/main.tsx index 5dbadce..291d758 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,10 +1,10 @@ import React from 'react' import ReactDOM from 'react-dom/client' -import CssBaseline from '@mui/material/CssBaseline'; -import Router from './routes/Router'; -import GlobalStyles from '@mui/material/GlobalStyles'; -import CustomThemeProvider from './theme/CustomThemeProvider'; -import './i18n/config'; +import CssBaseline from '@mui/material/CssBaseline' +import Router from './routes/Router' +import GlobalStyles from '@mui/material/GlobalStyles' +import CustomThemeProvider from './theme/CustomThemeProvider' +import './i18n/config' import './index.css' import '@fontsource/noto-sans-jp/300.css' diff --git a/src/routes/BaseLayout.tsx b/src/routes/BaseLayout.tsx index 4d2de94..39ef169 100644 --- a/src/routes/BaseLayout.tsx +++ b/src/routes/BaseLayout.tsx @@ -10,7 +10,7 @@ const Loader = () => (
Loading...
-); +) const BaseLayout: FC = () => { return }> diff --git a/src/routes/CodeOfConduct/CodeOfConduct.tsx b/src/routes/CodeOfConduct/CodeOfConduct.tsx index 8583990..c60ed90 100644 --- a/src/routes/CodeOfConduct/CodeOfConduct.tsx +++ b/src/routes/CodeOfConduct/CodeOfConduct.tsx @@ -2,10 +2,10 @@ import { FC } from 'react' import Container from '@mui/material/Container' import Stack from '@mui/material/Stack' import { Typography } from '@mui/material' -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next' const CodeOfConduct: FC = () => { - const { t } = useTranslation(); + const { t } = useTranslation() return diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index c782008..81b0fa2 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -1,12 +1,12 @@ -import { FC } from 'react'; +import { FC } from 'react' import Stack from '@mui/material/Stack' import Container from '@mui/material/Container' -import Typography from '@mui/material/Typography'; +import Typography from '@mui/material/Typography' import Button from '@mui/material/Button' -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next' const Home: FC = () => { - const { t } = useTranslation(); + const { t } = useTranslation() return diff --git a/src/routes/ThemePreview/ColorSwatch.tsx b/src/routes/ThemePreview/ColorSwatch.tsx index dfd7933..ea2712d 100644 --- a/src/routes/ThemePreview/ColorSwatch.tsx +++ b/src/routes/ThemePreview/ColorSwatch.tsx @@ -1,5 +1,5 @@ import Paper from '@mui/material/Paper' -import { Theme, styled } from '@mui/material/styles'; +import { Theme, styled } from '@mui/material/styles' interface SwatchProps { color: string @@ -23,6 +23,6 @@ const ColorSwatch = styled(Paper)(({ theme, color }) => ({ padding: theme.spacing(4), textAlign: 'center', color: theme.palette.text.secondary, -})); +})) export default ColorSwatch diff --git a/src/routes/ThemePreview/ThemePreview.tsx b/src/routes/ThemePreview/ThemePreview.tsx index aa1ae4b..eb331f2 100644 --- a/src/routes/ThemePreview/ThemePreview.tsx +++ b/src/routes/ThemePreview/ThemePreview.tsx @@ -1,11 +1,11 @@ -import { FC } from 'react'; -import Button from '@mui/material/Button'; +import { FC } from 'react' +import Button from '@mui/material/Button' import Container from '@mui/material/Container' -import Grid from '@mui/material/Grid'; -import Stack from '@mui/material/Stack'; +import Grid from '@mui/material/Grid' +import Stack from '@mui/material/Stack' import Typography from '@mui/material/Typography' import Divider from '@mui/material/Divider' -import ColorSwatch from './ColorSwatch'; +import ColorSwatch from './ColorSwatch' import StarIcon from '@mui/icons-material/Star' diff --git a/src/tests/customRender.tsx b/src/tests/customRender.tsx index 7350a4b..375ee5f 100644 --- a/src/tests/customRender.tsx +++ b/src/tests/customRender.tsx @@ -1,9 +1,9 @@ import React, { ReactElement } from 'react' import { render, RenderOptions } from '@testing-library/react' -import CssBaseline from '@mui/material/CssBaseline'; -import CustomThemeProvider from '@/theme/CustomThemeProvider'; -import { MemoryRouter } from 'react-router-dom'; -import '@/i18n/config'; +import CssBaseline from '@mui/material/CssBaseline' +import CustomThemeProvider from '@/theme/CustomThemeProvider' +import { MemoryRouter } from 'react-router-dom' +import '@/i18n/config' // eslint-disable-next-line react-refresh/only-export-components const AllTheProviders = ({ children }: { children: React.ReactNode }) => { diff --git a/src/theme/customColorConfig.ts b/src/theme/customColorConfig.ts index c31291c..bd24639 100644 --- a/src/theme/customColorConfig.ts +++ b/src/theme/customColorConfig.ts @@ -2,7 +2,7 @@ Custom Colors in Typescript requires module augmentation Read more: https://mui.com/material-ui/customization/palette/#typescript */ -import '@mui/material'; +import '@mui/material' declare module '@mui/material/styles' { diff --git a/src/theme/theme.ts b/src/theme/theme.ts index 685c2b0..a4fce30 100644 --- a/src/theme/theme.ts +++ b/src/theme/theme.ts @@ -1,6 +1,6 @@ import createTheme from '@mui/material/styles/createTheme' -import typography from './typography/default'; -import { teal, lightBlue, deepPurple, purple, grey } from '@mui/material/colors'; +import typography from './typography/default' +import { teal, lightBlue, deepPurple, purple, grey } from '@mui/material/colors' const theme = createTheme({ palette: { @@ -38,6 +38,6 @@ const theme = createTheme({ }, typography -}); +}) export default theme diff --git a/src/theme/typography/default.ts b/src/theme/typography/default.ts index 3e873e1..1297af7 100644 --- a/src/theme/typography/default.ts +++ b/src/theme/typography/default.ts @@ -1,4 +1,4 @@ -import { TypographyOptions } from '@mui/material/styles/createTypography'; +import { TypographyOptions } from '@mui/material/styles/createTypography' const typography: TypographyOptions = { fontFamily: ['Noto Sans JP', 'serif'].join(','), From 93c716091d118e8c37e6176e345b2b0e7cd1e6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ann=20Kilzer=20=E3=82=AD=E3=83=AB=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E6=9D=8F?= Date: Thu, 11 Jul 2024 12:07:37 +0900 Subject: [PATCH 3/3] Update CONTRIBUTING.md (#54) update contributing instructions --- CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd0f7da..7c44dc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,13 +16,14 @@ I've set us up with a modern frontend tech stack so that we can practice together. This includes TypeScript, which has a bit of a learning curve. ## Best Practices -- Use Editorconfig to match expected style: https://editorconfig.org/ +- Use Editorconfig to match expected style: https://editorconfig.org/ (If you are a VSCode user this means installing an extention) - This project is set up with eslint for both style and code checking 🧹 +- Please disable Prettier plugins in your editor ([VSCode instructions](https://stackoverflow.com/a/75471109/1860768)) ## Working on an Issue ☑️ - Please assign yourself to any ticket you are working on. Please unassign yourself if you aren't able to move it forward. Feel free to ask for help if you get stuck. - Branch name should start with the ticket number, e.g. `11-dns-setup` -- Please write unit tests for new enhancements 🧪 +- Please write unit and E2E tests for new enhancements 🧪 ## PR Guidelines - All GH Actions should pass ☑️ @@ -32,6 +33,12 @@ I've set us up with a modern frontend tech stack so that we can practice togethe - Try to keep PRs under 500 lines of code 🤏 - Making multiple PRs to solve a single issue is okay! 🙆🏻‍♀️ +## Testing Guidelines +- Unit tests have coverage metrics. 60 - 80% coverage is good ⭐ +- Try to approach writing tests the way a real user would interact with the site. [See Guiding Principles from Testing Library](https://testing-library.com/docs/guiding-principles/) +- Rather than adding test ids, we prefer semantic selectors like `getByRole`, `getByLabel`, or `getByText` +- Playwright is great for testing complex interactions across components or pages. + ## Merging - Merging to main triggers a deploy to production. Please check that the site deploys correctly