mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 10:51:20 +00:00
fix lint workflow, add setup script for lint, update readme with lint instructions
This commit is contained in:
parent
a090898fad
commit
2eed15e714
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -17,6 +17,6 @@ jobs:
|
|||||||
node-version: 18
|
node-version: 18
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm install
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
run: npm run lint
|
run: npm run lint
|
@ -129,10 +129,11 @@ You can now run locally.
|
|||||||
|
|
||||||
### Linting and Code Formatting
|
### 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
|
1. First-time setup: `npm run setup-lint`
|
||||||
- `npm run lint:fix` - Fix both ESLint and Prettier formatting issues in one command
|
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.
|
Before submitting a PR, please run `npm run lint:fix` to ensure your code follows our standards.
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"build": "npx prisma generate && next build && npx prisma migrate deploy",
|
"build": "npx prisma generate && next build && npx prisma migrate deploy",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"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"
|
"postinstall": "npx prisma generate"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -81,12 +81,10 @@ export default async function handler(req, res) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
res
|
res.status(200).json({
|
||||||
.status(200)
|
pr: response.data.invoice,
|
||||||
.json({
|
verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}`,
|
||||||
pr: response.data.invoice,
|
});
|
||||||
verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}`,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
res.status(500).json({ error: 'Failed to generate invoice' });
|
res.status(500).json({ error: 'Failed to generate invoice' });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user