@putout/plugin-montag
Version:
πPutout plugin adds ability apply 'montag'
74 lines (53 loc) β’ 1.14 kB
Markdown
# @putout/plugin-apply-montag [![NPM version][NPMIMGURL]][NPMURL]
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-montag.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-montag"npm"
> Format multiline strings using tagged templates, instead of putting all lines into an array and joining to a string.
>
> (c) [**Montag**](https://github.com/coderaiser/montag)
π[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply [**Montag**](https://github.com/coderaiser/montag).
## Install
```
npm i @putout/plugin-apply-montag
```
## Rule
```json
{
"rules": {
"montag/apply": "on",
"montag/declare": "on"
}
}
```
## apply
### β Example of incorrect code
```js
const a = [
'hello',
'world',
].join('\n');
```
### β
Example of correct code
```js
const a = montag`
hello
world
`;
```
## declare
### β Example of incorrect code
```js
const a = montag`
hello
world
`;
```
### β
Example of correct code
```js
import montag from 'montag';
const a = montag`
hello
world
`;
```
## License
MIT