From fb6081813bcbc5e6ff2f8d0c8addd55ae9b5f198 Mon Sep 17 00:00:00 2001 From: Boris Serdiuk Date: Fri, 19 Apr 2024 14:58:36 +0200 Subject: [PATCH] chore: upgrade prettier --- package-lock.json | 342 +++++++++++------- package.json | 8 +- pages/dnd/engine-page-template.tsx | 2 +- pages/dnd/items.tsx | 53 +-- pages/dnd/revenue-chart.tsx | 8 +- pages/main.tsx | 2 +- pages/pages.ts | 2 +- pages/shared/i18n.ts | 4 +- scripts/environment.js | 4 +- scripts/prepare-package-lock.js | 2 +- scripts/test-utils.js | 4 +- scripts/themeable-source.js | 4 +- scripts/utils.js | 2 +- src/board-item/__tests__/board-item.test.tsx | 2 +- .../__tests__/board-acquisition.test.tsx | 4 +- src/board/__tests__/board.test.tsx | 8 +- src/board/internal.tsx | 1 - src/board/transition.ts | 6 +- src/board/utils/__tests__/layout.test.ts | 6 +- src/board/utils/announcements.ts | 4 +- src/board/utils/events.ts | 2 +- src/board/utils/get-hovered-rect.ts | 2 +- src/board/utils/layout.ts | 2 +- src/board/utils/path.ts | 2 +- src/internal/debug-tools/generators.ts | 2 +- src/internal/debug-tools/parsers.ts | 2 +- src/internal/dnd-controller/event-emitter.ts | 2 +- src/internal/drag-handle/index.tsx | 2 +- .../__tests__/get-next-droppable.test.ts | 2 +- .../item-container/get-collision-rect.ts | 2 +- .../item-container/get-next-droppable.ts | 2 +- src/internal/item-container/index.tsx | 4 +- .../__tests__/engine-cache.test.ts | 2 +- .../__tests__/engine-convergence.test.ts | 2 +- .../__tests__/engine-float.test.ts | 2 +- .../__tests__/engine-move-blocks.test.ts | 6 +- .../__tests__/engine-move-larger.test.ts | 4 +- .../__tests__/engine-validation.test.ts | 22 +- src/internal/layout-engine/engine-solution.ts | 6 +- src/internal/layout-engine/engine-step.ts | 2 +- src/internal/layout-engine/utils.ts | 2 +- .../screenreader-grid-navigation.test.tsx | 4 +- src/internal/utils/__tests__/layout.test.ts | 20 +- src/internal/utils/layout.ts | 2 +- src/internal/utils/rects.ts | 8 +- src/internal/utils/use-auto-scroll.ts | 2 +- src/test-utils/dom/items-palette/index.ts | 2 +- .../board-layout/conditional-editing.test.ts | 2 +- .../board-layout/dnd-page-object.ts | 8 +- .../board-layout/item-actions.test.ts | 12 +- .../keyboard-interactions.test.ts | 28 +- test/functional/board-layout/layout.test.ts | 64 ++-- .../board-layout/live-announcements.test.ts | 16 +- .../board-layout/mouse-interactions.test.ts | 32 +- .../widget-container/keyboard.test.ts | 4 +- test/utils.ts | 2 +- test/visual/drag-states.test.ts | 20 +- test/visual/index.test.ts | 2 +- 58 files changed, 431 insertions(+), 339 deletions(-) diff --git a/package-lock.json b/package-lock.json index c942b3af..ef1ab772 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,12 +35,12 @@ "@vitest/coverage-v8": "^1.4.0", "chokidar-cli": "^3.0.0", "deep-freeze-es6": "^1.4.1", - "eslint": "^8.31.0", - "eslint-config-prettier": "^8.6.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-no-unsanitized": "^4.0.2", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.31.11", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-unicorn": "^45.0.2", @@ -53,7 +53,7 @@ "lodash": "^4.17.21", "lodash-es": "^4.17.21", "npm-run-all": "^4.1.5", - "prettier": "^2.8.1", + "prettier": "^3.2.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.6.1", @@ -1656,9 +1656,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.1.2.tgz", - "integrity": "sha512-7qELuQWWjVDdVsFQ5+beUl+KPczrEDA7S3zM4QUd/bJl7oXgsmpXaEVqrRTnOBqenOV4rWf2kVZk2Ot085zPWA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -1667,18 +1667,27 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -1720,6 +1729,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@formatjs/ecma402-abstract": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz", @@ -1770,13 +1788,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -1797,9 +1815,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -2754,6 +2772,18 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@remix-run/router": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", @@ -4356,6 +4386,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@vitejs/plugin-react": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", @@ -6895,49 +6931,48 @@ } }, "node_modules/eslint": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", - "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -6951,9 +6986,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -7077,21 +7112,30 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -7444,14 +7488,14 @@ } }, "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -7474,9 +7518,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -8110,6 +8154,12 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -11317,16 +11367,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/js-sdsl": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", - "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -13383,15 +13423,15 @@ } }, "node_modules/prettier": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", - "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -14875,6 +14915,22 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -17343,23 +17399,29 @@ "optional": true }, "@eslint-community/eslint-utils": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.1.2.tgz", - "integrity": "sha512-7qELuQWWjVDdVsFQ5+beUl+KPczrEDA7S3zM4QUd/bJl7oXgsmpXaEVqrRTnOBqenOV4rWf2kVZk2Ot085zPWA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "requires": { "eslint-visitor-keys": "^3.3.0" } }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true + }, "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -17385,6 +17447,12 @@ } } }, + "@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true + }, "@formatjs/ecma402-abstract": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz", @@ -17435,13 +17503,13 @@ } }, "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" } }, @@ -17452,9 +17520,9 @@ "dev": true }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -18193,6 +18261,12 @@ "fastq": "^1.6.0" } }, + "@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true + }, "@remix-run/router": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", @@ -19427,6 +19501,12 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "@vitejs/plugin-react": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", @@ -21351,49 +21431,48 @@ } }, "eslint": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", - "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "dependencies": { @@ -21489,9 +21568,9 @@ } }, "eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "requires": {} }, @@ -21595,12 +21674,13 @@ "requires": {} }, "eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "requires": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" } }, "eslint-plugin-react": { @@ -21753,14 +21833,14 @@ "dev": true }, "espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" } }, "esprima": { @@ -21770,9 +21850,9 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -22243,6 +22323,12 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -24619,12 +24705,6 @@ } } }, - "js-sdsl": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", - "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -26180,9 +26260,9 @@ "dev": true }, "prettier": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", - "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true }, "prettier-linter-helpers": { @@ -27318,6 +27398,16 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "requires": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + } + }, "tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", diff --git a/package.json b/package.json index eba3698e..9c2dd21e 100644 --- a/package.json +++ b/package.json @@ -78,12 +78,12 @@ "@vitest/coverage-v8": "^1.4.0", "chokidar-cli": "^3.0.0", "deep-freeze-es6": "^1.4.1", - "eslint": "^8.31.0", - "eslint-config-prettier": "^8.6.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-no-unsanitized": "^4.0.2", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.31.11", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-unicorn": "^45.0.2", @@ -96,7 +96,7 @@ "lodash": "^4.17.21", "lodash-es": "^4.17.21", "npm-run-all": "^4.1.5", - "prettier": "^2.8.1", + "prettier": "^3.2.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.6.1", diff --git a/pages/dnd/engine-page-template.tsx b/pages/dnd/engine-page-template.tsx index 60948b92..5b5564db 100644 --- a/pages/dnd/engine-page-template.tsx +++ b/pages/dnd/engine-page-template.tsx @@ -55,7 +55,7 @@ export function EnginePageTemplate({ } if (removedItem) { setPaletteItems((prev) => - [...prev, removedItem].sort((a, b) => a.data.title.localeCompare(b.data.title)) + [...prev, removedItem].sort((a, b) => a.data.title.localeCompare(b.data.title)), ); } }} diff --git a/pages/dnd/items.tsx b/pages/dnd/items.tsx index e2c9b548..6ce905d4 100644 --- a/pages/dnd/items.tsx +++ b/pages/dnd/items.tsx @@ -228,29 +228,32 @@ export const demoPaletteItems: readonly ItemsPaletteProps.Item[] = Obj data: widget?.data ?? createDefaultWidget(key), })); -export const letterWidgets = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"].reduce((acc, letter) => { - const definitions: { [letter: string]: BoardItemDefinitionBase["definition"] } = { - R: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, - S: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, - T: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, - U: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, - V: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, - W: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, - X: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, - Y: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, - Z: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, - }; - acc[letter] = { - id: letter, - definition: definitions[letter], - data: { - title: `Widget ${letter}`, - description: "Empty widget", - content: "", - }, - }; - return acc; -}, {} as { [id: string]: BoardItemDefinitionBase }); +export const letterWidgets = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"].reduce( + (acc, letter) => { + const definitions: { [letter: string]: BoardItemDefinitionBase["definition"] } = { + R: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, + S: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, + T: { defaultRowSpan: 1, defaultColumnSpan: 2, minRowSpan: 1, minColumnSpan: 2 }, + U: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, + V: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, + W: { defaultRowSpan: 4, defaultColumnSpan: 1, minRowSpan: 4, minColumnSpan: 1 }, + X: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, + Y: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, + Z: { defaultRowSpan: 4, defaultColumnSpan: 2, minRowSpan: 4, minColumnSpan: 2 }, + }; + acc[letter] = { + id: letter, + definition: definitions[letter], + data: { + title: `Widget ${letter}`, + description: "Empty widget", + content: "", + }, + }; + return acc; + }, + {} as { [id: string]: BoardItemDefinitionBase }, +); export function createLetterItems(grid: null | string[][], palette?: string[]) { if (!grid) { @@ -261,7 +264,7 @@ export function createLetterItems(grid: null | string[][], palette?: string[]) { const usedLetterItems = new Set(boardItems.map((item) => item.id)); const paletteItems = Object.values(letterWidgets).filter( - (item) => !usedLetterItems.has(item.id) && (!palette || palette.includes(item.id)) + (item) => !usedLetterItems.has(item.id) && (!palette || palette.includes(item.id)), ); return { boardItems, paletteItems }; @@ -269,7 +272,7 @@ export function createLetterItems(grid: null | string[][], palette?: string[]) { function applyLayout( layout: GridLayout, - sourceItems: readonly (BoardItemDefinitionBase | BoardItemDefinition)[] + sourceItems: readonly (BoardItemDefinitionBase | BoardItemDefinition)[], ): readonly BoardItemDefinition[] { const itemById = new Map(sourceItems.map((item) => [item.id, item])); const getItem = (itemId: string) => { diff --git a/pages/dnd/revenue-chart.tsx b/pages/dnd/revenue-chart.tsx index 0561d419..52747bb4 100644 --- a/pages/dnd/revenue-chart.tsx +++ b/pages/dnd/revenue-chart.tsx @@ -58,10 +58,10 @@ export function RevenueChart({ height }: { height: number }) { return Math.abs(value) >= 1e9 ? (value / 1e9).toFixed(1).replace(/\.0$/, "") + "G" : Math.abs(value) >= 1e6 - ? (value / 1e6).toFixed(1).replace(/\.0$/, "") + "M" - : Math.abs(value) >= 1e3 - ? (value / 1e3).toFixed(1).replace(/\.0$/, "") + "K" - : value.toFixed(2); + ? (value / 1e6).toFixed(1).replace(/\.0$/, "") + "M" + : Math.abs(value) >= 1e3 + ? (value / 1e3).toFixed(1).replace(/\.0$/, "") + "K" + : value.toFixed(2); }, }} ariaLabel="Single data series bar chart" diff --git a/pages/main.tsx b/pages/main.tsx index 4c81e24d..fdc3b20f 100644 --- a/pages/main.tsx +++ b/pages/main.tsx @@ -9,5 +9,5 @@ import App from "./app"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + , ); diff --git a/pages/pages.ts b/pages/pages.ts index 37eb7d46..527b98d0 100644 --- a/pages/pages.ts +++ b/pages/pages.ts @@ -14,5 +14,5 @@ export const pagesMap = Object.fromEntries( Object.entries(pagesRaw).map(([path, dynamicImport]) => { const match = getPage(path); return [match, lazy(dynamicImport as ComponentFactory)]; - }) + }), ); diff --git a/pages/shared/i18n.ts b/pages/shared/i18n.ts index 0d3b47e0..fc099e30 100644 --- a/pages/shared/i18n.ts +++ b/pages/shared/i18n.ts @@ -73,7 +73,7 @@ export const itemsPaletteI18nStrings: ItemsPaletteProps.I18nStrings = function createAnnouncement( operationAnnouncement: string, conflicts: readonly BoardProps.Item[], - disturbed: readonly BoardProps.Item[] + disturbed: readonly BoardProps.Item[], ) { const conflictsAnnouncement = conflicts.length > 0 ? `Conflicts with ${conflicts.map((c) => c.data.title).join(", ")}.` : ""; @@ -91,7 +91,7 @@ export const boardI18nStrings: BoardProps.I18nStrings = { return createAnnouncement( `Item moved to ${op.direction === "horizontal" ? columns : rows}.`, op.conflicts, - op.disturbed + op.disturbed, ); }, liveAnnouncementDndItemResized(op) { diff --git a/scripts/environment.js b/scripts/environment.js index a60b5e76..696fe9b3 100644 --- a/scripts/environment.js +++ b/scripts/environment.js @@ -21,13 +21,13 @@ writeFile( `${basePath}.js`, Object.entries(values) .map(([key, value]) => `export var ${key} = ${JSON.stringify(value)};`) - .join("\n") + .join("\n"), ); writeFile( `${basePath}.d.ts`, Object.keys(values) .map((key) => `export const ${key}: string;`) - .join("\n") + .join("\n"), ); function writeFile(filepath, content) { diff --git a/scripts/prepare-package-lock.js b/scripts/prepare-package-lock.js index 51463372..4da1bd0f 100755 --- a/scripts/prepare-package-lock.js +++ b/scripts/prepare-package-lock.js @@ -25,7 +25,7 @@ function unlock(packages) { delete packages[dependencyName]; } else if (dependency.resolved && dependency.resolved.includes("codeartifact.us-west-2.amazonaws.com")) { throw Error( - "package-lock.json file contains a reference to CodeArtifact. Use regular npm to update the packages." + "package-lock.json file contains a reference to CodeArtifact. Use regular npm to update the packages.", ); } }); diff --git a/scripts/test-utils.js b/scripts/test-utils.js index 4e97b6e5..24cc8a39 100644 --- a/scripts/test-utils.js +++ b/scripts/test-utils.js @@ -8,7 +8,7 @@ import { globbySync } from "globby"; import { pascalCase, writeSourceFile } from "./utils.js"; const components = globbySync(["src/test-utils/dom/**/index.ts", "!src/test-utils/dom/index.ts"]).map((fileName) => - fileName.replace("src/test-utils/dom/", "").replace("/index.ts", "") + fileName.replace("src/test-utils/dom/", "").replace("/index.ts", ""), ); generateSelectorUtils(); @@ -71,7 +71,7 @@ function generateIndexFileContent({ testUtilType, buildFinderInterface }) { // casting to 'any' is needed to avoid this issue with generics // https://github.com/microsoft/TypeScript/issues/29132 return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, ${pascalCase( - componentName + componentName, )}Wrapper); };`; }), diff --git a/scripts/themeable-source.js b/scripts/themeable-source.js index 5b78e861..b1e4afaf 100644 --- a/scripts/themeable-source.js +++ b/scripts/themeable-source.js @@ -22,9 +22,9 @@ function copyStyles() { path.join(stylesTargetDir, file), content.replace( /@use "(\.\.\/)+node_modules\/@cloudscape-design\/design-tokens\/index.scss"/, - '@use "awsui:tokens"' + '@use "awsui:tokens"', ), - "utf-8" + "utf-8", ); } } diff --git a/scripts/utils.js b/scripts/utils.js index 67f9f3ac..238238bf 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -27,7 +27,7 @@ export function listPublicDirs(baseDir) { elem !== "internal" && elem !== "index.tsx" && elem !== "index.ts" && - elem !== "test-utils" + elem !== "test-utils", ); } diff --git a/src/board-item/__tests__/board-item.test.tsx b/src/board-item/__tests__/board-item.test.tsx index 6fc3a10d..74c11f1b 100644 --- a/src/board-item/__tests__/board-item.test.tsx +++ b/src/board-item/__tests__/board-item.test.tsx @@ -33,7 +33,7 @@ describe("WidgetContainer", () => { Content - + , ); const itemWrapper = createWrapper().findBoardItem()!; expect(itemWrapper.findHeader()!.getElement().textContent).toBe("Header"); diff --git a/src/board/__tests__/board-acquisition.test.tsx b/src/board/__tests__/board-acquisition.test.tsx index 15d74737..d5d32a15 100644 --- a/src/board/__tests__/board-acquisition.test.tsx +++ b/src/board/__tests__/board-acquisition.test.tsx @@ -22,7 +22,7 @@ test("renders acquired item", () => { draggableItem, collisionRect: { top: 0, bottom: 0, left: 0, right: 0 }, coordinates: new Coordinates({ x: 0, y: 0 }), - } as DragAndDropData) + } as DragAndDropData), ); act(() => @@ -30,7 +30,7 @@ test("renders acquired item", () => { droppableId: "awsui-placeholder-1-0", draggableItem, renderAcquiredItem: () =>
, - }) + }), ); expect(screen.queryByTestId("acquired-item")).toBeInTheDOM(); diff --git a/src/board/__tests__/board.test.tsx b/src/board/__tests__/board.test.tsx index f13ea602..c43ad2c9 100644 --- a/src/board/__tests__/board.test.tsx +++ b/src/board/__tests__/board.test.tsx @@ -164,7 +164,7 @@ describe("Board", () => { { id: "1", data: { title: "Item 1" }, columnOffset: { 1: 0 } }, ], }, - }) + }), ); }); @@ -188,7 +188,7 @@ describe("Board", () => { { id: "2", data: { title: "Item 2" }, columnOffset: { 1: 0 } }, ], }, - }) + }), ); }); @@ -207,8 +207,8 @@ describe("Board", () => { removedItem: expect.objectContaining({ id: "1" }), items: [{ id: "2", data: { title: "Item 2" }, columnOffset: { 1: 0 } }], }, - }) - ) + }), + ), ); }); }); diff --git a/src/board/internal.tsx b/src/board/internal.tsx index 0d7dffad..30669766 100644 --- a/src/board/internal.tsx +++ b/src/board/internal.tsx @@ -180,7 +180,6 @@ export function InternalBoard({ useDragSubscription("acquire", ({ droppableId, draggableItem, renderAcquiredItem }) => { const placeholder = placeholdersLayout.items.find((it) => it.id === droppableId); - console.log(placeholdersLayout.items); // If missing then it does not belong to this board. if (!placeholder) { diff --git a/src/board/transition.ts b/src/board/transition.ts index 36250e8e..d5af9959 100644 --- a/src/board/transition.ts +++ b/src/board/transition.ts @@ -200,7 +200,7 @@ function discardTransition(state: TransitionState): TransitionState { function updateTransitionWithPointerEvent( state: TransitionState, - { collisionIds, positionOffset, draggableRect }: UpdateWithPointerAction + { collisionIds, positionOffset, draggableRect }: UpdateWithPointerAction, ): TransitionState { const { transition } = state; @@ -255,7 +255,7 @@ function updateTransitionWithPointerEvent( function updateTransitionWithKeyboardEvent( state: TransitionState, - { direction }: UpdateWithKeyboardAction + { direction }: UpdateWithKeyboardAction, ): TransitionState { const { transition } = state; @@ -311,7 +311,7 @@ function updateTransitionWithKeyboardEvent( function acquireTransitionItem( state: TransitionState, - { position, layoutElement, acquiredItemElement }: AcquireItemAction + { position, layoutElement, acquiredItemElement }: AcquireItemAction, ): TransitionState { const { transition } = state; diff --git a/src/board/utils/__tests__/layout.test.ts b/src/board/utils/__tests__/layout.test.ts index d6d42249..49600442 100644 --- a/src/board/utils/__tests__/layout.test.ts +++ b/src/board/utils/__tests__/layout.test.ts @@ -12,7 +12,7 @@ import { getLayoutRows } from "../layout"; function createMockTransition( operation: Operation, itemsLayout: GridLayout, - layoutShift: LayoutShift + layoutShift: LayoutShift, ): Transition { return { operation, @@ -48,7 +48,7 @@ describe("getLayoutRows", () => { ]), moves: [], conflicts: [], - } + }, ); const rows = getLayoutRows(transition); expect(rows).toBe(2); @@ -72,7 +72,7 @@ describe("getLayoutRows", () => { ]), moves: [], conflicts: [], - } + }, ); const rows = getLayoutRows(transition); expect(rows).toBe(3); diff --git a/src/board/utils/announcements.ts b/src/board/utils/announcements.ts index dfe4babe..ed57debf 100644 --- a/src/board/utils/announcements.ts +++ b/src/board/utils/announcements.ts @@ -16,7 +16,7 @@ import { */ export function createOperationAnnouncement( transition: Transition, - direction: null | Direction + direction: null | Direction, ): null | DndActionAnnouncement { const { operation, layoutShift, itemsLayout } = transition; const targetItem = itemsLayout.items.find((it) => it.id === transition.draggableItem.id) ?? null; @@ -63,7 +63,7 @@ export function announcementToString( announcement: TransitionAnnouncement, items: readonly BoardProps.Item[], i18nStrings: BoardProps.I18nStrings, - columns: number + columns: number, ): string { if (!announcement) { return ""; diff --git a/src/board/utils/events.ts b/src/board/utils/events.ts index 874b6374..fbc5f729 100644 --- a/src/board/utils/events.ts +++ b/src/board/utils/events.ts @@ -8,7 +8,7 @@ import { BoardProps } from "../interfaces"; export function createItemsChangeEvent( items: readonly BoardProps.Item[], - layoutShift: LayoutShift + layoutShift: LayoutShift, ): CustomEvent> { const insertTarget = layoutShift.moves.find((move) => move.type === "INSERT")?.itemId ?? null; const moveTarget = layoutShift.moves.find((move) => move.type === "MOVE")?.itemId ?? null; diff --git a/src/board/utils/get-hovered-rect.ts b/src/board/utils/get-hovered-rect.ts index b4d69181..4a87f949 100644 --- a/src/board/utils/get-hovered-rect.ts +++ b/src/board/utils/get-hovered-rect.ts @@ -20,6 +20,6 @@ export function getHoveredRect(collisionsIds: readonly ItemId[], placeholders: r left: Number.POSITIVE_INFINITY, bottom: Number.NEGATIVE_INFINITY, right: Number.NEGATIVE_INFINITY, - } + }, ); } diff --git a/src/board/utils/layout.ts b/src/board/utils/layout.ts index 3766c6e6..96286ea3 100644 --- a/src/board/utils/layout.ts +++ b/src/board/utils/layout.ts @@ -63,7 +63,7 @@ export function getInsertionDirection(cursorOffset: Coordinates): Direction { export function getLayoutShift( transition: Transition, path: readonly Position[], - insertionDirection?: Direction + insertionDirection?: Direction, ): null | LayoutShift { if (path.length === 0) { return null; diff --git a/src/board/utils/path.ts b/src/board/utils/path.ts index 1e3a85de..e7ff7662 100644 --- a/src/board/utils/path.ts +++ b/src/board/utils/path.ts @@ -12,7 +12,7 @@ export function normalizeInsertionPath( path: readonly Position[], insertionDirection: Direction, columns: number, - rows: number + rows: number, ): Position[] { let edgeIndex = -1; for (let i = 0; i < path.length; i++) { diff --git a/src/internal/debug-tools/generators.ts b/src/internal/debug-tools/generators.ts index 5f05e4a8..8b82bd50 100644 --- a/src/internal/debug-tools/generators.ts +++ b/src/internal/debug-tools/generators.ts @@ -258,7 +258,7 @@ export function generateResize(grid: GridLayout, options?: GenerateGridResizeOpt new Position({ x: resizeTarget.x + resizeTarget.width + widthDelta, y: resizeTarget.y + resizeTarget.height + heightDelta, - }) + }), ); return { itemId: resizeTarget.id, path }; diff --git a/src/internal/debug-tools/parsers.ts b/src/internal/debug-tools/parsers.ts index c2f4a142..1a934baa 100644 --- a/src/internal/debug-tools/parsers.ts +++ b/src/internal/debug-tools/parsers.ts @@ -64,7 +64,7 @@ export function fromTextPath(textPath: string, gridArg: GridLayout | GridMatrix) // Find move target. const grid = Array.isArray(gridArg) ? fromMatrix(gridArg) : gridArg; const targets = grid.items.filter( - (item) => item.y <= start.y && start.y < item.y + item.height && item.x <= start.x && start.x < item.x + item.width + (item) => item.y <= start.y && start.y < item.y + item.height && item.x <= start.x && start.x < item.x + item.width, ); if (targets.length === 0) { throw new Error("No move target corresponding given path."); diff --git a/src/internal/dnd-controller/event-emitter.ts b/src/internal/dnd-controller/event-emitter.ts index 6b38a342..2a8d9e70 100644 --- a/src/internal/dnd-controller/event-emitter.ts +++ b/src/internal/dnd-controller/event-emitter.ts @@ -17,7 +17,7 @@ export class EventEmitter> { return () => { this.listeners.set( event, - this.listeners.get(event)!.filter((item) => item !== handler) + this.listeners.get(event)!.filter((item) => item !== handler), ); }; } diff --git a/src/internal/drag-handle/index.tsx b/src/internal/drag-handle/index.tsx index 8f4568c8..9d74a7a6 100644 --- a/src/internal/drag-handle/index.tsx +++ b/src/internal/drag-handle/index.tsx @@ -17,7 +17,7 @@ export interface DragHandleProps { function DragHandle( { ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, isActive }: DragHandleProps, - ref: ForwardedRef + ref: ForwardedRef, ) { return ( { ["2", { element: getMockElement({ left: 5, right: 5, top: 0, bottom: 0 }) } as Droppable], ["3", { element: getMockElement({ left: 10, right: 0, top: 0, bottom: 0 }) } as Droppable], ], - "right" + "right", ); expect(next).toBe("2"); }); diff --git a/src/internal/item-container/get-collision-rect.ts b/src/internal/item-container/get-collision-rect.ts index 6fd09464..1805a9a1 100644 --- a/src/internal/item-container/get-collision-rect.ts +++ b/src/internal/item-container/get-collision-rect.ts @@ -13,7 +13,7 @@ export function getCollisionRect( operation: Operation, draggableElement: HTMLElement, coordinates: Coordinates, - sizeOverride: null | { width: number; height: number } + sizeOverride: null | { width: number; height: number }, ): Rect { const { left, top, width, height } = getNormalizedElementRect(draggableElement); diff --git a/src/internal/item-container/get-next-droppable.ts b/src/internal/item-container/get-next-droppable.ts index d8eacb4b..952b089e 100644 --- a/src/internal/item-container/get-next-droppable.ts +++ b/src/internal/item-container/get-next-droppable.ts @@ -13,7 +13,7 @@ import { getNormalizedElementRect } from "../utils/screen"; export function getNextDroppable( draggableElement: HTMLElement, droppables: readonly [ItemId, Droppable][], - direction: Direction + direction: Direction, ): null | ItemId { const draggableRect = getNormalizedElementRect(draggableElement); const sources = new Map(droppables.map(([id, d]) => [getNormalizedElementRect(d.element), id])); diff --git a/src/internal/item-container/index.tsx b/src/internal/item-container/index.tsx index cd847501..e217f09d 100644 --- a/src/internal/item-container/index.tsx +++ b/src/internal/item-container/index.tsx @@ -105,7 +105,7 @@ export const ItemContainer = forwardRef(ItemContainerComponent); function ItemContainerComponent( { item, placed, acquired, inTransition, transform, getItemSize, onKeyMove, children }: ItemContainerProps, - ref: Ref + ref: Ref, ) { const originalSizeRef = useRef({ width: 0, height: 0 }); const pointerOffsetRef = useRef(new Coordinates({ x: 0, y: 0 })); @@ -181,7 +181,7 @@ function ItemContainerComponent( new Coordinates({ x: Math.max(coordinates.x, pointerBoundariesRef.current?.x ?? Number.NEGATIVE_INFINITY), y: Math.max(coordinates.y, pointerBoundariesRef.current?.y ?? Number.NEGATIVE_INFINITY), - }) + }), ); }, 10); const onPointerUp = () => { diff --git a/src/internal/layout-engine/__tests__/engine-cache.test.ts b/src/internal/layout-engine/__tests__/engine-cache.test.ts index 8db13d26..a0c2644c 100644 --- a/src/internal/layout-engine/__tests__/engine-cache.test.ts +++ b/src/internal/layout-engine/__tests__/engine-cache.test.ts @@ -13,7 +13,7 @@ const MAX_EXECUTION_TIME_MS = 25; function debug(commandName: string, averageTime: number, maxTime: number) { const fileName = "[engine-cache.test.ts]"; console.log( - `${fileName} ${commandName} second resolutions average time: ${averageTime.toFixed(0)}ms, max time: ${maxTime}ms.` + `${fileName} ${commandName} second resolutions average time: ${averageTime.toFixed(0)}ms, max time: ${maxTime}ms.`, ); } diff --git a/src/internal/layout-engine/__tests__/engine-convergence.test.ts b/src/internal/layout-engine/__tests__/engine-convergence.test.ts index e4f0bb7e..d118f7ba 100644 --- a/src/internal/layout-engine/__tests__/engine-convergence.test.ts +++ b/src/internal/layout-engine/__tests__/engine-convergence.test.ts @@ -14,7 +14,7 @@ const MAX_EXECUTION_TIME_RESIZE_MS = 200; function debug(commandName: string, averageTime: number, maxTime: number) { const fileName = "[engine-convergence.test.ts]"; console.log( - `${fileName} ${commandName} resolutions average time: ${averageTime.toFixed(0)}ms, max time: ${maxTime}ms.` + `${fileName} ${commandName} resolutions average time: ${averageTime.toFixed(0)}ms, max time: ${maxTime}ms.`, ); } diff --git a/src/internal/layout-engine/__tests__/engine-float.test.ts b/src/internal/layout-engine/__tests__/engine-float.test.ts index 407ba88d..e682dcfb 100644 --- a/src/internal/layout-engine/__tests__/engine-float.test.ts +++ b/src/internal/layout-engine/__tests__/engine-float.test.ts @@ -44,7 +44,7 @@ test("all items but the move target float to the top after move+commit", () => { expect(invalidItem, `Expected item "${invalidItem}" to float.`).toBe(null); } - } + }, ); }); diff --git a/src/internal/layout-engine/__tests__/engine-move-blocks.test.ts b/src/internal/layout-engine/__tests__/engine-move-blocks.test.ts index 53d9cafc..7d0f6ad6 100644 --- a/src/internal/layout-engine/__tests__/engine-move-blocks.test.ts +++ b/src/internal/layout-engine/__tests__/engine-move-blocks.test.ts @@ -19,7 +19,7 @@ test("any move on a grid with 1x1 items only is resolved", () => { const movePath = generateMove(grid, "any"); const layoutShift = new LayoutEngine(grid).move(movePath); expect(layoutShift.conflicts.length).toBe(0); - } + }, ); }); @@ -36,7 +36,7 @@ test("all vertical moves are resolved if all items have height=1", () => { const movePath = generateMove(grid, "vertical"); const layoutShift = new LayoutEngine(grid).move(movePath); expect(layoutShift.conflicts.length).toBe(0); - } + }, ); }); @@ -53,7 +53,7 @@ test("all vertical moves are resolved if all items have width=1", () => { const movePath = generateMove(grid, "horizontal"); const layoutShift = new LayoutEngine(grid).move(movePath); expect(layoutShift.conflicts.length).toBe(0); - } + }, ); }); diff --git a/src/internal/layout-engine/__tests__/engine-move-larger.test.ts b/src/internal/layout-engine/__tests__/engine-move-larger.test.ts index 284390fe..a40a83d7 100644 --- a/src/internal/layout-engine/__tests__/engine-move-larger.test.ts +++ b/src/internal/layout-engine/__tests__/engine-move-larger.test.ts @@ -458,7 +458,7 @@ test("Float moves don't interfere with swaps", () => { ["D", "E"], [" ", "F"], [" ", "F"], - ]) + ]), ); }); @@ -494,6 +494,6 @@ test("E forces conflicts on C and D simultaneously", () => { [" ", " ", " ", "G"], [" ", " ", "F", "F"], [" ", " ", "F", "F"], - ]) + ]), ); }); diff --git a/src/internal/layout-engine/__tests__/engine-validation.test.ts b/src/internal/layout-engine/__tests__/engine-validation.test.ts index d30f6945..92fa1a6b 100644 --- a/src/internal/layout-engine/__tests__/engine-validation.test.ts +++ b/src/internal/layout-engine/__tests__/engine-validation.test.ts @@ -39,10 +39,10 @@ test("throws if move command is not valid", () => { ]); expect(() => new LayoutEngine(grid).move({ itemId: "X", path: [new Position({ x: 0, y: 0 })] })).toThrowError( - 'Item with id "X" not found in the grid.' + 'Item with id "X" not found in the grid.', ); expect(() => new LayoutEngine(grid).move({ itemId: "F", path: [new Position({ x: 3, y: 1 })] })).toThrowError( - "Invalid move: outside grid." + "Invalid move: outside grid.", ); }); @@ -54,7 +54,7 @@ test("throws if resize command is not valid", () => { ]); expect(() => new LayoutEngine(grid).resize({ itemId: "X", path: [new Position({ x: 1, y: 1 })] })).toThrowError( - 'Item with id "X" not found in the grid.' + 'Item with id "X" not found in the grid.', ); expect(() => @@ -62,11 +62,11 @@ test("throws if resize command is not valid", () => { fromMatrix([ ["A", "A"], ["A", "A"], - ]) + ]), ).resize({ itemId: "A", path: [new Position({ x: 1, y: 2 }), new Position({ x: 0, y: 2 })], - }) + }), ).toThrowError("Invalid resize: can't resize to 0."); expect(() => @@ -74,11 +74,11 @@ test("throws if resize command is not valid", () => { fromMatrix([ ["A", "A"], ["A", "A"], - ]) + ]), ).resize({ itemId: "A", path: [new Position({ x: 2, y: 1 }), new Position({ x: 2, y: 0 })], - }) + }), ).toThrowError("Invalid resize: can't resize to 0."); expect(() => @@ -86,8 +86,8 @@ test("throws if resize command is not valid", () => { fromMatrix([ ["A", "A"], ["A", "A"], - ]) - ).resize({ itemId: "A", path: [new Position({ x: 3, y: 2 })] }) + ]), + ).resize({ itemId: "A", path: [new Position({ x: 3, y: 2 })] }), ).toThrowError("Invalid resize: outside grid."); }); @@ -99,10 +99,10 @@ test("throws if insert command is not valid", () => { ]); expect(() => - new LayoutEngine(grid).insert({ itemId: "X", width: 2, height: 1, path: [new Position({ x: 2, y: 2 })] }) + new LayoutEngine(grid).insert({ itemId: "X", width: 2, height: 1, path: [new Position({ x: 2, y: 2 })] }), ).toThrowError("Inserting item is outside the boundaries."); expect(() => - new LayoutEngine(grid).insert({ itemId: "X", width: 2, height: 0, path: [new Position({ x: 1, y: 1 })] }) + new LayoutEngine(grid).insert({ itemId: "X", width: 2, height: 0, path: [new Position({ x: 1, y: 1 })] }), ).toThrowError("Inserting item has invalid size."); }); diff --git a/src/internal/layout-engine/engine-solution.ts b/src/internal/layout-engine/engine-solution.ts index 0106ca9f..112190b5 100644 --- a/src/internal/layout-engine/engine-solution.ts +++ b/src/internal/layout-engine/engine-solution.ts @@ -71,7 +71,7 @@ function getOverlapMove( state: MoveSolutionState, overlapId: ItemId, overlapIssuerId: ItemId, - moveDirection: Direction + moveDirection: Direction, ): null | CommittedMove { const userItem = state.grid.getItem(state.moves[0].itemId); const overlapItem = state.grid.getItem(overlapId); @@ -206,7 +206,7 @@ function getUserMoveBoundaries(state: MoveSolutionState): { top: number; right: function getPathOverlaps( state: MoveSolutionState, move: CommittedMove, - overlapIssuerItem: GridLayoutItem + overlapIssuerItem: GridLayoutItem, ): Set { const { left, right, top, bottom } = getMoveOriginalRect(move); const startX = move.distanceX <= 0 ? move.x : right + 1; @@ -221,7 +221,7 @@ function getPathOverlaps( width: 1 + endX - startX, y: startY, height: 1 + endY - startY, - }) + }), ); pathOverlaps.delete(overlapIssuerItem); diff --git a/src/internal/layout-engine/engine-step.ts b/src/internal/layout-engine/engine-step.ts index 2255cc09..1f48b7a6 100644 --- a/src/internal/layout-engine/engine-step.ts +++ b/src/internal/layout-engine/engine-step.ts @@ -176,7 +176,7 @@ function refloatGrid(layoutState: LayoutEngineState, userMove?: CommittedMove): function findConflicts( grid: ReadonlyLayoutEngineGrid, previousConflicts: null | Conflicts, - userMove: CommittedMove + userMove: CommittedMove, ): null | Conflicts { // The conflicts are only defined for MOVE command type to make swaps possible. if (userMove.type !== "MOVE") { diff --git a/src/internal/layout-engine/utils.ts b/src/internal/layout-engine/utils.ts index 9f00ace4..834a80dd 100644 --- a/src/internal/layout-engine/utils.ts +++ b/src/internal/layout-engine/utils.ts @@ -61,7 +61,7 @@ export function createMove( type: CommittedMove["type"], item: GridLayoutItem, next: Position, - score = 0 + score = 0, ): CommittedMove { const distanceX = type === "RESIZE" ? next.x - item.width : next.x - item.x; const distanceY = type === "RESIZE" ? next.y - item.height : next.y - item.y; diff --git a/src/internal/screenreader-grid-navigation/__tests__/screenreader-grid-navigation.test.tsx b/src/internal/screenreader-grid-navigation/__tests__/screenreader-grid-navigation.test.tsx index c035eb88..a2db9928 100644 --- a/src/internal/screenreader-grid-navigation/__tests__/screenreader-grid-navigation.test.tsx +++ b/src/internal/screenreader-grid-navigation/__tests__/screenreader-grid-navigation.test.tsx @@ -34,7 +34,7 @@ test("ARIA labels", () => { ariaDescription="Board navigation description" itemAriaLabel={(item) => (item ? `Item ${item.title}` : "Empty")} onActivateItem={() => undefined} - /> + />, ); // Navigation labels. @@ -56,7 +56,7 @@ test("Can activate items", () => { ariaDescription="Board navigation description" itemAriaLabel={(item) => (item ? `Item ${item.title}` : "Empty")} onActivateItem={onFocusItemSpy} - /> + />, ); container.querySelector("button")?.click(); expect(onFocusItemSpy).toBeCalledWith("1"); diff --git a/src/internal/utils/__tests__/layout.test.ts b/src/internal/utils/__tests__/layout.test.ts index cdbc1192..c72f1233 100644 --- a/src/internal/utils/__tests__/layout.test.ts +++ b/src/internal/utils/__tests__/layout.test.ts @@ -47,7 +47,7 @@ describe("interpretItems", () => { ["A", "B", "C"], ["D", " ", " "], ["D", " ", " "], - ]) + ]), ); }); @@ -59,7 +59,7 @@ describe("interpretItems", () => { ["A", "B", "C"], ["A", "D", " "], ["A", "D", " "], - ]) + ]), ); }); @@ -72,7 +72,7 @@ describe("interpretItems", () => { makeItem("D", {}, { rowSpan: 2 }), makeItem("E", {}, { rowSpan: 2 }), ], - 3 + 3, ); expect(toString(grid)).toBe( toString([ @@ -82,7 +82,7 @@ describe("interpretItems", () => { ["D", "B", "C"], ["E", "B", "C"], ["E", "B", " "], - ]) + ]), ); }); }); @@ -97,7 +97,7 @@ describe("transformItems", () => { ["D", "A", " "], ["D", "A", " "], ]), - null + null, ); expect(items.map((it) => it.id)).toEqual(["D", "B", "C", "A"]); }); @@ -111,7 +111,7 @@ describe("transformItems", () => { ["D", "A", " "], ["D", "A", " "], ]), - null + null, ); expect(items[0]).toEqual(expect.objectContaining({ columnOffset: { 3: 0 } })); expect(items[1]).toEqual(expect.objectContaining({ columnOffset: { 3: 1 } })); @@ -130,7 +130,7 @@ describe("transformItems", () => { ["A", "C", "B"], ["A", "C", "B"], ]), - null + null, ); expect(items[0]).toEqual(expect.objectContaining({ columnOffset: { 3: 0, 6: 0 }, columnSpan: 1, rowSpan: 2 })); expect(items[1]).toEqual(expect.objectContaining({ columnOffset: { 3: 1 }, columnSpan: 1, rowSpan: 2 })); @@ -149,7 +149,7 @@ describe("transformItems", () => { ["A", "B", "C"], [" ", "B", " "], ]), - "B" + "B", ); expect(items[0]).toEqual(expect.objectContaining({ columnOffset: { 3: 0, 6: 0 }, columnSpan: 1, rowSpan: 2 })); expect(items[1]).toEqual(expect.objectContaining({ columnOffset: { 3: 1 }, columnSpan: 1, rowSpan: 3 })); @@ -170,7 +170,7 @@ describe("transformItems", () => { ["B", "C", "C"], ["B", "C", "C"], ]), - "C" + "C", ); expect(items[0]).toEqual(expect.objectContaining({ columnOffset: { 3: 0 } })); expect(items[1]).toEqual(expect.objectContaining({ columnOffset: { 3: 0 }, columnSpan: 1, rowSpan: 2 })); @@ -209,7 +209,7 @@ describe("createPlaceholdersLayout", () => { ["awsui-placeholder-0-0", "awsui-placeholder-0-1"], ["awsui-placeholder-1-0", "awsui-placeholder-1-1"], ["awsui-placeholder-2-0", "awsui-placeholder-2-1"], - ]) + ]), ); }); }); diff --git a/src/internal/utils/layout.ts b/src/internal/utils/layout.ts index 3d5e3eb2..b5d6caa1 100644 --- a/src/internal/utils/layout.ts +++ b/src/internal/utils/layout.ts @@ -82,7 +82,7 @@ export function interpretItems(items: readonly Item[], columns: number): GridLay export function transformItems( sourceItems: readonly BoardItemDefinition[], gridLayout: GridLayout, - resizeTarget: null | ItemId + resizeTarget: null | ItemId, ): readonly BoardItemDefinition[] { const itemById = new Map(sourceItems.map((item) => [item.id, item])); const getItem = (itemId: ItemId) => { diff --git a/src/internal/utils/rects.ts b/src/internal/utils/rects.ts index 35f7c96d..3c56cc6e 100644 --- a/src/internal/utils/rects.ts +++ b/src/internal/utils/rects.ts @@ -75,19 +75,19 @@ export function getClosestNeighbor(target: Rect, sources: readonly Rect[], direc switch (direction) { case "left": return getFirst( - sources.filter((rect) => rect.right <= target.left).sort((r1, r2) => r2.left - r1.left || verticalDiff(r1, r2)) + sources.filter((rect) => rect.right <= target.left).sort((r1, r2) => r2.left - r1.left || verticalDiff(r1, r2)), ); case "right": return getFirst( - sources.filter((rect) => rect.left >= target.right).sort((r1, r2) => r1.left - r2.left || verticalDiff(r1, r2)) + sources.filter((rect) => rect.left >= target.right).sort((r1, r2) => r1.left - r2.left || verticalDiff(r1, r2)), ); case "up": return getFirst( - sources.filter((rect) => rect.bottom <= target.top).sort((r1, r2) => r2.top - r1.top || horizontalDiff(r1, r2)) + sources.filter((rect) => rect.bottom <= target.top).sort((r1, r2) => r2.top - r1.top || horizontalDiff(r1, r2)), ); case "down": return getFirst( - sources.filter((rect) => rect.top >= target.bottom).sort((r1, r2) => r1.top - r2.top || horizontalDiff(r1, r2)) + sources.filter((rect) => rect.top >= target.bottom).sort((r1, r2) => r1.top - r2.top || horizontalDiff(r1, r2)), ); } } diff --git a/src/internal/utils/use-auto-scroll.ts b/src/internal/utils/use-auto-scroll.ts index 1794f2b0..5364da6a 100644 --- a/src/internal/utils/use-auto-scroll.ts +++ b/src/internal/utils/use-auto-scroll.ts @@ -72,7 +72,7 @@ export function useAutoScroll() { } }, delay); }, - [getLastInteraction] + [getLastInteraction], ); return { addPointerEventHandlers, removePointerEventHandlers, scheduleActiveElementScrollIntoView }; diff --git a/src/test-utils/dom/items-palette/index.ts b/src/test-utils/dom/items-palette/index.ts index ce93bfbb..46348d26 100644 --- a/src/test-utils/dom/items-palette/index.ts +++ b/src/test-utils/dom/items-palette/index.ts @@ -9,7 +9,7 @@ export default class ItemsPaletteWrapper extends ComponentWrapper { findItems() { return this.findAllByClassName(PaletteItemWrapper.rootSelector).map( - (wrapper) => new PaletteItemWrapper(wrapper.getElement()) + (wrapper) => new PaletteItemWrapper(wrapper.getElement()), ); } diff --git a/test/functional/board-layout/conditional-editing.test.ts b/test/functional/board-layout/conditional-editing.test.ts index 053240a7..7de34ea1 100644 --- a/test/functional/board-layout/conditional-editing.test.ts +++ b/test/functional/board-layout/conditional-editing.test.ts @@ -29,6 +29,6 @@ describe("conditional editing feature", () => { // board items are hidden after toggling it back await expect(page.getElementsCount(boardItemSelector)).resolves.toEqual(0); await expect(getWidgetSizes()).resolves.toEqual(sizeBefore); - }) + }), ); }); diff --git a/test/functional/board-layout/dnd-page-object.ts b/test/functional/board-layout/dnd-page-object.ts index 2a808bfd..e6376366 100644 --- a/test/functional/board-layout/dnd-page-object.ts +++ b/test/functional/board-layout/dnd-page-object.ts @@ -36,20 +36,20 @@ export class DndPageObject extends BasePageObject { const widgets = await this.browser.execute( (widgetsSelector) => [...document.querySelectorAll(widgetsSelector)].map( - (w) => [w.getAttribute("data-item-id"), w.getBoundingClientRect()] as [string, DOMRect] + (w) => [w.getAttribute("data-item-id"), w.getBoundingClientRect()] as [string, DOMRect], ), - `.${boardStyles.root} [data-item-id]` + `.${boardStyles.root} [data-item-id]`, ); const placeholderRects = await this.browser.execute( (placeholderSelector) => [...document.querySelectorAll(placeholderSelector)].map((p) => p.getBoundingClientRect()), - `.${boardStyles.placeholder}` + `.${boardStyles.placeholder}`, ); const hoveredPlaceholderRects = await this.browser.execute( (placeholderSelector) => [...document.querySelectorAll(placeholderSelector)].map((p) => p.getBoundingClientRect()), - `.${boardStyles["placeholder--hover"]}` + `.${boardStyles["placeholder--hover"]}`, ); function matchWidget(placeholderIndex: number): null | string { diff --git a/test/functional/board-layout/item-actions.test.ts b/test/functional/board-layout/item-actions.test.ts index afdd624d..2bc72e6d 100644 --- a/test/functional/board-layout/item-actions.test.ts +++ b/test/functional/board-layout/item-actions.test.ts @@ -39,7 +39,7 @@ describe("items removal", () => { ["M", " ", " ", "P"], ["M", " ", " ", "P"], ]); - }) + }), ); test( @@ -74,7 +74,7 @@ describe("items removal", () => { ["I", "J", "K", " "], ["I", "J", "K", " "], ]); - }) + }), ); test( @@ -90,7 +90,7 @@ describe("items removal", () => { await page.keys(["Tab", "Tab", "Tab"]); await expect(page.isFocused(boardItemHandle("J"))).resolves.toBe(true); - }) + }), ); test( @@ -103,7 +103,7 @@ describe("items removal", () => { await expect(page.isExisting(boardItemHandle("5"))).resolves.toBe(false); await expect(page.isFocused(boardItemHandle("8"))).resolves.toBe(true); - }) + }), ); }); @@ -121,10 +121,10 @@ describe("items reordering", () => { await page.dragAndDropTo( boardWrapper.findItemById("5").findDragHandle().toSelector(), - boardWrapper.findItemById("6").findDragHandle().toSelector() + boardWrapper.findItemById("6").findDragHandle().toSelector(), ); expect(await page.getValue(input)).toBe("test content"); - }) + }), ); }); diff --git a/test/functional/board-layout/keyboard-interactions.test.ts b/test/functional/board-layout/keyboard-interactions.test.ts index 8abf4d6f..1c0d3aac 100644 --- a/test/functional/board-layout/keyboard-interactions.test.ts +++ b/test/functional/board-layout/keyboard-interactions.test.ts @@ -30,7 +30,7 @@ describe("items reordered with keyboard", () => { ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); test( @@ -47,7 +47,7 @@ describe("items reordered with keyboard", () => { ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); test( @@ -63,7 +63,7 @@ describe("items reordered with keyboard", () => { ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); }); @@ -86,7 +86,7 @@ describe("items resized with keyboard", () => { [" ", "F", " ", " "], [" ", "F", " ", " "], ]); - }) + }), ); test( @@ -104,7 +104,7 @@ describe("items resized with keyboard", () => { ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); test( @@ -117,7 +117,7 @@ describe("items resized with keyboard", () => { ["X", "X", " ", " "], ["X", "X", " ", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -132,8 +132,8 @@ describe("items resized with keyboard", () => { ["X", "X", " ", " "], ["X", "X", " ", " "], ]); - } - ) + }, + ), ); }); @@ -161,7 +161,7 @@ describe("items inserted with keyboard", () => { [" ", " ", " ", "I"], [" ", " ", " ", "I"], ]); - }) + }), ); test( @@ -182,7 +182,7 @@ describe("items inserted with keyboard", () => { [" ", " ", " ", "H"], [" ", " ", " ", "H"], ]); - }) + }), ); test( @@ -200,7 +200,7 @@ describe("items inserted with keyboard", () => { ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); test( @@ -210,10 +210,10 @@ describe("items inserted with keyboard", () => { await page.keys(["Enter"]); await page.keys(["ArrowLeft"]); await expect(page.getText(boardWrapper.find(`[data-item-id="I"]`).toSelector())).resolves.toBe( - "Widget I\n(preview) Empty widget" + "Widget I\n(preview) Empty widget", ); await expect(page.isDisplayed(boardItemResizeHandle("I"))).resolves.toBe(false); - }) + }), ); test( @@ -223,6 +223,6 @@ describe("items inserted with keyboard", () => { await page.keys(["Enter"]); await page.keys(["ArrowLeft"]); await expect(page.isDisplayed(paletteItemDragHandle("M"))).resolves.toBe(false); - }) + }), ); }); diff --git a/test/functional/board-layout/layout.test.ts b/test/functional/board-layout/layout.test.ts index f386cfc2..e6955c09 100644 --- a/test/functional/board-layout/layout.test.ts +++ b/test/functional/board-layout/layout.test.ts @@ -21,7 +21,7 @@ test( ["E", "B", "G", "H"], ["E", "B", "G", "H"], ], - [] + [], ), DndPageObject, async (page) => { @@ -47,8 +47,8 @@ test( [" ", " ", " ", " "], [" ", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -61,7 +61,7 @@ test( ["E", "F", "G", "H"], ["E", "F", "G", "H"], ], - ["I", "X"] + ["I", "X"], ), DndPageObject, async (page) => { @@ -87,8 +87,8 @@ test( [" ", " ", " ", " "], [" ", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -101,7 +101,7 @@ test( [" ", "F", "G", "H"], [" ", "F", "G", "H"], ], - [] + [], ), DndPageObject, async (page) => { @@ -131,8 +131,8 @@ test( ["A", " ", " ", " "], [" ", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -151,7 +151,7 @@ test( ["D", "D", "E", "E"], ["D", "D", "E", "E"], ], - [] + [], ), DndPageObject, async (page) => { @@ -165,8 +165,8 @@ test( await page.mouseMove(0, 900); await expect(page.getElementsCount(placeholderSelector)).resolves.toBe(14 * 4); - } - ) + }, + ), ); test( @@ -181,7 +181,7 @@ test( ["X", "X", "X", " "], ["X", "X", "X", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -203,8 +203,8 @@ test( ["X", "X", " ", " "], [" ", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -219,7 +219,7 @@ test( ["X", "X", "X", " "], ["X", "X", "X", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -245,8 +245,8 @@ test( ["X", "X", " ", " "], [" ", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -255,7 +255,7 @@ test( makeQueryUrl( [], // X item has min columns = 2 and min rows = 4. - ["X"] + ["X"], ), DndPageObject, async (page) => { @@ -272,8 +272,8 @@ test( ["X", "X", " ", " "], ["X", "X", " ", " "], ]); - } - ) + }, + ), ); test( @@ -338,7 +338,7 @@ test( [" ", "X", "X", " ", " ", " "], [" ", "X", "X", " ", " ", " "], ]); - }) + }), ); test( @@ -349,7 +349,7 @@ test( ["A", "A", "B", "C"], ["A", "A", "B", "C"], ], - [] + [], ), DndPageObject, async (page) => { @@ -359,7 +359,7 @@ test( // Swap A and B. await page.dragAndDropTo( boardWrapper.findItemById("A").findDragHandle().toSelector(), - boardWrapper.findItemById("B").findDragHandle().toSelector() + boardWrapper.findItemById("B").findDragHandle().toSelector(), ); // Remove C. @@ -373,8 +373,8 @@ test( ["B", "A", "A", " "], ["B", "A", "A", " "], ]); - } - ) + }, + ), ); test( @@ -385,7 +385,7 @@ test( ["A", "A", "B", "C"], ["A", "A", "B", "C"], ], - [] + [], ), DndPageObject, async (page) => { @@ -403,8 +403,8 @@ test( [" ", " ", "B", " "], [" ", " ", "B", " "], ]); - } - ) + }, + ), ); test( @@ -427,7 +427,7 @@ test( ["X", "X", " ", " "], ["X", "X", " ", " "], ]); - }) + }), ); test( @@ -457,7 +457,7 @@ test( [" ", " ", " ", " "], [" ", " ", " ", " "], ]); - }) + }), ); test( @@ -480,5 +480,5 @@ test( ["D", "D", " ", " "], ["D", "D", " ", " "], ]); - }) + }), ); diff --git a/test/functional/board-layout/live-announcements.test.ts b/test/functional/board-layout/live-announcements.test.ts index f413c325..cbc91a66 100644 --- a/test/functional/board-layout/live-announcements.test.ts +++ b/test/functional/board-layout/live-announcements.test.ts @@ -32,7 +32,7 @@ test( "Item moved to row 3. Disturbed 1 items.", "reorder committed", ]); - }) + }), ); test( @@ -48,7 +48,7 @@ test( "Item moved to column 2. Disturbed 1 items.", "reorder discarded", ]); - }) + }), ); test( @@ -66,7 +66,7 @@ test( "Item resized to rows 2 (minimal).", "resize committed", ]); - }) + }), ); test( @@ -84,7 +84,7 @@ test( "Item resized to columns 1 (minimal).", "resize discarded", ]); - }) + }), ); test( @@ -104,7 +104,7 @@ test( "Item inserted to column 4, row 3. Disturbed 1 items.", "insert committed", ]); - }) + }), ); test( @@ -122,7 +122,7 @@ test( "Item inserted to column 3, row 1. Disturbed 3 items.", "insert discarded", ]); - }) + }), ); test( @@ -140,7 +140,7 @@ test( "Dragging", "Insertion discarded", ]); - }) + }), ); test( @@ -155,5 +155,5 @@ test( await page.pause(200 + 100); await expect(page.getLiveAnnouncements()).resolves.toEqual(["Removed item Widget A. Disturbed 1 items."]); - }) + }), ); diff --git a/test/functional/board-layout/mouse-interactions.test.ts b/test/functional/board-layout/mouse-interactions.test.ts index c52daad4..d215aff1 100644 --- a/test/functional/board-layout/mouse-interactions.test.ts +++ b/test/functional/board-layout/mouse-interactions.test.ts @@ -13,7 +13,7 @@ test( setupTest("/index.html#/dnd/engine-a2h-test", DndPageObject, async (page) => { await page.dragAndDropTo( boardWrapper.findItemById("A").findDragHandle().toSelector(), - boardWrapper.findItemById("B").findDragHandle().toSelector() + boardWrapper.findItemById("B").findDragHandle().toSelector(), ); await expect(page.getGrid()).resolves.toEqual([ ["B", "A", "C", "D"], @@ -21,7 +21,7 @@ test( ["E", "F", "G", "H"], ["E", "F", "G", "H"], ]); - }) + }), ); test( @@ -29,7 +29,7 @@ test( setupTest("/index.html#/dnd/engine-a2h-test", DndPageObject, async (page) => { await page.dragAndDropTo( itemsPaletteWrapper.findItemById("K").findDragHandle().toSelector(), - boardWrapper.findItemById("H").findDragHandle().toSelector() + boardWrapper.findItemById("H").findDragHandle().toSelector(), ); await expect(page.getGrid()).resolves.toEqual([ ["A", "B", "C", "D"], @@ -39,7 +39,7 @@ test( [" ", " ", " ", "H"], [" ", " ", " ", "H"], ]); - }) + }), ); test( @@ -47,7 +47,7 @@ test( setupTest("/index.html#/dnd/engine-a2h-test", DndPageObject, async (page) => { await page.dragAndDropTo( boardWrapper.findItemById("A").findResizeHandle().toSelector(), - boardWrapper.findItemById("B").findResizeHandle().toSelector() + boardWrapper.findItemById("B").findResizeHandle().toSelector(), ); await expect(page.getGrid()).resolves.toEqual([ ["A", "A", "C", "D"], @@ -57,7 +57,7 @@ test( [" ", "F", " ", " "], [" ", "F", " ", " "], ]); - }) + }), ); test( @@ -70,7 +70,7 @@ test( ["A", "A", " ", " "], ["A", "A", " ", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -81,8 +81,8 @@ test( ["A", " ", " ", " "], ["A", " ", " ", " "], ]); - } - ) + }, + ), ); test( @@ -95,7 +95,7 @@ test( ["X", "X", " ", " "], ["X", "X", " ", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -108,8 +108,8 @@ test( ["X", "X", " ", " "], ["X", "X", " ", " "], ]); - } - ) + }, + ), ); test( @@ -122,7 +122,7 @@ test( ["B", "B", " ", " "], ["B", "B", " ", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -137,8 +137,8 @@ test( ["B", "B", " ", " "], ] .map((r) => r.join(" ")) - .join("\n") + .join("\n"), ); - } - ) + }, + ), ); diff --git a/test/functional/widget-container/keyboard.test.ts b/test/functional/widget-container/keyboard.test.ts index e377adef..b2da395e 100644 --- a/test/functional/widget-container/keyboard.test.ts +++ b/test/functional/widget-container/keyboard.test.ts @@ -9,7 +9,7 @@ class PageObject extends ScreenshotPageObject { containsFocused(selector: string) { return this.browser.execute( (selector) => document.querySelector(selector)!.contains(document.activeElement), - selector + selector, ); } } @@ -38,5 +38,5 @@ test( await page.focusNextElement(); expect(await page.isFocused(firstItem.findResizeHandle().toSelector())).toBeTruthy(); - }) + }), ); diff --git a/test/utils.ts b/test/utils.ts index 2b26cea2..f7af04fe 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -10,7 +10,7 @@ const windowSize = { width: 1600, height: 800 }; export function setupTest

}>( url: string, PageClass: new (browser: WebdriverIO.Browser) => P, - test: (page: P) => Promise + test: (page: P) => Promise, ) { return useBrowser(windowSize, async (browser) => { await browser.url(url); diff --git a/test/visual/drag-states.test.ts b/test/visual/drag-states.test.ts index 8c563dc5..b8e30140 100644 --- a/test/visual/drag-states.test.ts +++ b/test/visual/drag-states.test.ts @@ -81,7 +81,7 @@ test( setupTest("/index.html#/dnd/engine-a2h-test", DndPageObject, async (page) => { await page.focus(boardItemHandle("A")); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -89,7 +89,7 @@ test( setupTest("/index.html#/dnd/engine-a2h-test", DndPageObject, async (page) => { await page.focus(boardItemResizeHandle("A")); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -99,7 +99,7 @@ test( await page.keys(["Enter"]); await page.keys(["ArrowDown"]); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -114,7 +114,7 @@ test( ["F", "G", " ", " "], ["F", "G", " ", " "], ], - [] + [], ), DndPageObject, async (page) => { @@ -129,8 +129,8 @@ test( await page.keys(["Enter"]); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - } - ) + }, + ), ); test( @@ -144,7 +144,7 @@ test( await page.mouseDown(itemsPaletteWrapper.findItemById("Q").findDragHandle().toSelector()); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -156,7 +156,7 @@ test( await page.mouseMove(200, 0); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -172,7 +172,7 @@ test( await page.keys(["Enter"]); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); test( @@ -187,5 +187,5 @@ test( await page.mouseMove(0, -400); expect(await page.fullPageScreenshot()).toMatchImageSnapshot(); - }) + }), ); diff --git a/test/visual/index.test.ts b/test/visual/index.test.ts index 4b543370..deb536da 100644 --- a/test/visual/index.test.ts +++ b/test/visual/index.test.ts @@ -18,5 +18,5 @@ test.each(pages)("matches snapshot for %s", (route) => const pngString = await page.fullPageScreenshot(); expect(pngString).toMatchImageSnapshot(); } - })() + })(), );