prettier-plugin-tact
v0.1.7
Published
Prettier plugin for tact-lang
Downloads
46
Readme
prettier-plugin-tact
A prettier plugin for automatically formatting your tact code.
Installation
Install both prettier
and prettier-plugin-tact
:
npm install --save-dev prettier prettier-plugin-tact
// or by pnpm
pnpm add -D prettier prettier-plugin-tact
Activate the plugin
Create or modify your prettier configuration file to activate the plugin:
{
"plugins": ["prettier-plugin-tact"]
}
Usage
If you installed prettier as a local dependency, you can add prettier as a script in your package.json,
{
"scripts": {
"prettier": "prettier"
}
}
Run prettier for your contracts files by command or you can add this to you script if you prefer:
npm run prettier -- path/to/file.tact --write
# or
pnpm prettier path/to/file.tact --write
Prettier only works with valid code. If there is a syntax error, nothing will be done and a parser error will be thrown.
Notice
Before tree-sitter-tact
be publishing to npm registry, you should install tree-sitter-tact
from GitHub repo by:
npm install -D https://github.com/tact-lang/tree-sitter-tact
License
Distributed under the MIT license. See LICENSE for more information.