Format multiline strings using tagged templates, instead of putting all lines into an array and joining to a string.
(c) Montag
🐊Putout plugin adds ability to apply Montag.
npm i @putout/plugin-apply-montag
{
"rules": {
"montag/add-newline-before-text": "on",
"montag/apply": "on",
"montag/declare": "on",
"montag/convert-default-to-named": "on",
"montag/remove-useless-space": "on"
}
}Checkout in 🐊Putout Editor.
montag`hello`;const a = montag`
hello
`;const a = [
'hello',
'world',
].join('\n');const a = montag`
hello
world
`;const a = montag`
hello
world
`;import montag from 'montag';
const a = montag`
hello
world
`;Checkout in 🐊Putout Editor.
import montag from 'montag';import {montag} from 'montag';Checkout in 🐊Putout Editor.
const a = montag`.
hello
`;const a = montag`
hello
`;MIT