Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/enpitsulin/prettier-plugin-tact

Prettier plugin for tact lang
https://github.com/enpitsulin/prettier-plugin-tact

prettier-plugin tact

Last synced: about 2 months ago
JSON representation

Prettier plugin for tact lang

Awesome Lists containing this project

README

        

# prettier-plugin-tact



LOGO

A [prettier plugin](https://prettier.io/docs/en/plugins.html) for automatically formatting your [tact](https://github.com/tact-lang/tact) code.

## Installation

Install both `prettier` and `prettier-plugin-tact`:

```Bash
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](https://prettier.io/docs/en/configuration) to activate the plugin:

```json
{
"plugins": ["prettier-plugin-tact"]
}
```

## Usage

If you installed prettier as a local dependency, you can add prettier as a script in your package.json,

```json
{
"scripts": {
"prettier": "prettier"
}
}
```

Run prettier for your contracts files by command or you can add this to you script if you prefer:

```Bash
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](https://github.com/tact-lang/tree-sitter-tact/issues/12), you should install `tree-sitter-tact` from GitHub repo by:

```sh
npm install -D https://github.com/tact-lang/tree-sitter-tact
```

## License

Distributed under the MIT license. See [LICENSE](LICENSE) for more information.