Skip to content

chore: set up code formatter#332

Merged
rvanasa merged 12 commits into
mainfrom
ryan/format
Oct 7, 2025
Merged

chore: set up code formatter#332
rvanasa merged 12 commits into
mainfrom
ryan/format

Conversation

@rvanasa

@rvanasa rvanasa commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@rvanasa rvanasa requested a review from a team as a code owner October 6, 2025 18:36
@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

Benchmark Results

bench/1-buffer-vector-add.bench.mo $({\color{green}-8.40\%})$

Add (second)

Add items one-by-one (second)

Instructions: ${\color{green}-8.40\%}$
Heap: ${\color{gray}0\%}$
Stable Memory: ${\color{gray}0\%}$
Garbage Collection: ${\color{gray}0\%}$

Instructions

10 10000 1000000
Buffer 9_493 $({\color{green}-30.14\%})$ 5_687_530 $({\color{green}-8.33\%})$ 525_783_824 $({\color{green}-8.25\%})$
Vector 13_461 $({\color{red}+17.91\%})$ 4_378_548 $({\color{green}-10.82\%})$ 417_864_434 $({\color{green}-10.74\%})$

Heap

10 10000 1000000
Buffer 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$
Vector 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$

Garbage Collection

10 10000 1000000
Buffer 1.09 KiB $({\color{gray}0\%})$ 143.28 KiB $({\color{gray}0\%})$ 12.02 MiB $({\color{gray}0\%})$
Vector 1.09 KiB $({\color{gray}0\%})$ 45.65 KiB $({\color{gray}0\%})$ 3.86 MiB $({\color{gray}0\%})$
bench/2-vector-buffer-add.bench.mo $({\color{green}-10.20\%})$

Add

Add items one-by-one

Instructions: ${\color{green}-10.20\%}$
Heap: ${\color{gray}0\%}$
Stable Memory: ${\color{gray}0\%}$
Garbage Collection: ${\color{gray}0\%}$

Instructions

10 10000 1000000
Vector 13_461 $({\color{green}-12.68\%})$ 4_378_902 $({\color{green}-10.82\%})$ 417_886_028 $({\color{green}-10.74\%})$
Buffer 9_493 $({\color{green}-10.35\%})$ 5_686_822 $({\color{green}-8.33\%})$ 525_780_992 $({\color{green}-8.25\%})$

Heap

10 10000 1000000
Vector 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$
Buffer 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$ 272 B $({\color{gray}0\%})$

Garbage Collection

10 10000 1000000
Vector 1.09 KiB $({\color{gray}0\%})$ 45.65 KiB $({\color{gray}0\%})$ 3.86 MiB $({\color{gray}0\%})$
Buffer 1.09 KiB $({\color{gray}0\%})$ 143.28 KiB $({\color{gray}0\%})$ 12.02 MiB $({\color{gray}0\%})$
bench/array.bench.mo $({\color{green}-18.10\%})$

Array

arr arr

Instructions: ${\color{green}-18.10\%}$
Heap: ${\color{gray}0\%}$
Stable Memory: ${\color{gray}0\%}$
Garbage Collection: ${\color{gray}0\%}$

Instructions

100k x1 reset1 100k x3 reset2 100k x4 reset3
Array 13_502_032 $({\color{green}-10.00\%})$ 3_271 $({\color{green}-26.58\%})$ 27_003_206 $({\color{green}-10.00\%})$ 3_745 $({\color{green}-26.18\%})$ 54_004_063 $({\color{green}-10.00\%})$ 4_219 $({\color{green}-25.87\%})$

Heap

100k x1 reset1 100k x3 reset2 100k x4 reset3
Array 390.9 KiB $({\color{gray}0\%})$ -390.37 KiB $({\color{gray}0\%})$ 390.9 KiB $({\color{gray}0\%})$ -390.37 KiB $({\color{gray}0\%})$ 390.9 KiB $({\color{gray}0\%})$ -390.37 KiB $({\color{gray}0\%})$

Garbage Collection

100k x1 reset1 100k x3 reset2 100k x4 reset3
Array 360 B $({\color{gray}0\%})$ 390.97 KiB $({\color{gray}0\%})$ 391 KiB $({\color{gray}0\%})$ 390.97 KiB $({\color{gray}0\%})$ 1.14 MiB $({\color{gray}0\%})$ 390.97 KiB $({\color{gray}0\%})$
bench/removeLast.bench.mo $({\color{green}-10.90\%})$

Remove items using removeLast

Vector and buffer are initialized with 100k items and then 70k items are removed one-by-one.

Instructions: ${\color{green}-10.90\%}$
Heap: ${\color{gray}0\%}$
Stable Memory: ${\color{gray}0\%}$
Garbage Collection: ${\color{gray}0\%}$

Instructions

remove 70k
Vector 27_707_652 $({\color{green}-13.98\%})$
Buffer 29_236_913 $({\color{green}-7.82\%})$

Heap

remove 70k
Vector -136.8 KiB $({\color{gray}0\%})$
Buffer -269.76 KiB $({\color{gray}0\%})$

Garbage Collection

remove 70k
Vector 139.45 KiB $({\color{gray}0\%})$
Buffer 540.43 KiB $({\color{gray}0\%})$
bench/stable-memory.bench.mo $({\color{green}-134.72\%})$

Stable Memory and Region

Grow Region and store blobs in it

