0.0.1 • Published 3 years ago

hardhat-prettier v0.0.1

Weekly downloads
22
License
MIT
Repository
github
Last release
3 years ago

hardhat-prettier

Use Prettier Solidity to format your code.

What

This plugin lets you automatically format your code using Prettier Solidity and check that it's correctly formatted.

Installation

<A step-by-step guide on how to install the plugin>

npm install hardhat-prettier prettier prettier-plugin-solidity

Import the plugin in your hardhat.config.js:

require("hardhat-prettier");

Or if you are using TypeScript, in your hardhat.config.ts:

import "hardhat-prettier";

Tasks

This plugin adds the format task, that will format and overwrite your Solidity code.

It also overrides the check task, to add checking your code's format as part of the check pipeline.

Configuration

This plugin will use prettier's defaults, but you can configure it by creating a .prettierrc file:

{
  "plugins": ["prettier-plugin-solidity"],
  "singleQuote": true
}