Skip to content

Commit 514cead

Browse files
authored
Merge pull request #33 from greenpill-dev-guild/dev
Dev into Main
2 parents 5404d4b + bead02e commit 514cead

File tree

414 files changed

+62995
-44646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+62995
-44646
lines changed

.biomeignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Build artifacts and generated files
2+
.next/
3+
node_modules/
4+
dist/
5+
build/
6+
coverage/
7+
.nyc_output/
8+
9+
# Minified files
10+
**/*.min.js
11+
**/*.min.css
12+
13+
# Auto-generated files
14+
client/generated.ts
15+
client/config/deployments.auto.ts
16+
**/*.auto.ts
17+
**/*.generated.ts
18+
**/*.generated.tsx

.cursor/cursor-config.json

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
{
2+
"rules": [
3+
{
4+
"include": ".cursor/rules/root-standards.mdc",
5+
"description": "Cookie Jar monorepo standards - always applied",
6+
"alwaysApply": true
7+
},
8+
{
9+
"include": ".cursor/rules/web3-patterns.mdc",
10+
"description": "Web3 integration patterns with viem/wagmi",
11+
"when": "path.match(/\\.(ts|tsx|sol)$/)"
12+
},
13+
{
14+
"include": ".cursor/rules/testing-patterns.mdc",
15+
"description": "Testing standards for unit, integration, and E2E tests",
16+
"when": "path.match(/\\.(test|spec|t)\\.(ts|tsx|sol)$/)"
17+
},
18+
{
19+
"include": ".cursor/rules/deployment.mdc",
20+
"description": "Production deployment patterns and security",
21+
"when": "path.match(/script\\/.*\\.s\\.sol$/) || path.includes('deploy')"
22+
},
23+
{
24+
"include": "client/.cursor/rules/frontend-standards.mdc",
25+
"description": "Frontend development standards - Next.js, React, TypeScript",
26+
"when": "path.includes('client/')"
27+
},
28+
{
29+
"include": "contracts/.cursor/rules/solidity-standards.mdc",
30+
"description": "Solidity standards - security, gas optimization, testing",
31+
"when": "path.includes('contracts/')"
32+
},
33+
{
34+
"include": "e2e/.cursor/rules/e2e-standards.mdc",
35+
"description": "E2E testing with Playwright - user flows and accessibility",
36+
"when": "path.includes('e2e/')"
37+
}
38+
],
39+
"composer": {
40+
"includeEditedFiles": true,
41+
"maxTokens": 150000,
42+
"autoIncludeRelatedFiles": true
43+
},
44+
"chat": {
45+
"maxTokens": 150000,
46+
"temperature": 0.2,
47+
"contextStrategy": "adaptive"
48+
},
49+
"features": {
50+
"codeActions": true,
51+
"diagnostics": true,
52+
"hover": true,
53+
"signatureHelp": true,
54+
"documentSymbol": true,
55+
"workspaceSymbol": true,
56+
"references": true,
57+
"rename": true,
58+
"foldingRange": true,
59+
"selectionRange": true,
60+
"semanticTokens": true,
61+
"inlayHints": true,
62+
"autoImports": true
63+
},
64+
"integrations": {
65+
"github": {
66+
"enabled": true,
67+
"autoLink": true,
68+
"prTemplates": true,
69+
"issueContext": true
70+
},
71+
"testing": {
72+
"enabled": true,
73+
"frameworks": ["vitest", "playwright", "foundry"],
74+
"autoRun": false
75+
}
76+
},
77+
"project": {
78+
"type": "monorepo",
79+
"name": "Cookie Jar Protocol",
80+
"description": "Decentralized funding pools with smart access control",
81+
"structure": {
82+
"client": {
83+
"type": "frontend",
84+
"framework": "Next.js 15 + React 18 + TypeScript",
85+
"styling": "Tailwind CSS + shadcn/ui",
86+
"web3": "viem + wagmi + RainbowKit",
87+
"testing": "Vitest + React Testing Library"
88+
},
89+
"contracts": {
90+
"type": "smart-contracts",
91+
"framework": "Foundry + Solidity ^0.8.0",
92+
"libraries": "OpenZeppelin + Custom Libraries",
93+
"testing": "Foundry Test Suite"
94+
},
95+
"e2e": {
96+
"type": "testing",
97+
"framework": "Playwright",
98+
"focus": "User flows + Accessibility + Performance"
99+
},
100+
"docs": {
101+
"type": "documentation",
102+
"format": "Markdown + AI Agent Guidelines"
103+
}
104+
},
105+
"packageManager": "pnpm",
106+
"nodeVersion": ">=18.0.0",
107+
"networks": ["Base", "Optimism", "Gnosis Chain", "Base Sepolia"],
108+
"protocols": ["POAP", "Unlock Protocol", "Hypercerts", "Hats Protocol"]
109+
},
110+
"ai": {
111+
"codeGeneration": {
112+
"style": "functional",
113+
"testing": "comprehensive",
114+
"documentation": "minimal-but-clear",
115+
"errorHandling": "explicit",
116+
"security": "strict",
117+
"accessibility": "wcag-aa",
118+
"performance": "optimized"
119+
},
120+
"preferences": {
121+
"codeFirst": true,
122+
"explainTradeoffs": true,
123+
"assumptionsInComments": true,
124+
"breakDownComplexTasks": true,
125+
"mobileFirst": true,
126+
"web3Security": true
127+
},
128+
"quality": {
129+
"testCoverage": "90%+",
130+
"typeScriptStrict": true,
131+
"lintingRequired": true,
132+
"gasOptimization": true,
133+
"bundleSize": "monitored"
134+
}
135+
},
136+
"development": {
137+
"commands": {
138+
"dev": "pnpm dev",
139+
"test": "pnpm test",
140+
"testE2e": "pnpm test:e2e",
141+
"testContracts": "cd contracts && forge test",
142+
"build": "pnpm build",
143+
"lint": "pnpm lint",
144+
"coverage": "pnpm test:coverage"
145+
},
146+
"environment": {
147+
"blockchain": "Anvil (auto-started with pnpm dev)",
148+
"frontend": "http://localhost:3000",
149+
"hotReload": true,
150+
"typeGeneration": true
151+
}
152+
},
153+
"guild": {
154+
"name": "Greenpill Dev Guild",
155+
"principles": "open-source, transparent, regen-positive",
156+
"projects": ["Green Goods", "Cookie Jar", "Community Host", "Allo Yeeter", "GreenWill"],
157+
"standards": {
158+
"web3": "viem over ethers, testnet-first, gas-conscious",
159+
"frontend": "React functional, mobile-first PWA, accessibility",
160+
"contracts": "OpenZeppelin, NatSpec docs, comprehensive testing",
161+
"testing": "90%+ coverage, user-centric e2e flows"
162+
}
163+
},
164+
"workspace": {
165+
"fileAssociations": {
166+
"*.sol": "solidity",
167+
"*.t.sol": "solidity-test",
168+
"*.spec.ts": "playwright-test"
169+
},
170+
"searchExcludes": [
171+
"**/node_modules/**",
172+
"**/out/**",
173+
"**/cache/**",
174+
"**/broadcast/**",
175+
"**/.next/**"
176+
]
177+
}
178+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<!-- 6c1fed42-3933-4d92-b17a-2ae8eead0573 23b313c3-237f-4d1c-b693-52e8f9d0b861 -->
2+
# Fix ESLint Errors and Migrate to ESLint CLI
3+
4+
## Current Issues
5+
- `next lint` deprecated → need to migrate to ESLint CLI
6+
- Parser errors with numeric separators (16 files) → config issue
7+
- 40+ unused variables → prefix with `_` or remove
8+
- 35+ console statements → convert to `log.*`
9+
- 5 img tags → convert to `<Image />`
10+
- 5 hook dependency issues → add missing deps
11+
12+
## Solution Strategy
13+
14+
### 1. Fix ESLint Parser Configuration
15+
16+
**Problem**: "Parsing error: Numeric separators are not allowed here"
17+
18+
**Root Cause**: ESLint parser not configured for modern TypeScript features
19+
20+
**Fix**: Update `client/.eslintrc.json`:
21+
```json
22+
{
23+
"extends": ["next/core-web-vitals"],
24+
"parserOptions": {
25+
"ecmaVersion": 2021,
26+
"sourceType": "module"
27+
},
28+
"rules": {
29+
"no-unused-vars": "error",
30+
"no-console": "warn",
31+
"react/no-unescaped-entities": "error",
32+
"@next/next/no-img-element": "error",
33+
"react-hooks/exhaustive-deps": "error",
34+
"react-hooks/rules-of-hooks": "error"
35+
}
36+
}
37+
```
38+
39+
### 2. Migrate to ESLint CLI
40+
41+
**Current**: `"lint": "next lint"`
42+
**New**: `"lint": "eslint . --ext .ts,.tsx,.js,.jsx"`
43+
44+
Update `client/package.json`:
45+
```json
46+
"scripts": {
47+
"lint": "eslint . --ext .ts,.tsx,.js,.jsx --max-warnings 0",
48+
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
49+
"build": "pnpm run lint && next build"
50+
}
51+
```
52+
53+
### 3. Auto-Fix Simple Errors
54+
55+
Run ESLint auto-fix to handle:
56+
- Formatting issues
57+
- Some unused imports
58+
- Fixable spacing/syntax issues
59+
60+
```bash
61+
cd client
62+
pnpm lint:fix
63+
```
64+
65+
### 4. Fix Unused Variables (Systematic Approach)
66+
67+
**Strategy**: Prefix with `_` if needed for destructuring/API, remove if truly unused
68+
69+
Files to fix:
70+
- `components/create/CreateJarModals.tsx` (2 vars)
71+
- `components/docs/DocsSidebar.tsx` (1 var)
72+
- `components/jar/AdminFunctions.tsx` (1 var)
73+
- `components/jar/AllowListAddressInput.tsx` (1 var)
74+
- `components/jars/JarContentLazy.tsx` (1 var)
75+
- `components/nft/ProtocolSelector.tsx` (5 vars)
76+
- `components/nft/UnlockMembershipStatus.tsx` (1 var)
77+
- `components/nft/protocols/*.tsx` (4 vars)
78+
- `components/profile/MobileProfile.tsx` (1 var)
79+
- `components/ui/chart.tsx` (4 vars)
80+
- `components/ui/sidebar.tsx` (4 vars)
81+
- `components/ui/use-toast.ts` (1 var)
82+
- `components/wallet/CustomConnectButton.tsx` (1 var)
83+
- `lib/app/logger.ts` (5 vars)
84+
- `lib/blockchain/token-utils.ts` (1 var)
85+
- `lib/nft/AlchemyProvider.ts` (6 vars)
86+
- `lib/nft/advanced/*.ts` (3 vars)
87+
- `lib/nft/cache/NFTCacheManager.ts` (2 vars)
88+
- `lib/nft/performance/NFTPerformanceOptimizer.ts` (2 vars)
89+
- `lib/nft/protocols/*.ts` (11 vars)
90+
91+
### 5. Fix Console Statements
92+
93+
**Strategy**: Already have logger, but it uses console internally - add no-console exception for logger file
94+
95+
Add to `lib/app/logger.ts`:
96+
```typescript
97+
/* eslint-disable no-console */
98+
// Logger implementation needs console
99+
```
100+
101+
### 6. Fix Hook Dependencies
102+
103+
Add missing dependencies to:
104+
- `components/nft/protocols/HatsConfig.tsx` - add `validateHat`
105+
- `components/nft/protocols/HypercertConfig.tsx` - add `validateHypercert`
106+
- `components/nft/protocols/UnlockConfig.tsx` - add `validateLock`
107+
- `components/wallet/CustomConnectButton.tsx` - add `checkTermsAccepted`
108+
- `components/jars/JarContentLazy.tsx` - remove `filterOption`
109+
110+
### 7. Convert img to Image
111+
112+
Files needing conversion:
113+
- `components/nft/protocols/HatsConfig.tsx` (1)
114+
- `components/nft/protocols/HypercertConfig.tsx` (1)
115+
- `components/nft/protocols/POAPConfig.tsx` (2)
116+
- `components/wallet/CustomConnectButton.tsx` (1)
117+
118+
## Quick Command Sequence
119+
120+
```bash
121+
# 1. Update ESLint config (manual edit)
122+
# 2. Migrate to ESLint CLI (manual edit package.json)
123+
124+
# 3. Run auto-fix
125+
cd client
126+
pnpm lint:fix
127+
128+
# 4. Fix remaining issues (manual edits)
129+
130+
# 5. Verify
131+
pnpm lint
132+
pnpm type-check
133+
pnpm build
134+
```
135+
136+
## Expected Outcome
137+
138+
- ✅ Parser errors resolved (numeric separators work)
139+
- ✅ ESLint CLI migration complete
140+
- ✅ Auto-fixable errors resolved
141+
- ✅ Unused variables prefixed or removed
142+
- ✅ Console statements in logger file exempted
143+
- ✅ Hook dependencies corrected
144+
- ✅ Images converted to Next.js Image component
145+
- ✅ Build passes without errors
146+
147+
148+
### To-dos
149+
150+
- [ ] Update .eslintrc.json with parserOptions for numeric separators
151+
- [ ] Update package.json to use ESLint CLI instead of next lint
152+
- [ ] Run pnpm lint:fix to auto-fix simple errors
153+
- [ ] Prefix unused variables with _ or remove them
154+
- [ ] Add eslint-disable for console in logger.ts
155+
- [ ] Add missing hook dependencies or remove unnecessary ones
156+
- [ ] Convert img tags to Next.js Image component
157+
- [ ] Verify build passes with pnpm build

0 commit comments

Comments
 (0)