prettier-plugin-julia weekly downloads statistics
By pankgeorg · npm · Prettier plugins
Prettier plugin for Julia, using Julia's own parser (JuliaSyntax) compiled to WebAssembly; every format is checked to keep the program's meaning
prettier-plugin-julia has 26 recorded weekly downloads on npm, a change of -10.3% over the past 7 days, ranking #2943 of 3,247 tracked listings.
About prettier-plugin-julia
prettier-plugin-julia
A Prettier 3 plugin that formats Julia code. It parses with Julia's own parser, JuliaSyntax as shipped with Julia 1.13, compiled to WebAssembly: no Julia installation needed, and the plugin reads code exactly as Julia does.
Every format is checked. The output is parsed again and compared with the input. Code whose formatting would change what the program means is kept exactly as written, and reported. The plugin never writes a program that parses differently from yours.
<!-- prettier-ignore --># before
function f(x::Int,y=2;k=3) where T
z = x+y # trailing
if z>3 return z end
[i^2 for i = 1:n if isodd(i)]
end
# after
function f(x::Int, y=2; k=3) where T
z = x + y # trailing
if z > 3
return z
end
[i^2 for i in 1:n if isodd(i)]
end
Install
Node ^22.23.3 or ^24.22.1, and Prettier 3.
npm install --save-dev prettier prettier-plugin-julia
Usage
.prettierrc:
{ "plugins": ["prettier-plugin-julia"] }
npx prettier --write "**/*.jl" # format
npx prettier --check "**/*.jl" # exit code 1 if a file would change (for CI)
Markdown files get their ```julia blocks formatted too (npx prettier --write "**/*.md").
docs/usage.md has the rest:
- a Julia project without Node (a three-file setup);
- a copy-paste GitHub Actions workflow that fails with a diff;
- lint-staged, pre-commit and VS Code settings;
- the Prettier API.
Style
4-space indent, 92 columns, close to Runic and JuliaFormatter:
- spaces around binary operators except
:,^and::; f(x; k=1): keyword arguments and defaults without spaces;- a list that doesn't fit goes one element per line, with a trailing comma;
modulebodies are not indented;- at most one blank line in a row;
for i = …is writtenfor i in ….
Strings, string macros, comments and multi-line matrices are kept as written. Details: docs/style.md.
| Option | Default | Meaning |
|---|---|---|
printWidth | 92 | Line width. |
tabWidth | 4 | Spaces per indentation level (useTabs for tabs). |
juliaVerify | true | Check every format and keep code as written where it would change meaning. |
juliaReport | true | Warn on stderr for each region kept as written. |
To leave code alone: # prettier-ignore before a statement, #! format: off …
#! format: on around a region, or .prettierignore for whole files.
Safety
After printing, the plugin parses the output with JuliaSyntax and compares both trees in a strict normal form:
- whitespace and comments are ignored; leaf text must match exactly;
- node kinds and flags must match: infix vs prefix call,
@m(x)vs@m x,mutable, triple-quoted strings; - comments must all survive, in order.
The only freedoms are layout ones: a; b on one line vs two, a trailing comma in a
multi-line list (not in a one-element tuple, where it changes the meaning).
If the trees differ, the smallest differing node is printed exactly as written and the file is printed again (up to 30 rounds; after that, the whole file is left as it is). Each such region is reported:
[prettier-plugin-julia] warn: src/a.jl:12:5: kept `[x -y]` as written (formatting would change its meaning: …)
Input that JuliaSyntax rejects is reported as a syntax error, with its position, and left alone. A printer crash also leaves the file as it is.
What "same meaning" does not cover, as for any formatter that moves code between lines:
- source locations:
@__LINE__, stack traces, and macros that read__source__see new line numbers; - statement grouping by
;at top level:a; bon one line is a singletoplevelexpression, two lines are two. Only code that loads files withinclude(mapexpr, …)/include_string(mapexpr, …)can tell the difference.
The printer is written so that the check rarely fires:
- it only breaks lines where Julia reads a line break as whitespace or continuation, never inside a matrix row or between macro arguments;
- it keeps
- 2,[x -y],"""doc""" fand the like as written; - it prints anything it has no rule for token by token.
On the corpus below no region needed protecting; the tests inject printer bugs to show that they are caught.
Results and comparison
Corpus: 25,174 unique Julia files (229 MB) from Julia 1.11/1.13 base, stdlib and tests, and the packages of several Julia depots, deduplicated by content. Arm64 Linux, Node 22.
| Formatted and verified | 25,163 (3,267 already formatted) |
| Rejected by JuliaSyntax (not valid Julia 1.13) | 11 |
| Regions kept as written / whole files kept / crashes | 0 / 0 / 0 |
| Not idempotent (formatting twice ≠ once) | 0 |
Description from the npm listing.
- prettier
- prettier-plugin
- julia
- julialang
- formatter
- code-formatter
- juliasyntax
- webassembly
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (128)Similar npm Prettier plugins plugins
All 20 prettier-plugin-julia alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-julia. First seen Nov 24, 2026; last successful collection Dec 6, 2026. See the methodology.