Instructions: ${\color{green}-67.65\%}$
Heap: ${\color{green}-6.10\%}$
Stable Memory: ${\color{gray}0\%}$
Garbage Collection: ${\color{green}-60.97\%}$

Instructions

Region (fill 1/100) Region (fill 1/50) StableMemory
10 pages 2_626_949 $({\color{green}-95.97\%})$ 10_496_262 $({\color{green}-95.97\%})$ 2_629 $({\color{green}-8.11\%})$
100 pages 52_466_545 $({\color{green}-95.97\%})$ 104_914_682 $({\color{green}-95.97\%})$ 2_634 $({\color{green}-10.83\%})$
256 pages 134_273_638 $({\color{green}-95.97\%})$ 268_574_495 $({\color{green}-95.97\%})$ 3_182 $({\color{green}-14.09\%})$

Heap

Region (fill 1/100) Region (fill 1/50) StableMemory
10 pages 272 B $({\color{green}-8.11\%})$ 272 B $({\color{gray}0\%})$ 276 B $({\color{gray}0\%})$
100 pages 272 B $({\color{green}-11.69\%})$ 272 B $({\color{green}-11.69\%})$ 272 B $({\color{gray}0\%})$
256 pages 272 B $({\color{green}-11.69\%})$ 272 B $({\color{green}-11.69\%})$ 276 B $({\color{gray}0\%})$

Garbage Collection

Region (fill 1/100) Region (fill 1/50) StableMemory
10 pages 208.34 KiB $({\color{green}-91.44\%})$ 832.38 KiB $({\color{green}-91.45\%})$ 336 B $({\color{gray}0\%})$
100 pages 4.06 MiB $({\color{green}-91.46\%})$ 8.13 MiB $({\color{green}-91.46\%})$ 340 B $({\color{gray}0\%})$
256 pages 10.4 MiB $({\color{green}-91.46\%})$ 20.8 MiB $({\color{green}-91.46\%})$ 340 B $({\color{gray}0\%})$

Stable Memory

Region (fill 1/100) Region (fill 1/50) StableMemory
10 pages 8 MiB $({\color{gray}0\%})$ 8 MiB $({\color{gray}0\%})$ 8 MiB $({\color{gray}0\%})$
100 pages 8 MiB $({\color{gray}0\%})$ 8 MiB $({\color{gray}0\%})$ 0 B $({\color{gray}0\%})$
256 pages 16 MiB $({\color{gray}0\%})$ 16 MiB $({\color{gray}0\%})$ 16 MiB $({\color{gray}0\%})$

@crusso crusso self-requested a review October 7, 2025 14:44
@rvanasa rvanasa merged commit b9a9966 into main Oct 7, 2025
24 checks passed
Kamirus added a commit that referenced this pull request Mar 23, 2026
Packages removed:
- root: @stylistic/eslint-plugin, @stylistic/eslint-plugin-migrate (plugins
  loaded but no rules enabled since formatter PR #332 replaced them with Prettier)
- cli: cacheable-request (transitive via got), @types/glob (glob ships own types)
- frontend: @dfinity/auth-client, events, svelte-simple-modal (none imported)
- frontend: move @types/throttle-debounce from dependencies → devDependencies
- cli-releases/frontend: hast-util-to-html (import was commented out)

All lockfiles (package-lock.json, bun.lock) regenerated. Lint and type checks pass.

Made-with: Cursor
Kamirus added a commit that referenced this pull request Mar 23, 2026
## What changed

Removes npm packages that were no longer doing anything, across all
sub-packages.

| Package | Location | Reason |
|---------|----------|--------|
| `@stylistic/eslint-plugin` | root | Plugins were listed in
`.eslintrc.json` but **no `@stylistic/*` rules were enabled** since PR
#332 replaced them with Prettier. Orphaned for ~1 year. |
| `@stylistic/eslint-plugin-migrate` | root | Same as above. |
| `cacheable-request` | `cli` | No direct import; already pulled in as a
transitive dep of `got`. |
| `@types/glob` | `cli` | `glob` v10+ ships its own bundled types. |
| `@dfinity/auth-client` | `frontend` | No import anywhere in the
frontend. |
| `events` | `frontend` | No import; grep hits were CSS
`pointer-events`. |
| `svelte-simple-modal` | `frontend` | No import; modals use a local
`Modal.svelte` component. |
| `@types/throttle-debounce` | `frontend` | Moved from `dependencies` →
`devDependencies` (type packages belong in dev deps for a bundled app).
|
| `hast-util-to-html` | `cli-releases/frontend` | The only reference was
a commented-out import on `main`. Dead comment also removed. |

Also aligns `.eslintrc.json` `plugins` array with what is actually
installed.

## Lockfile note

Running `bun install` to regenerate `cli/bun.lock` also caught up a
stale lockfile on `main` — several packages that were already updated in
`cli/package.json` (`glob`, `jsdom`, `minimatch`,
`prettier-plugin-motoko`, `tar`) were not reflected at the right
resolved version in the old lockfile. Those are now correct.

## How to test

```sh
npm run lint        # 0 errors
npm run check       # cli tsc + svelte-check pass
cd cli && npm test  # existing test suite
```

## Notes

- `prettier-eslint` was intentionally **kept** — the recommended VS Code
extension (`rvest.vs-code-prettier-eslint`) resolves it from the
workspace.
- All lockfiles (`package-lock.json` ×5, `bun.lock`) were regenerated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants