Skip to content

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Aug 26, 2022
1 parent 1ea4247 commit 702b047
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 112 deletions.
19 changes: 4 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:react/jsx-runtime",
"plugin:prettier/recommended",
"prettier"
"plugin:react/jsx-runtime"
],
"env": {
"node": true
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -25,8 +23,7 @@
"@typescript-eslint",
"import",
"jsx-a11y",
"react-hooks",
"prettier"
"react-hooks"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
Expand All @@ -40,15 +37,7 @@
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"prettier/prettier": [
"warn",
{
"endOfLine": "auto",
"singleQuote": true,
"arrowParens": "avoid"
}
]
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"endOfLine": "auto",
"singleQuote": true,
"arrowParens": "avoid"
}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@
"@types/node": "^18.7.13",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.34.0",
"@typescript-eslint/parser": "^5.34.0",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1",
"@vitejs/plugin-react": "^2.0.1",
"autoprefixer": "^10.4.8",
"clsx": "^1.2.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"framer-motion": "^7.2.1",
Expand Down
33 changes: 13 additions & 20 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,20 @@ const watchPurses = async (
const n = await E(wallet).getPursesNotifier();
for await (const purses of iterateNotifier(n)) {
setPurses(purses);
purses.forEach(
({
brand,
displayInfo,
brandPetname: petname,
}: {
brand: any;
displayInfo: any;
brandPetname: string;
}) => {
const decimalPlaces = displayInfo && displayInfo.decimalPlaces;
const assetKind = displayInfo && displayInfo.assetKind;

const newInfo = {
petname,
assetKind,
decimalPlaces,
};
for (const purse of purses) {
const { brand, displayInfo, brandPetname: petname } = purse;
const decimalPlaces = displayInfo && displayInfo.decimalPlaces;
const assetKind = displayInfo && displayInfo.assetKind;

mergeBrandToInfo([[brand, newInfo]]);
}
);
const newInfo = {
petname,
assetKind,
decimalPlaces,
};

mergeBrandToInfo([[brand, newInfo]]);
}
}
};

