diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f079461..9c29cad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,6 +17,6 @@ jobs: node-version: 18 cache: 'npm' - name: Install dependencies - run: npm ci + run: npm install - name: Run lint run: npm run lint \ No newline at end of file diff --git a/README.md b/README.md index 8393c55..751ffe4 100644 --- a/README.md +++ b/README.md @@ -129,10 +129,11 @@ You can now run locally. ### Linting and Code Formatting -We use ESLint with Next.js configuration and Prettier for code formatting. We've kept the linting process simple with just two commands: +We use ESLint with Next.js configuration and Prettier for code formatting: -- `npm run lint` - Run ESLint to check for issues -- `npm run lint:fix` - Fix both ESLint and Prettier formatting issues in one command +1. First-time setup: `npm run setup-lint` +2. Check code: `npm run lint` +3. Fix issues: `npm run lint:fix` Before submitting a PR, please run `npm run lint:fix` to ensure your code follows our standards. diff --git a/package.json b/package.json index bbfdcbc..edaf6d3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "build": "npx prisma generate && next build && npx prisma migrate deploy", "start": "next start", "lint": "next lint", - "lint:fix": "next lint --fix && prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", + "lint:fix": "next lint --fix && npx prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", + "setup-lint": "npm install --save-dev prettier@3.5.3", "postinstall": "npx prisma generate" }, "dependencies": { diff --git a/src/pages/api/lightning-address/callback/[slug].js b/src/pages/api/lightning-address/callback/[slug].js index f9e476a..68f12e3 100644 --- a/src/pages/api/lightning-address/callback/[slug].js +++ b/src/pages/api/lightning-address/callback/[slug].js @@ -81,12 +81,10 @@ export default async function handler(req, res) { }, } ); - res - .status(200) - .json({ - pr: response.data.invoice, - verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}`, - }); + res.status(200).json({ + pr: response.data.invoice, + verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}`, + }); } catch (error) { console.error(error); res.status(500).json({ error: 'Failed to generate invoice' });