Skip to content

Commit d99232f

Browse files
fix: eslint error and add husky lint-staged
1 parent 497bd03 commit d99232f

File tree

31 files changed

+492
-155
lines changed

31 files changed

+492
-155
lines changed

.cursorrules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ import { RozoPayProvider, RozoPayButton } from '@rozoai/intent-pay';
173173

174174
### Build Commands
175175

176-
- `bun run dev`: Development mode with watch
177-
- `bun run build`: Production build
178-
- `bun run lint`: ESLint validation
176+
- `pnpm run dev`: Development mode with watch
177+
- `pnpm run build`: Production build
178+
- `pnpm run lint`: ESLint validation
179179

180180
## Important Notes
181181

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

package.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,31 @@
55
"description": "",
66
"main": "index.js",
77
"scripts": {
8-
"build": "bun --filter @rozoai/intent-common build && bun --filter @rozoai/intent-pay build",
9-
"dev": "bun --concurrent --filter '@rozoai/*' dev",
10-
"dev:common": "bun --filter @rozoai/intent-common build --watch",
11-
"dev:pay": "bun --filter @rozoai/intent-pay dev",
12-
"dev:example": "bun --filter @rozoai/pay-nextjs-app-example dev",
13-
"install:local": "bun install",
14-
"release": "bun build && bun --filter @rozoai/intent-common publish && bun --filter @rozoai/intent-pay release",
8+
"build": "pnpm --filter @rozoai/intent-common build && pnpm --filter @rozoai/intent-pay build",
9+
"dev": "pnpm --concurrent --filter '@rozoai/*' dev",
10+
"dev:common": "pnpm --filter @rozoai/intent-common build --watch",
11+
"dev:pay": "pnpm --filter @rozoai/intent-pay dev",
12+
"dev:example": "pnpm --filter @rozoai/pay-nextjs-app-example dev",
13+
"install:local": "pnpm install",
14+
"prepare": "husky",
15+
"release": "pnpm build && pnpm --filter @rozoai/intent-common publish && pnpm --filter @rozoai/intent-pay release",
1516
"clean": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
16-
"clean:full": "bun clean && rm -f bun.lock",
17+
"clean:full": "pnpm clean && rm -f bun.lock",
1718
"clean:deps": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + && find . -name 'dist' -type d -prune -exec rm -rf '{}' + && find . -name 'build' -type d -prune -exec rm -rf '{}' + && find . -name '.next' -type d -prune -exec rm -rf '{}' +",
1819
"clean:all": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + && find . -name 'dist' -type d -prune -exec rm -rf '{}' + && find . -name 'build' -type d -prune -exec rm -rf '{}' + && find . -name '.next' -type d -prune -exec rm -rf '{}' + && rm -f pnpm-lock.yaml"
1920
},
21+
"lint-staged": {
22+
"packages/connectkit/**/*.{js,jsx,ts,tsx}": [
23+
"cd packages/connectkit && pnpm exec eslint --quiet"
24+
]
25+
},
2026
"keywords": [],
2127
"author": "",
2228
"license": "ISC",
2329
"devDependencies": {
2430
"bumpp": "^10.1.1",
31+
"husky": "^9.1.7",
32+
"lint-staged": "^16.2.7",
2533
"react": "^18.2.0",
2634
"react-dom": "^18.2.0",
2735
"viem": "^2.23.2",

packages/connectkit/bundle-analysis.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/connectkit/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dev": "rollup --config rollup.config.js -w",
2828
"build": "rollup --config rollup.config.js",
2929
"prepare": "npm run build",
30-
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings=0",
30+
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
3131
"release": "bumpp"
3232
},
3333
"keywords": [
@@ -98,8 +98,8 @@
9898
"@types/react-dom": "^18.2.18",
9999
"@types/rollup-plugin-peer-deps-external": "^2.2.5",
100100
"@types/styled-components": "^5.1.25",
101-
"@typescript-eslint/eslint-plugin": "^6.21.0",
102-
"@typescript-eslint/parser": "^6.21.0",
101+
"@typescript-eslint/eslint-plugin": "^8.0.0",
102+
"@typescript-eslint/parser": "^8.0.0",
103103
"@walletconnect/types": "^2.22.3",
104104
"eslint": "^8.57.0",
105105
"eslint-plugin-react": "^7.37.0",

packages/connectkit/src/assets/crepe.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

packages/connectkit/src/assets/wallet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ export default function WalletIcon({ ...props }) {
2323
<circle cx="10.3863" cy="10.1894" r="1.32574" fill="currentColor" />
2424
</svg>
2525
);
26-
};
26+
}

