diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 473016f..b73e16a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: - name: Use Node.js 18 uses: actions/setup-node@v4 with: - node-version: "18.18" + node-version: '18.18' - run: corepack enable - run: yarn install - name: yarn start:docker @@ -60,12 +60,12 @@ jobs: with: start: npx serve ui/dist -p 5173 command: yarn test:e2e - wait-on: "http://localhost:5173" + wait-on: 'http://localhost:5173' wait-on-timeout: 120 browser: chrome env: DISPLAY: :0.0 - SECRET_WORDS: "orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology" + SECRET_WORDS: 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology' - name: Archive e2e artifacts uses: actions/upload-artifact@v4 diff --git a/contract/tsconfig.json b/contract/tsconfig.json index 821ccb5..25f9a15 100644 --- a/contract/tsconfig.json +++ b/contract/tsconfig.json @@ -1,27 +1,19 @@ { - "compilerOptions": { - "target": "ESNext", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "lib": [ - "ESNext", - "DOM" - ], - "checkJs": true, - "strict": true, - "noImplicitAny": false, - "useUnknownInCatchVariables": false, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "outDir": "./dist" - }, - "include": [ - "src", - "test" - ], - "exclude": [ - "node_modules" - ] - } + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "checkJs": true, + "strict": true, + "noImplicitAny": false, + "useUnknownInCatchVariables": false, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "outDir": "./dist" + }, + "include": ["src", "test"], + "exclude": ["node_modules"] +} diff --git a/package.json b/package.json index 5713a03..db0cb82 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,10 @@ "make:help": "make -C contract list", "start:contract": "cd contract && yarn start", "start:ui": "cd ui && yarn dev", - "lint": "yarn workspaces foreach --all run lint", + "format": "yarn prettier --write .github contract ui", + "lint:format": "yarn prettier --check .github contract ui", + "lint": "yarn lint:format && yarn workspaces foreach --all run lint", + "lint:fix": "yarn format && yarn workspaces foreach --all run lint:fix", "test": "yarn workspaces foreach --all run test", "test:e2e": "yarn workspace offer-up-ui test:e2e", "build": "yarn workspaces foreach --all run build", @@ -62,6 +65,16 @@ "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-testing-library": "^6.2.0", "eslint-plugin-ui-testing": "^2.0.1", + "prettier": "^3.3.3", + "prettier-plugin-tailwindcss": "^0.5.11", "serve": "^14.2.1" + }, + "prettier": { + "trailingComma": "all", + "arrowParens": "avoid", + "singleQuote": true, + "plugins": [ + "prettier-plugin-tailwindcss" + ] } } diff --git a/ui/src/App.css b/ui/src/App.css index b4d6ec7..c7be568 100644 --- a/ui/src/App.css +++ b/ui/src/App.css @@ -99,11 +99,11 @@ input { } .error { - background-color: #E11D48; + background-color: #e11d48; color: #fff; } /* increment/decrement arrows always visible */ -input[type=number]::-webkit-inner-spin-button { - opacity: 1 +input[type='number']::-webkit-inner-spin-button { + opacity: 1; } diff --git a/ui/test/e2e/synpress.config.cjs b/ui/test/e2e/synpress.config.cjs index a4d1a5c..7e39095 100644 --- a/ui/test/e2e/synpress.config.cjs +++ b/ui/test/e2e/synpress.config.cjs @@ -9,6 +9,6 @@ module.exports = defineConfig({ specPattern: 'test/e2e/specs/**/*spec.{js,jsx,ts,tsx}', supportFile: 'test/support.js', screenshotsFolder: 'test/e2e/screenshots', - videosFolder: 'test/e2e/videos' + videosFolder: 'test/e2e/videos', }, }); diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 7f54595..3579097 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -20,8 +20,8 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "types": ["vitest/globals"], + "types": ["vitest/globals"] }, "include": ["src", "test"], - "references": [{ "path": "./tsconfig.node.json" }], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/yarn.lock b/yarn.lock index 8483698..b31dfcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12760,6 +12760,8 @@ __metadata: eslint-plugin-cypress: "npm:^2.15.1" eslint-plugin-testing-library: "npm:^6.2.0" eslint-plugin-ui-testing: "npm:^2.0.1" + prettier: "npm:^3.3.3" + prettier-plugin-tailwindcss: "npm:^0.5.11" serve: "npm:^14.2.1" languageName: unknown linkType: soft @@ -13496,6 +13498,61 @@ __metadata: languageName: node linkType: hard +"prettier-plugin-tailwindcss@npm:^0.5.11": + version: 0.5.14 + resolution: "prettier-plugin-tailwindcss@npm:0.5.14" + peerDependencies: + "@ianvs/prettier-plugin-sort-imports": "*" + "@prettier/plugin-pug": "*" + "@shopify/prettier-plugin-liquid": "*" + "@trivago/prettier-plugin-sort-imports": "*" + "@zackad/prettier-plugin-twig-melody": "*" + prettier: ^3.0 + prettier-plugin-astro: "*" + prettier-plugin-css-order: "*" + prettier-plugin-import-sort: "*" + prettier-plugin-jsdoc: "*" + prettier-plugin-marko: "*" + prettier-plugin-organize-attributes: "*" + prettier-plugin-organize-imports: "*" + prettier-plugin-sort-imports: "*" + prettier-plugin-style-order: "*" + prettier-plugin-svelte: "*" + peerDependenciesMeta: + "@ianvs/prettier-plugin-sort-imports": + optional: true + "@prettier/plugin-pug": + optional: true + "@shopify/prettier-plugin-liquid": + optional: true + "@trivago/prettier-plugin-sort-imports": + optional: true + "@zackad/prettier-plugin-twig-melody": + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + checksum: 10c0/9857873cb8cb0d9b7b895806e7f6265617a08805691125d282767dffb1cb3d2c4c662f2b9168ef391edc40dff1b81beb99eee488f96544e01b8924db694f2299 + languageName: node + linkType: hard + "prettier@npm:^3.0.0, prettier@npm:^3.0.3, prettier@npm:^3.2.4": version: 3.2.4 resolution: "prettier@npm:3.2.4" @@ -13505,6 +13562,15 @@ __metadata: languageName: node linkType: hard +"prettier@npm:^3.3.3": + version: 3.4.2 + resolution: "prettier@npm:3.4.2" + bin: + prettier: bin/prettier.cjs + checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446 + languageName: node + linkType: hard + "pretty-bytes@npm:^5.6.0": version: 5.6.0 resolution: "pretty-bytes@npm:5.6.0"