Skip to content

Commit d30d04f

Browse files
authored
Merge pull request #148 from interledger/am/formatting
Chore: Add prettier and eslint as devDependencies
2 parents 9f8ee0f + ac2fc97 commit d30d04f

Some content is hidden

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

46 files changed

+4012
-2155
lines changed

.github/workflows/test-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ jobs:
2424
- uses: oven-sh/setup-bun@v1
2525
- name: Install dependencies
2626
run: bun install
27+
- name: Check formatting
28+
run: bun run format:check
29+
- name: Check linting
30+
run: bun run lint
2731
- name: Test build website
2832
run: bun run build

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
.astro
3+
node_modules
4+
public
5+
dist
6+
**/*.min.css
7+
**/*.min.js

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "none",
4+
"plugins": ["prettier-plugin-astro"],
5+
"overrides": [
6+
{
7+
"files": "**/*.astro",
8+
"options": {
9+
"parser": "astro"
10+
}
11+
}
12+
]
13+
}

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ All commands are run from the root of the project, from a terminal:
5353
| `bun run preview` | Preview your build locally, before deploying |
5454
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
5555
| `bun run astro -- --help` | Get help using the Astro CLI |
56+
| `bun run format` | Format all files with Prettier |
57+
| `bun run format:check` | Check code formatting for all files |
58+
| `bun run lint` | Run Linting |
5659

5760
You can substitute the `bun` commands with whatever package manager of your choice uses.
5861

@@ -68,22 +71,22 @@ Thank You for Contributing! We appreciate your effort to write a blog post and s
6871

6972
**Typical Target Audience:**
7073

71-
* Technically-inclined users interested in Interledger development.
72-
* Technically-inclined users interested in financial services technologies, innovations, or developments.
73-
* Users keen on topics like APIs, data analytics, metrics, analysis, and quantitative assessment for digital networks.
74-
* Users interested in privacy and related technologies.
74+
- Technically-inclined users interested in Interledger development.
75+
- Technically-inclined users interested in financial services technologies, innovations, or developments.
76+
- Users keen on topics like APIs, data analytics, metrics, analysis, and quantitative assessment for digital networks.
77+
- Users interested in privacy and related technologies.
7578

7679
**Possible Content Framework:**
7780

7881
If you're unsure how to structure your writing, you can use this as a guide.
7982

80-
* Introduction / main point
81-
* Context - Interledger’s perspective / stance / commitment on the topic being written [broader categories like privacy, metrics for growth, Digital Financial Inclusion etc.]
82-
* The Challenge (or) The Problem
83-
* The Solution
84-
* The How / implementation
85-
* Roadmap - short-term / long-term
86-
* Note: A call to action (CTA) will be included automatically at the bottom of every post.
83+
- Introduction / main point
84+
- Context - Interledger’s perspective / stance / commitment on the topic being written [broader categories like privacy, metrics for growth, Digital Financial Inclusion etc.]
85+
- The Challenge (or) The Problem
86+
- The Solution
87+
- The How / implementation
88+
- Roadmap - short-term / long-term
89+
- Note: A call to action (CTA) will be included automatically at the bottom of every post.
8790

8891
Ideal Word Count: Between 1,000 and 2,500 words, with links to relevant documents/pages for a deeper understanding.
8992

@@ -93,28 +96,29 @@ Discuss Ideas: Before starting, share your blog post ideas with the tech team to
9396

