OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Prettier Plugin Solidity

Prettier Plugin Solidity is an open-source Prettier plugin that automatically formats Solidity source code. Its README describes Node.js package use, configuration for Solidity files, formatting checks, and a standalone browser integration.

Independent OpenViST project profile, based on linked sources.

Prettier Plugin Solidity — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when Solidity files need consistent Prettier formatting in a project workflow or a documented standalone browser integration.

Who it is for

  • Developers maintaining Solidity contracts in a Prettier-based project.
  • Teams adding a Solidity formatting check to a lint workflow.
  • Developers building a browser integration that loads Prettier’s standalone bundle and the Solidity plugin.

Documented uses

  • Format Solidity contract files from a Node.js project.
  • List Solidity files that differ from the configured formatting.
  • Configure Solidity-specific Prettier options alongside rules for other file types.
  • Call Prettier formatting in a browser integration using the plugin.
Before you choose

Requirements & limits

  • Node.js use requires both Prettier and prettier-plugin-solidity.
  • The README recommends explicitly adding the plugin to configuration because Prettier 3 removed plugin search.
  • The plugin only formats valid Solidity code; syntax errors result in a parser error.
  • The compiler option can influence formatting where Solidity compiler versions change syntax handling, including multiline imports around version 0.7.4.
  • The documented browser route loads Prettier’s standalone bundle before the plugin.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Format Solidity files in a Node.js project

Install the Prettier plugin and run it to format Solidity contract files.

Before you start

  • A Node.js project
  • Solidity contract files
  • Prettier and prettier-plugin-solidity installed as development dependencies

Steps

  1. Install the packages with the command below.

    Documented command
    npm install --save-dev prettier prettier-plugin-solidity
  2. Run the command below to format the matching contract files.

    Documented command
    npx prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'

Expected outcome

Prettier writes formatted output for the Solidity files matched by the supplied glob.

Guide limitations

  • The plugin formats valid Solidity code; syntax errors produce a parser error.
  • The documented command targets the contracts directory pattern shown in the README.
Source-based practical guide

Check Solidity formatting in a project lint command

Use Prettier to list Solidity files that differ from the configured formatting.

Before you start

  • A Node.js project
  • Prettier and prettier-plugin-solidity installed as development dependencies
  • Solidity contract files

Steps

  1. Add a lint script using prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'.

  2. Run the lint script as part of the project’s linting workflow.

Expected outcome

Prettier lists files that differ from the formatter’s output.

Guide limitations

  • The documented workflow checks formatting differences; it does not describe Solidity compilation or code auditing.
  • The plugin requires valid Solidity code and throws a parser error for syntax errors.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
9 October 2026
Original website title
prettier-solidity/prettier-plugin-solidity · Official homepage title · retained in its source language