Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
prettier-plugin-rust
Advanced tools
The massively popular Prettier code formatter, now with Rust support!
Prettier Rust doesn't panic on missing semicolons, in fact it AUTO-COMPLETES them!
Thanks to the specially built jinx-rust
parser, Prettier is completely independent from Rust's strict validation process.
As such, it is able to format rust just like it formats typescript!
Configure prettier
by creating a .prettierrc.toml
file, or any other file format listed in prettier docs.
To ignore files, list them in .prettierignore
(like you would .gitignore
)
API Option | CLI Option | Default | Docs |
---|---|---|---|
tabWidth | --tab-width | 4 | link |
printWidth | --print-width | 100 | link |
endOfLine | --end-of-line | "lf" | link |
trailingComma | --trailing-comma | Not supported yet. | |
embeddedLanguageFormatting | --embedded-language-formatting | Not supported yet. |
To ignore something, add // prettier-ignore
above it.
#[rustfmt::skip]
and #![rustfmt::skip]
are also supported (locally).
Either install the standalone extension Prettier - Code formatter (Rust)
or
use the official one which has issues loading plugins and will NOT auto-update them. Read about plugins in Prettier docs.
If you have rust-analyzer
or another extension that formats rust
files installed, VSCode will prompt you to choose your preferred formatter the next time you attempt to format a file. If you already had one defined, you may have to adjust your settings:
"[rust]": {
"editor.defaultFormatter": "jinxdash.prettier-rust"
}
Not available yet
The plugin is published on npm as prettier-plugin-rust
and can be used like any other prettier plugin.
npm install --save-dev prettier-plugin-rust
Refer to the Prettier documentation for available CLI commands.
FAQs
Prettier plugin for Rust
The npm package prettier-plugin-rust receives a total of 512 weekly downloads. As such, prettier-plugin-rust popularity was classified as not popular.
We found that prettier-plugin-rust demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.