diff --git a/.eslintrc.js b/.eslintrc.js index 5b999efa4..fc519f6d2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,5 @@ module.exports = { - root: true, - // This tells ESLint to load the config from the package `eslint-config-custom` + root: true, // This tells ESLint to load the config from the package `eslint-config-custom` extends: ["custom"], - settings: { - next: { - rootDir: ["apps/*/"], - }, - }, + settings: { next: { rootDir: ["apps/*/"] } }, }; diff --git a/.gitmodules b/.gitmodules index a0a8ada2b..a9f320eb4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,4 +15,4 @@ url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable - url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable + url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index c39d26c1c..64805fc65 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,8 +2,9 @@ "solidity.packageDefaultDependenciesContractsDirectory": "pkg/contracts/src", "solidity.packageDefaultDependenciesDirectory": "lib", "[solidity]": { - "editor.defaultFormatter": "JuanBlanco.solidity", + "editor.defaultFormatter": "NomicFoundation.hardhat-solidity", "editor.formatOnSave": true }, - "solidity.formatter": "forge" -} + "solidity.formatter": "forge", + "editor.formatOnSave": true, +} \ No newline at end of file diff --git a/apps/docs/pages/index.tsx b/apps/docs/pages/index.tsx index 0d1dabc12..1d72a6fef 100644 --- a/apps/docs/pages/index.tsx +++ b/apps/docs/pages/index.tsx @@ -1,3 +1,4 @@ +import _ from "react"; import { Button } from "ui"; export default function Docs() { diff --git a/apps/web/.eslintrc.js b/apps/web/.eslintrc.js index 16cf4ecde..d86a8a457 100644 --- a/apps/web/.eslintrc.js +++ b/apps/web/.eslintrc.js @@ -2,15 +2,88 @@ * @type {import('eslint').Linter.Config} */ module.exports = { - extends: ["next/core-web-vitals", "turbo", "prettier"], - ignorePatterns: ["node_modules", "dist"], + env: { + browser: true, + es2021: true, + node: true, + }, + extends: [ + "airbnb/hooks", + "airbnb-typescript", + "plugin:@typescript-eslint/recommended", + "plugin:react/recommended", + "plugin:jsx-a11y/recommended", + "next/core-web-vitals", + "prettier/prettier", + ], + plugins: ["react"], + ignorePatterns: ["node_modules", "dist", "src/generated.ts", "public"], + parser: "@typescript-eslint/parser", parserOptions: { - babelOptions: { - presets: [require.resolve("next/babel")], - }, + project: "./tsconfig.json", }, rules: { + "react/jsx-filename-extension": [ + 2, + { extensions: [".js", ".jsx", ".ts", ".tsx"] }, + ], "react-hooks/exhaustive-deps": "off", - "no-html-link-for-pages": "off", + "@next/next/no-html-link-for-pages": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@next/next/no-page-custom-font": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/prefer-nullish-coalescing": "error", + "react/self-closing-comp": [ + "error", + { + component: true, + html: true, + }, + ], + "no-unreachable": "warn", + "import/order": [ + "error", + { + groups: ["builtin", "external", "internal"], + pathGroups: [ + { + pattern: "react", + group: "external", + position: "before", + }, + ], + pathGroupsExcludedImportTypes: ["react"], + alphabetize: { + order: "asc", + caseInsensitive: true, + }, + }, + ], + "no-console": [ + "warn", + { + allow: ["warn", "error", "info", "debug", "table"], + }, + ], + "prefer-const": "off", + "@typescript-eslint/consistent-type-definitions": "off", + "no-unused-expressions": "error", + "no-unsafe-optional-chaining": "error", + "import/extensions": "off", + "@typescript-eslint/quotes": ["error", "double"], + "@typescript-eslint/no-use-before-define": "off", + "jsx-a11y/no-static-element-interactions": "off", + "react/no-array-index-key": "warn", + indent: "off", + "@typescript-eslint/indent": "off", }, }; diff --git a/apps/web/.vscode/extensions.json b/apps/web/.vscode/extensions.json index cdfb20ce3..643dfeccc 100644 --- a/apps/web/.vscode/extensions.json +++ b/apps/web/.vscode/extensions.json @@ -1,6 +1,3 @@ { - "recommendations": [ - "skillhub.daisy-ui-latest-snippets", - "bradlc.vscode-tailwindcss" - ] -} \ No newline at end of file + "recommendations": ["skillhub.daisy-ui-latest-snippets", "bradlc.vscode-tailwindcss"] +} diff --git a/apps/web/.vscode/launch.json b/apps/web/.vscode/launch.json index f3704121e..70d4de43c 100644 --- a/apps/web/.vscode/launch.json +++ b/apps/web/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Next.js: debug server-side", "type": "node-terminal", "request": "launch", - "command": "pnpm dev", + "command": "pnpm dev" }, { "name": "Next.js: debug client-side", diff --git a/apps/web/.vscode/settings.json b/apps/web/.vscode/settings.json new file mode 100644 index 000000000..f2d1bb736 --- /dev/null +++ b/apps/web/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "editor.formatOnSave": true, + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "always" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "[typescript]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "css.lint.unknownAtRules": "ignore", + "[javascript]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "editor.tabSize": 2, +} \ No newline at end of file diff --git a/apps/web/actions/getProposals.ts b/apps/web/actions/getProposals.ts index b5e478425..bcd54f0d5 100644 --- a/apps/web/actions/getProposals.ts +++ b/apps/web/actions/getProposals.ts @@ -6,7 +6,7 @@ export async function getProposals( strategy: LightCVStrategy, ) { try { - async function fetchIPFSDataBatch( + const fetchIPFSDataBatch = async function ( proposals: LightProposal[], batchSize = 5, delay = 300, @@ -41,28 +41,30 @@ export async function getProposals( } return results; - } + }; - async function transformProposals(strategy: LightCVStrategy) { - const proposalsData = await fetchIPFSDataBatch(strategy.proposals); - const transformedProposals = proposalsData.map((data, index) => { - const p = strategy.proposals[index]; - return { - ...p, - voterStakedPointsPct: 0, - stakedAmount: strategy.proposals[index].stakedAmount, - title: data.title, - type: strategy.config?.proposalType as number, - status: strategy.proposals[index].proposalStatus, - }; - }); + const transformProposals = async function (_strategy: LightCVStrategy) { + const proposalsData = await fetchIPFSDataBatch(_strategy.proposals); + const transformedProposals = proposalsData + .map((data, index) => { + const p = _strategy.proposals[index]; + return { + ...p, + voterStakedPointsPct: 0, + stakedAmount: _strategy.proposals[index].stakedAmount, + title: data.title, + type: _strategy.config?.proposalType as number, + status: _strategy.proposals[index].proposalStatus, + }; + }) + .sort((a, b) => +a.proposalNumber - +b.proposalNumber); // Sort by proposal number ascending return transformedProposals; - } + }; let transformedProposals = await transformProposals(strategy); return transformedProposals; } catch (error) { - console.log(error); + console.error("Error while getting proposal ipfs metadata", error); } } diff --git a/apps/web/app/(app)/docs/page.tsx b/apps/web/app/(app)/docs/page.tsx index 133632706..ea2a5bca2 100644 --- a/apps/web/app/(app)/docs/page.tsx +++ b/apps/web/app/(app)/docs/page.tsx @@ -1,5 +1,5 @@ import React from "react"; -export default function Docs() { +export default function Page() { return
subtitle for pool form creation...
-Registration cost:
-{covenant}
- ) : ( -No covenant was submitted.
- )} + :No covenant was submitted.
}- Create a vibrant community around the {tokenGarden.name} by - providing the necessary details below. + Create a vibrant community around the{" "} + {tokenGarden.name} by providing the necessary + details below.
- Discover communities in the - {tokenGarden?.name} Garden, - where you connect with people and support proposals bounded by a - shared - covenant. -
-+ Discover communities in the + {tokenGarden?.name} Garden, + where you connect with people and support proposals bounded by a + shared + covenant. +
+No Gardens
- ); } + return ( +No Gardens
+ ); }, [fetching, tokenGardens?.length]); return ( @@ -83,7 +83,7 @@ export default function Gardens() {+ Gardens is a coordination platform giving communities + streamlined access to web3’s best decision-sourcing mechanisms. +
++ Our emphasis is on a community experience that’s{" "} + + healthy, fun, intuitive, secure, and open. + +
+ {/*+ Gardens is a versatile platform designed to nurture and grow + decentralized ecosystems. Our intuitive tools empower a wide range + of organizations and individuals to harness the power of + collective intelligence, from token-based economies to public + goods initiatives. +
+{feature.description}
++ Comprehensive DAO Toolkit +
++ {/* TODO: see if neccesary some minor description here */} + Gardens leverages cutting-edge Web3 technology to deliver a secure, + transparent, and decentralized platform. +
++ {feature.description} +
++ Coming August 2024! +
+