9497
Copy the Template: Begin your draft using [this Google Doc template](https://docs.google.com/document/d/1L7vzsYORg9xmf72ljTdmyekpq2vJ7eQZ9atM2uAXgUM/edit?usp=sharing) to maintain a consistent format.
9598

96-
Review Process##
99+
Review Process##
97100

98101
Initial Reviews:
99102

100-
* Once your draft is ready, request specific reviewers or ask for feedback on the #tech-team Slack channel.
101-
* Incorporate feedback and refine the blog post.
103+
- Once your draft is ready, request specific reviewers or ask for feedback on the #tech-team Slack channel.
104+
- Incorporate feedback and refine the blog post.
102105

103106
Finalizing:
104107

105-
* When the draft is stable, create a pull request in the [interledger.org-developers](https://github.com/interledger/interledger.org-developers) GitHub repo.
106-
* Please add links where appropriate so people can easily click to learn more about the concepts you reference.
107-
* Include all images used in the post in the PR.
108-
* No-one is expected to know the ins and outs of Astro (the framework that powers our site), so please tag Sarah as a reviewer to ensure everything Astro-related is in order.
108+
- When the draft is stable, create a pull request in the [interledger.org-developers](https://github.com/interledger/interledger.org-developers) GitHub repo.
109+
- Please add links where appropriate so people can easily click to learn more about the concepts you reference.
110+
- Include all images used in the post in the PR.
111+
- No-one is expected to know the ins and outs of Astro (the framework that powers our site), so please tag Sarah as a reviewer to ensure everything Astro-related is in order.
109112

110-
### Working with Visuals
113+
### Working with Visuals
111114

112-
* If you need an illustration, submit a design request in advance to Madalina via the #design Slack channel using the design request form.
113-
* Before uploading images to GitHub, run them through an image optimizer such as [TinyPNG](https://tinypng.com/).
114-
* Ensure images are appropriately sized; feel free to ask Madalina or Sarah for assistance.
115+
- If you need an illustration, submit a design request in advance to Madalina via the #design Slack channel using the design request form.
116+
- Before uploading images to GitHub, run them through an image optimizer such as [TinyPNG](https://tinypng.com/).
117+
- Ensure images are appropriately sized; feel free to ask Madalina or Sarah for assistance.
115118

116119
### Publishing Your Blog Post
117120

118-
* Remember: merging the pull request will publish the blog post immediately.
119-
* Ensure the publishing date in the blog post metadata matches the intended release date.
120-
* Check with Ioana to confirm the publishing date and keep a consistent posting schedule. Ioana will also handle social media promotion.
121+
- Remember: merging the pull request will publish the blog post immediately.
122+
- Ensure the publishing date in the blog post metadata matches the intended release date.
123+
- Check with Ioana to confirm the publishing date and keep a consistent posting schedule. Ioana will also handle social media promotion.
124+
- Run `bun run format` and `bun run lint` to format your code and check for issues before creating a pull request.

astro.config.mjs

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,130 +17,136 @@ export default defineConfig({
1717
"./node_modules/@interledger/docs-design-system/src/styles/teal-theme.css",
1818
"./node_modules/@interledger/docs-design-system/src/styles/ilf-docs.css",
1919
"./src/styles/interledger.css",
20-
"./src/styles/atom-one-light.min.css",
20+
"./src/styles/atom-one-light.min.css"
2121
],
2222
plugins: [
2323
starlightLinksValidator({
24-
exclude: ["/participation-guidelines"],
24+
exclude: ["/participation-guidelines"]
2525
}),
26-
starlightFullViewMode({ leftSidebarEnabled: false }),
26+
starlightFullViewMode({ leftSidebarEnabled: false })
2727
],
2828
head: [
2929
{
3030
tag: "script",
3131
attrs: {
3232
src: "/developers/scripts/highlight.min.js",
33-
defer: true,
34-
},
33+
defer: true
34+
}
3535
},
3636
{
3737
tag: "script",
3838
attrs: {
3939
src: "/developers/scripts/init.js",
40-
defer: true,
41-
},
40+
defer: true
41+
}
4242
},
4343
{
4444
tag: "script",
4545
attrs: {
4646
defer: true,
4747
"data-website-id": "50d81dd1-bd02-4f82-8a55-34a09ccbbbd9",
4848
src: "https://ilf-site-analytics.netlify.app/script.js",
49-
"data-domains": "interledger.org",
50-
},
51-
},
49+
"data-domains": "interledger.org"
50+
}
51+
}
5252
],
5353
components: {
5454
Header: "./src/components/Header.astro",
55-
PageSidebar: "./src/components/PageSidebar.astro",
55+
PageSidebar: "./src/components/PageSidebar.astro"
5656
},
57-
social: [{ icon: "github", label: "GitHub", href: "https://github.com/interledger" }],
57+
social: [
58+
{
59+
icon: "github",
60+
label: "GitHub",
61+
href: "https://github.com/interledger"
62+
}
63+
],
5864
sidebar: [
5965
{
6066
label: "Overview",
61-
link: "/get-started",
67+
link: "/get-started"
6268
},
6369
{
6470
label: "Get involved",
65-
link: "/get-involved",
71+
link: "/get-involved"
6672
},
6773
{
6874
label: "Specifications",
6975
items: [
7076
{
7177
label: "Interledger Protocol V4 (ILPv4)",
72-
link: "/rfcs/interledger-protocol",
78+
link: "/rfcs/interledger-protocol"
7379
},
7480
{
7581
label: "Interledger Architecture",
76-
link: "/rfcs/interledger-architecture",
82+
link: "/rfcs/interledger-architecture"
7783
},
7884
{
7985
label: "Interledger Addresses",
80-
link: "/rfcs/ilp-addresses",
86+
link: "/rfcs/ilp-addresses"
8187
},
8288
{
8389
label: "STREAM Protocol",
84-
link: "/rfcs/stream-protocol",
90+
link: "/rfcs/stream-protocol"
8591
},
8692
{
8793
label: "Simple Payment Setup Protocol (SPSP)",
88-
link: "/rfcs/simple-payment-setup-protocol",
94+
link: "/rfcs/simple-payment-setup-protocol"
8995
},
9096
{
9197
label: "Peering, Clearing and Settling",
92-
link: "/rfcs/peering-clearing-settling",
98+
link: "/rfcs/peering-clearing-settling"
9399
},
94100
{
95101
label: "Settlement Engines",
96-
link: "/rfcs/settlement-engines",
102+
link: "/rfcs/settlement-engines"
97103
},
98104
{
99105
label: "ILP Over HTTP",
100-
link: "/rfcs/ilp-over-http",
106+
link: "/rfcs/ilp-over-http"
101107
},
102108
{
103109
label: "Bilateral Transfer Protocol",
104-
link: "/rfcs/bilateral-transfer-protocol",
110+
link: "/rfcs/bilateral-transfer-protocol"
105111
},
106112
{
107113
label: "STREAM Receipts",
108-
link: "/rfcs/stream-receipts",
114+
link: "/rfcs/stream-receipts"
109115
},
110116
{
111117
label: "Hashed-Timelock Agreements",
112-
link: "/rfcs/hashed-timelock-agreements",
118+
link: "/rfcs/hashed-timelock-agreements"
113119
},
114120
{
115121
label: "Payment Pointers",
116122
link: "https://paymentpointers.org",
117123
attrs: {
118124
target: "_blank",
119125
rel: "noopener noreferrer",
120-
"data-icon": "external",
121-
},
122-
},
123-
],
124-
},
126+
"data-icon": "external"
127+
}
128+
}
129+
]
130+
}
125131
],
126132
expressiveCode: {
127133
themes: ["github-dark-dimmed"],
128134
styleOverrides: {
129135
borderColor: "transparent",
130-
borderRadius: "var(--border-radius)",
136+
borderRadius: "var(--border-radius)"
131137
},
132138
defaultProps: {
133-
wrap: true,
134-
},
135-
},
139+
wrap: true
140+
}
141+
}
136142
}),
137-
mdx(),
143+
mdx()
138144
],
139145
redirects: {
140-
'/hacktoberfest': 'https://interledger.org/hacktoberfest',
141-
'/hacktoberfest-2023': 'https://interledger.org/hacktoberfest',
146+
"/hacktoberfest": "https://interledger.org/hacktoberfest",
147+
"/hacktoberfest-2023": "https://interledger.org/hacktoberfest"
142148
},
143149
server: {
144-
port: 1103,
145-
},
150+
port: 1103
151+
}
146152
});

