Skip to content

Commit 9a3d026

Browse files
committed
Add migration guide and notice about new version
1 parent 8d7a7a1 commit 9a3d026

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
<img width="375" height="375" src="https://user-images.githubusercontent.com/1022054/59317198-f1149b80-8d15-11e9-9b0f-0c5e7d4b8b81.png">
99
</p>
1010

11+
> ℹ️ This README is for the new major version of Prettier Plugin Solidity.
12+
>
13+
> The differences from v1 are minimal, but there are some breaking changes.
14+
>
15+
> To migrate from v1, follow the [migration guide](#migrating-from-v1).
16+
>
17+
> If you're looking for the previous version, check out the [v1 branch](https://github.com/prettier-solidity/prettier-plugin-solidity/tree/v1).
18+
1119
A [Prettier](https://prettier.io/) plugin for automatically formatting your [Solidity](https://docs.soliditylang.org/en/latest/) code.
1220

1321
## Installation and usage
@@ -380,6 +388,26 @@ contract Foo is Bar {
380388

381389
Notice that the unnecessary parentheses in `modifier2` were removed in the function but not in the constructor.
382390

391+
## Migrating from v1
392+
393+
In most cases, upgrading to v2 of Prettier Solidity should be as easy as installing the latest version:
394+
395+
```bash
396+
npm install prettier-plugin-solidity@latest
397+
```
398+
399+
If you had the parser explicitly set in your config, you'll get this error:
400+
401+
```
402+
[error] Couldn't resolve parser "solidity-parse".
403+
```
404+
405+
To fix it, simply update the `parser` option in your `.prettierrc`:
406+
407+
```
408+
"parser": "slang",
409+
```
410+
383411
## Contributing
384412

385413
1. [Fork it](https://github.com/prettier-solidity/prettier-plugin-solidity/fork)

0 commit comments

Comments
 (0)