Expand All @@ -64,6 +56,7 @@ const App = () => {
useEffect(() => {
if (wallet === null) return;

// TODO: More user-friendly error handling, like a toast.
watchPurses(wallet, setPurses, mergeBrandToInfo).catch((err: Error) =>
console.error('got watchPurses err', err)
);
Expand Down
122 changes: 49 additions & 73 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

"@agoric/wallet@^0.13.1":
version "0.13.1"
resolved "https://registry.npmjs.org/@agoric/wallet/-/wallet-0.13.1.tgz"
resolved "https://registry.yarnpkg.com/@agoric/wallet/-/wallet-0.13.1.tgz#965466c552bea7a63dabba4bafc2b19881716095"
integrity sha512-5j8RuO9mMhBBidp90So2vVSsRzhejz09iPutm/wD0NNuOtZ2Y0HrMyPWyq4A5pxrLw7xWH/W+LwKwJUmBlAQyQ==
dependencies:
agoric "^0.16.0"
Expand Down Expand Up @@ -751,84 +751,84 @@
resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==

"@typescript-eslint/eslint-plugin@^5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.34.0.tgz"
integrity sha512-eRfPPcasO39iwjlUAMtjeueRGuIrW3TQ9WseIDl7i5UWuFbf83yYaU7YPs4j8+4CxUMIsj1k+4kV+E+G+6ypDQ==
"@typescript-eslint/eslint-plugin@^5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.35.1.tgz#0d822bfea7469904dfc1bb8f13cabd362b967c93"
integrity sha512-RBZZXZlI4XCY4Wzgy64vB+0slT9+yAPQRjj/HSaRwUot33xbDjF1oN9BLwOLTewoOI0jothIltZRe9uJCHf8gg==
dependencies:
"@typescript-eslint/scope-manager" "5.34.0"
"@typescript-eslint/type-utils" "5.34.0"
"@typescript-eslint/utils" "5.34.0"
"@typescript-eslint/scope-manager" "5.35.1"
"@typescript-eslint/type-utils" "5.35.1"
"@typescript-eslint/utils" "5.35.1"
debug "^4.3.4"
functional-red-black-tree "^1.0.1"
ignore "^5.2.0"
regexpp "^3.2.0"
semver "^7.3.7"
tsutils "^3.21.0"

"@typescript-eslint/parser@^5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.34.0.tgz"
integrity sha512-SZ3NEnK4usd2CXkoV3jPa/vo1mWX1fqRyIVUQZR4As1vyp4fneknBNJj+OFtV8WAVgGf+rOHMSqQbs2Qn3nFZQ==
"@typescript-eslint/parser@^5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.35.1.tgz#bf2ee2ebeaa0a0567213748243fb4eec2857f04f"
integrity sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg==
dependencies:
"@typescript-eslint/scope-manager" "5.34.0"
"@typescript-eslint/types" "5.34.0"
"@typescript-eslint/typescript-estree" "5.34.0"
"@typescript-eslint/scope-manager" "5.35.1"
"@typescript-eslint/types" "5.35.1"
"@typescript-eslint/typescript-estree" "5.35.1"
debug "^4.3.4"

"@typescript-eslint/scope-manager@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.34.0.tgz"
integrity sha512-HNvASMQlah5RsBW6L6c7IJ0vsm+8Sope/wu5sEAf7joJYWNb1LDbJipzmdhdUOnfrDFE6LR1j57x1EYVxrY4ow==
"@typescript-eslint/scope-manager@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e"
integrity sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q==
dependencies:
"@typescript-eslint/types" "5.34.0"
"@typescript-eslint/visitor-keys" "5.34.0"
"@typescript-eslint/types" "5.35.1"
"@typescript-eslint/visitor-keys" "5.35.1"

"@typescript-eslint/type-utils@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.34.0.tgz"
integrity sha512-Pxlno9bjsQ7hs1pdWRUv9aJijGYPYsHpwMeCQ/Inavhym3/XaKt1ZKAA8FIw4odTBfowBdZJDMxf2aavyMDkLg==
"@typescript-eslint/type-utils@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.35.1.tgz#d50903b56758c5c8fc3be52b3be40569f27f9c4a"
integrity sha512-8xT8ljvo43Mp7BiTn1vxLXkjpw8wS4oAc00hMSB4L1/jIiYbjjnc3Qp2GAUOG/v8zsNCd1qwcqfCQ0BuishHkw==
dependencies:
"@typescript-eslint/utils" "5.34.0"
"@typescript-eslint/utils" "5.35.1"
debug "^4.3.4"
tsutils "^3.21.0"

"@typescript-eslint/types@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.34.0.tgz"
integrity sha512-49fm3xbbUPuzBIOcy2CDpYWqy/X7VBkxVN+DC21e0zIm3+61Z0NZi6J9mqPmSW1BDVk9FIOvuCFyUPjXz93sjA==
"@typescript-eslint/types@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61"
integrity sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ==

"@typescript-eslint/typescript-estree@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.34.0.tgz"
integrity sha512-mXHAqapJJDVzxauEkfJI96j3D10sd567LlqroyCeJaHnu42sDbjxotGb3XFtGPYKPD9IyLjhsoULML1oI3M86A==
"@typescript-eslint/typescript-estree@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211"
integrity sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA==
dependencies:
"@typescript-eslint/types" "5.34.0"
"@typescript-eslint/visitor-keys" "5.34.0"
"@typescript-eslint/types" "5.35.1"
"@typescript-eslint/visitor-keys" "5.35.1"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"

"@typescript-eslint/utils@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.34.0.tgz"
integrity sha512-kWRYybU4Rn++7lm9yu8pbuydRyQsHRoBDIo11k7eqBWTldN4xUdVUMCsHBiE7aoEkFzrUEaZy3iH477vr4xHAQ==
"@typescript-eslint/utils@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.35.1.tgz#ae1399afbfd6aa7d0ed1b7d941e9758d950250eb"
integrity sha512-v6F8JNXgeBWI4pzZn36hT2HXXzoBBBJuOYvoQiaQaEEjdi5STzux3Yj8v7ODIpx36i/5s8TdzuQ54TPc5AITQQ==
dependencies:
"@types/json-schema" "^7.0.9"
"@typescript-eslint/scope-manager" "5.34.0"
"@typescript-eslint/types" "5.34.0"
"@typescript-eslint/typescript-estree" "5.34.0"
"@typescript-eslint/scope-manager" "5.35.1"
"@typescript-eslint/types" "5.35.1"
"@typescript-eslint/typescript-estree" "5.35.1"
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"

"@typescript-eslint/visitor-keys@5.34.0":
version "5.34.0"
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.34.0.tgz"
integrity sha512-O1moYjOSrab0a2fUvFpsJe0QHtvTC+cR+ovYpgKrAVXzqQyc74mv76TgY6z+aEtjQE2vgZux3CQVtGryqdcOAw==
"@typescript-eslint/visitor-keys@5.35.1":
version "5.35.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6"
integrity sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g==
dependencies:
"@typescript-eslint/types" "5.34.0"
"@typescript-eslint/types" "5.35.1"
eslint-visitor-keys "^3.3.0"

"@vitejs/plugin-react@^2.0.1":
Expand Down Expand Up @@ -1605,11 +1605,6 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

eslint-config-prettier@^8.5.0:
version "8.5.0"
resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz"
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==

eslint-import-resolver-node@^0.3.6:
version "0.3.6"
resolved "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz"
Expand Down Expand Up @@ -1671,13 +1666,6 @@ eslint-plugin-jsx-a11y@^6.6.1:
minimatch "^3.1.2"
semver "^6.3.0"

eslint-plugin-prettier@^4.2.1:
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==
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-plugin-react-hooks@^4.6.0:
version "4.6.0"
resolved "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz"
Expand Down Expand Up @@ -1852,11 +1840,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==

fast-glob@^3.2.11, fast-glob@^3.2.9:
version "3.2.11"
resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz"
Expand Down Expand Up @@ -2820,16 +2803,9 @@ prelude-ls@^1.2.1:
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==

prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"

prettier@^2.7.1:
version "2.7.1"
resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==

prop-types@^15.8.1:
Expand Down

0 comments on commit 702b047

Please sign in to comment.