eslint.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import { defineConfig, globalIgnores } from "eslint/config";
5+
import eslintConfigPrettier from "eslint-config-prettier/flat";
6+
import eslintPluginAstro from "eslint-plugin-astro";
7+
8+
export default defineConfig([
9+
{
10+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
11+
plugins: { js },
12+
extends: ["js/recommended"],
13+
languageOptions: { globals: { ...globals.browser, ...globals.node } }
14+
},
15+
tseslint.configs.recommended,
16+
eslintPluginAstro.configs.recommended,
17+
globalIgnores(["dist", ".astro", "node_modules", "public", "**/*.min.js"]),
18+
{
19+
rules: {
20+
"no-console": "error",
21+
"@typescript-eslint/no-unused-vars": [
22+
"error",
23+
{ argsIgnorePattern: "^_" }
24+
],
25+
"@typescript-eslint/no-explicit-any": "error",
26+
"astro/no-set-text-directive": "error"
27+
}
28+
},
29+
eslintConfigPrettier
30+
]);

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"start": "astro dev",
77
"build": "astro build",
88
"preview": "astro preview",
9-
"astro": "astro"
9+
"astro": "astro",
10+
"format": "prettier --write .",
11+
"format:check": "prettier --check .",
12+
"lint": "eslint"
1013
},
1114
"dependencies": {
1215
"@astrojs/mdx": "^4.3.0",
@@ -22,5 +25,17 @@
2225
"showdown": "^2.1.0",
2326
"starlight-fullview-mode": "^0.2.3",
2427
"starlight-links-validator": "^0.17.0"
28+
},
29+
"devDependencies": {
30+
"@eslint/js": "^9.32.0",
31+
"@typescript-eslint/parser": "^8.39.0",
32+
"astro-eslint-parser": "^1.2.2",
33+
"eslint": "^9.32.0",
34+
"eslint-config-prettier": "^10.1.8",
35+
"eslint-plugin-astro": "^1.3.1",
36+
"globals": "^16.3.0",
37+
"prettier": "3.6.2",
38+
"prettier-plugin-astro": "0.14.1",
39+
"typescript-eslint": "^8.39.0"
2540
}
2641
}

src/components/Header.astro

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ import DevelopersLogo from "./logos/DevelopersLogo.astro";
1010
<DevelopersLogo />
1111
</a>
1212
<a href="/" class="home-link overflower">
13-
<span
14-
class="overflower-short"
15-
aria-hidden="true"
16-
title="Interledger Foundation"
17-
>
18-
ILF
19-
</span>
20-
<span class="overflower-long">
21-
Interledger Foundation
22-
</span>
13+
<span
14+
class="overflower-short"
15+
aria-hidden="true"
16+
title="Interledger Foundation"
17+
>
18+
ILF
19+
</span>
20+
<span class="overflower-long"> Interledger Foundation </span>
2321
</a>
2422
<Search />
2523
<div class="sl-hidden md:sl-flex secondary-wrap">
26-
2724
<SocialIcons />
2825
<ThemeSelect />
2926
</div>
@@ -37,7 +34,7 @@ import DevelopersLogo from "./logos/DevelopersLogo.astro";
3734
box-shadow: 0px 0px 12px -4px var(--color-primary);
3835
}
3936

40-
.header {
37+
.header {
4138
gap: var(--sl-nav-gap);
4239
align-items: center;
4340
height: 100%;

0 commit comments

Comments
 (0)