Prettier plugin for Solidity that leverages solgrid's Rust-based formatter for fast, reliable formatting and linting. Currently at v0.0.14, released weekly with active development. Key differentiators: native Rust performance, integrated linting with autofix (including import ordering, naming conventions, and NatSpec validation), and VS Code save-time stability. Unlike prettier-plugin-solidity, it uses a native parser for better edge-case handling and offers configurable operator line breaks, import grouping, and doc comment rules.
npm install prettier-plugin-solgridVerified import paths — ran on the pinned version, not inferred.
Installs the plugin, configures Prettier for Solidity files, and formats a .sol file.
Upgrade prettier to v3 or later.
Set options at top level of .prettierrc.
Upgrade to v0.0.7 or later.
Use `solidityOperatorLineBreak` instead.
Upgrade to v0.0.12+ to get validation errors.
Run `npm install --save-dev prettier-plugin-solgrid` and ensure it's in the plugins array.
Add `"parser": "solidity"` and `"plugins": ["prettier-plugin-solgrid"]` to .prettierrc.
Upgrade prettier to v3: `npm install prettier@^3.0.0`.