Skip to content

Commit e282860

Browse files
Repo-wide formatting fixes (#2827)
* Repo-wide formatting fixes * prettier fix for new file * address alerts * fix dashboard index file * add prettier to glossary generator
1 parent bff60f7 commit e282860

2,964 files changed

Lines changed: 37100 additions & 36366 deletions

File tree

Some content is hidden

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

.cursor/rules/contributor-workflow.mdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ Keeping rule files current prevents stale guidance from producing incorrect cont
6565

6666
## CI linting
6767

68+
Pull requests run **`npm run format:check`** (Prettier against `.prettierrc` and `.prettierignore`). Run
69+
**`npm run format`** locally to fix style before pushing. Generated Snaps API pages under
70+
`snaps/reference/snaps-api/` are excluded from formatting in git (see `.prettierignore`).
71+
6872
Pull requests are checked by a Vale-based linter
6973
([docs-spelling-check](https://github.com/Consensys/github-actions/tree/main/docs-spelling-check))
7074
that enforces Microsoft style, Consensys terminology, and spelling. Fix any linter warnings before

.cursor/rules/markdown-formatting.mdc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ for full details. The rules below cover the most common conventions.
2525
## Code blocks
2626

2727
- Always specify the language on fenced code blocks (` ```javascript `, ` ```bash `, etc.).
28-
- Use double quotes in JavaScript code samples.
2928
- Indent code with two spaces, not four.
29+
- In JavaScript, TypeScript, JSX, and TSX samples, use single-quoted string literals.
30+
- In JSON samples, keep double-quoted keys and strings (required by JSON syntax).
31+
- In any other language (for example, Swift, Kotlin, Dart, Solidity, Python, shell), follow that
32+
language's normal conventions for string quotes.
33+
- After editing documentation, run `npm run format` so Prettier applies these rules to fenced code
34+
in Markdown/MDX (see `.prettierrc`).
3035
- For npm install commands, use ` ```bash npm2yarn ` fences to produce automatic npm/yarn tabs.
3136
- Write code samples that can be copied, pasted, and run as-is. Do not include shell prompts
3237
(for example, `user@host $`) or trailing comments that break execution.

.cursor/skills/author-page/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ description: <one sentence>
104104

105105
## Next steps
106106

107-
- [<Related content>](<link>)
107+
- [<Related content>](link)
108108
```
109109

110110
**Quickstart** (for `quickstart/` or `get-started/` folders):
@@ -134,7 +134,7 @@ description: <one sentence>
134134

135135
## Next steps
136136

137-
- [<Extend this with a how-to guide>](<link>)
137+
- [<Extend this with a how-to guide>](link)
138138
```
139139

140140
**Reference** (for `reference/` folders):
@@ -192,7 +192,7 @@ description: <one sentence>
192192

193193
## Next steps
194194

195-
- [<More advanced guide>](<link>)
195+
- [<More advanced guide>](link)
196196
```
197197

198198
**Troubleshooting** (for `troubleshooting/` folders):
@@ -233,7 +233,7 @@ Fill in the scaffold with content based on what the user provides. Follow these
233233
Before finishing, check:
234234

235235
- [ ] Frontmatter has `description`; add `sidebar_label` only when the default nav label would be
236-
too long or wordy (see `markdown-formatting.mdc`).
236+
too long or wordy (see `markdown-formatting.mdc`).
237237
- [ ] Opening paragraph answers "what" and "why" in the first 1-2 sentences.
238238
- [ ] Structure matches the content type.
239239
- [ ] Terminology matches `terminology.mdc` and the product rule file.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Fixes #
2424
<!-- If you are an external contributor (outside of the MetaMask organization), complete the following checklist. -->
2525

2626
- [ ] I've read the [contribution guidelines](https://github.com/MetaMask/metamask-docs/blob/main/CONTRIBUTING.md).
27-
- [ ] I've created a new issue (or assigned myself to an existing issue) describing what this PR addresses.
27+
- [ ] I've created a new issue (or assigned myself to an existing issue) describing what this PR addresses.

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "weekly"
7-
day: "sunday"
6+
interval: 'weekly'
7+
day: 'sunday'
88
assignees:
9-
- "protocol-galileo"
9+
- 'protocol-galileo'

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ jobs:
4545
- name: Lint
4646
uses: ConsenSys/github-actions/docs-lint-all@main
4747

48+
prettier:
49+
name: Prettier
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v6
53+
- name: Use Node.js
54+
uses: actions/setup-node@v6
55+
with:
56+
node-version-file: '.nvmrc'
57+
cache: npm
58+
- name: Install dependencies
59+
run: npm ci
60+
- name: Check formatting
61+
run: npm run format:check
62+
4863
spelling:
4964
name: Spelling
5065
runs-on: ubuntu-latest

.github/workflows/crowdin.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Crowdin Action
22

33
on:
44
push:
5-
paths: ["i18n/**"]
5+
paths: ['i18n/**']
66
branches: [main]
77

88
permissions: write-all
@@ -23,9 +23,9 @@ jobs:
2323
localization_branch_name: l10n_crowdin_translations
2424

2525
create_pull_request: true
26-
pull_request_title: "New Crowdin translations"
27-
pull_request_body: "New Crowdin pull request with translations"
28-
pull_request_base_branch_name: "main"
26+
pull_request_title: 'New Crowdin translations'
27+
pull_request_body: 'New Crowdin pull request with translations'
28+
pull_request_base_branch_name: 'main'
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}

.github/workflows/dependency_review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
folder: ["docs"]
15+
folder: ['docs']
1616
permissions:
1717
contents: read
1818
steps:

.github/workflows/nightly.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
---
2-
name: Nightly check
3-
4-
on:
5-
schedule:
6-
- cron: "0 0 * * *"
7-
workflow_dispatch: {}
8-
9-
concurrency:
10-
group: nightly-${{ github.ref }}
11-
cancel-in-progress: true
12-
13-
jobs:
14-
linkCheckMdx:
15-
name: Run link check on .mdx files
16-
runs-on: ubuntu-latest
17-
permissions:
18-
contents: read
19-
steps:
20-
- uses: actions/checkout@v6
21-
- name: LinkCheck mdx files
22-
uses: ConsenSys/github-actions/docs-link-check@main
23-
with:
24-
FILE_EXTENSION: mdx
25-
MODIFIED_FILES_ONLY: no
2+
name: Nightly check
263

27-
linkCheckMd:
28-
needs: linkCheckMdx
29-
name: Run link check on .md files
30-
if: always()
31-
runs-on: ubuntu-latest
32-
permissions:
33-
contents: read
34-
steps:
35-
- uses: actions/checkout@v6
36-
- name: LinkCheck md files
37-
uses: ConsenSys/github-actions/docs-link-check@main
38-
with:
39-
FILE_EXTENSION: md
40-
MODIFIED_FILES_ONLY: no
4+
on:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
workflow_dispatch: {}
8+
9+
concurrency:
10+
group: nightly-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
linkCheckMdx:
15+
name: Run link check on .mdx files
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: LinkCheck mdx files
22+
uses: ConsenSys/github-actions/docs-link-check@main
23+
with:
24+
FILE_EXTENSION: mdx
25+
MODIFIED_FILES_ONLY: no
26+
27+
linkCheckMd:
28+
needs: linkCheckMdx
29+
name: Run link check on .md files
30+
if: always()
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
steps:
35+
- uses: actions/checkout@v6
36+
- name: LinkCheck md files
37+
uses: ConsenSys/github-actions/docs-link-check@main
38+
with:
39+
FILE_EXTENSION: md
40+
MODIFIED_FILES_ONLY: no

.github/workflows/trivy-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- main
88
workflow_dispatch:
99
schedule:
10-
- cron: "0 1 * * *"
10+
- cron: '0 1 * * *'
1111

1212
jobs:
1313
trivy:

0 commit comments

Comments
 (0)