packages/connectkit/src/components/Common/CustomQRCode/QRCode.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import React, { ReactElement, useMemo } from "react";
33

44
const generateMatrix = (
55
value: string,
6-
errorCorrectionLevel: QRCodeUtil.QRCodeErrorCorrectionLevel,
6+
errorCorrectionLevel: QRCodeUtil.QRCodeErrorCorrectionLevel
77
) => {
88
const arr = Array.prototype.slice.call(
99
QRCodeUtil.create(value, { errorCorrectionLevel }).modules.data,
10-
0,
10+
0
1111
);
1212
const sqrt = Math.sqrt(arr.length);
1313
return arr.reduce(
1414
(rows, key, index) =>
1515
(index % sqrt === 0
1616
? rows.push([key])
1717
: rows[rows.length - 1].push(key)) && rows,
18-
[],
18+
[]
1919
);
2020
};
2121

@@ -43,7 +43,7 @@ export function QRCode({
4343
const dots: ReactElement[] = [];
4444
const matrix = generateMatrix(uri, ecl);
4545
const cellSize = size / matrix.length;
46-
let qrList = [
46+
const qrList = [
4747
{ x: 0, y: 0 },
4848
{ x: 1, y: 0 },
4949
{ x: 0, y: 1 },
@@ -67,7 +67,7 @@ export function QRCode({
6767
height={cellSize * (7 - i * 2)}
6868
x={x1 + cellSize * i}
6969
y={y1 + cellSize * i}
70-
/>,
70+
/>
7171
);
7272
}
7373
});
@@ -96,7 +96,7 @@ export function QRCode({
9696
{image}
9797
</div>
9898
</foreignObject>
99-
</>,
99+
</>
100100
);
101101
}
102102

@@ -132,7 +132,7 @@ export function QRCode({
132132
cy={j * cellSize + cellSize / 2}
133133
fill="var(--ck-qr-dot-color)"
134134
r={cellSize / 3}
135-
/>,
135+
/>
136136
);
137137
}
138138
}

packages/connectkit/src/components/Common/Modal/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,14 @@ const Modal: React.FC<ModalProps> = ({
402402
case ROUTES.STELLAR_SELECT_AMOUNT:
403403
case ROUTES.SELECT_WALLET_AMOUNT:
404404
return "Select Amount";
405-
case ROUTES.PAY_WITH_TOKEN:
405+
case ROUTES.PAY_WITH_TOKEN: {
406406
if (selectedTokenOption == null) return undefined;
407407

408408
const chainName = getChainName(
409409
selectedTokenOption.balance.token.chainId
410410
);
411411
return `Pay with ${chainName} ${selectedTokenOption.balance.token.symbol}`;
412+
}
412413
case ROUTES.CONFIRMATION:
413414
return "Payment Successful";
414415
case ROUTES.ERROR:

packages/connectkit/src/components/Common/OrderHeader/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ export const OrderHeader = ({
9494
);
9595
};
9696

97-
let walletIcon = renderIcon(connector?.icon);
98-
let solanaIcon = renderIcon(
97+
const walletIcon = renderIcon(connector?.icon);
98+
const solanaIcon = renderIcon(
9999
solanaWallet?.adapter.icon || <Solana />,
100100
solanaWallet?.adapter.name
101101
);
102-
let stellarIcon = renderIcon(
102+
const stellarIcon = renderIcon(
103103
stellarConnector?.icon || <Stellar />,
104104
stellarConnector?.name
105105
);

0 commit comments

Comments
 (0)