Skip to content

Commit 01b3695

Browse files
Add ESLint and Prettier config (#618)
* add eslint / prettier config * lint / format * lint fixes * lint / format * package lock * fix closing tag * fix closing tags * fix build * fix ignore steps * lint * fix about receiving * ignore about erceiving for linting * Update src/content/docs/developers/about-receiving.mdx Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com> * revert about receiving * revert aboutreceiving * devdependency * fix bulletpoints * ignore codeblocks * fix steps * fix the :::note prettier wrap issue * lint and format mdx files * fix lists and rm ignore files * fix number list * fix numbered list * fix lint * fix about receiving * rm files from prettier ignor * fix ::note * add indented list * fix notes * fix code block * revert type change * better eslint config * update package lock * rm pnpm lock * consistent eslint to docs design system * fix lint * add netlify npm fix * netlify npm * Update src/content/docs/publishers/link-tag-tool.mdx Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com> * Update src/content/docs/publishers/link-tag-tool.mdx Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com> * refactor(send-test-payments): replace Steps component with ordered lists for better readability * fix codeblock * fix steps and imgs * fix linkout link * fix get started * ci: use npm ci with optional deps * ci: install rollup linux binary --------- Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com>
1 parent 922e079 commit 01b3695

File tree

93 files changed

+11377
-1880
lines changed

Some content is hidden

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

93 files changed

+11377
-1880
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci --include=optional
27+
28+
- name: Run lint (Prettier + ESLint)
29+
run: npm run lint
30+

.github/workflows/deploy.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@ jobs:
2020
steps:
2121
- name: Checkout your repository using git
2222
uses: actions/checkout@v3
23-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v4
2424
with:
25-
node-version: 18
25+
node-version: 22
26+
cache: npm
2627

27-
- uses: oven-sh/setup-bun@v1
2828
- name: Install dependencies
29-
run: bun install
29+
run: npm ci --include=optional
30+
- name: Install Rollup native binary
31+
run: |
32+
ROLLUP_VERSION=$(node -p "require('./package-lock.json').packages['node_modules/rollup'].optionalDependencies['@rollup/rollup-linux-x64-gnu']")
33+
npm install --no-save "@rollup/rollup-linux-x64-gnu@${ROLLUP_VERSION}"
3034
- name: Test build website
31-
run: bun run build
35+
run: npm run build
3236

3337
- name: Upload artifact
3438
uses: actions/upload-pages-artifact@v3

.github/workflows/test-build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: oven-sh/setup-bun@v1
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
1720

1821
- name: Install dependencies
19-
run: bun install
22+
run: npm ci --include=optional
23+
- name: Install Rollup native binary
24+
run: |
25+
ROLLUP_VERSION=$(node -p "require('./package-lock.json').packages['node_modules/rollup'].optionalDependencies['@rollup/rollup-linux-x64-gnu']")
26+
npm install --no-save "@rollup/rollup-linux-x64-gnu@${ROLLUP_VERSION}"
2027
- name: Test build website
21-
run: bun run build
28+
run: npm run build

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
# Shared ignores from paymentpointers.org
2+
.github
3+
.astro
4+
node_modules
5+
public
6+
dist
7+
**/*.min.css
8+
**/*.min.js
9+
110
# Don't disagree with W3C style on the spec
211
src/pages/specification

.prettierrc

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
semi: false
2-
tabWidth: 2
3-
jsxSingleQuote: true
4-
bracketSpacing: true
5-
singleQuote: true
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"plugins": ["prettier-plugin-astro"],
6+
"overrides": [
7+
{
8+
"files": "**/*.astro",
9+
"options": {
10+
"parser": "astro"
11+
}
12+
},
13+
{
14+
"files": "**/*.mdx",
15+
"options": {
16+
"proseWrap": "preserve"
17+
}
18+
}
19+
]
20+
}

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ bun install
3636

3737
All commands are run from the root of the project, from a terminal:
3838

39-
| Command | Action |
40-
| :------------------------ | :----------------------------------------------- |
41-
| `bun run start` | Starts local dev server at `localhost:1100` |
42-
| `bun run build` | Build your production site to `./dist/` |
43-
| `bun run preview` | Preview your build locally before deploying |
44-
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
45-
| `bun run astro -- --help` | Get help using the Astro CLI |
39+
| Command | Action |
40+
| :------------------------ | :--------------------------------------------------------- |
41+
| `bun run start` | Starts local dev server at `localhost:1100` |
42+
| `bun run build` | Build your production site to `./dist/` |
43+
| `bun run preview` | Preview your build locally before deploying |
44+
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
45+
| `bun run astro -- --help` | Get help using the Astro CLI |
46+
| `bun run lint` | Check code formatting and quality with Prettier and ESLint |
47+
| `bun run format` | Format code and fix linting issues automatically |
4648

4749
You can substitute the bun commands with your chosen package manager's commands.
4850

0 commit comments

Comments
 (0)