🐊Putout adds support of transformations for @putout/printer
.
npm i @putout/plugin-printer -D
- ✅ add-args;
- ✅ apply-breakline;
- ✅ apply-computed-print;
- ✅ apply-linebreak;
- ✅ apply-types;
- ✅ declare;
- ✅ remove-args;
{
"rules": {
"printer/add-args": "on",
"printer/apply-breakline": "on",
"printer/apply-linebreak": "on",
"printer/apply-computed-print": "on",
"printer/apply-types": "on",
"printer/declare": "on",
"printer/remove-args": "on"
}
}
-print.newline();
-indent();
print.breakline();
-indent();
-print.newline();
print.linebreak();
Checkout in 🐊Putout Editor.
-const {isIdentifier} = require('@babel/types');
+const {types} = require('@babel/types');
+const {isIdentifier} = types;
module.exports = {
TSPropertySignature(path) {
const {optional} = path.node;
print('__key');
maybe.print(optional, '?');
},
};
module.exports = {
TSPropertySignature(path, {print, maybe}) {
const {optional} = path.node;
print('__key');
maybe.print(optional, '?');
},
};
print(path.get('block'));
print('__block');
print.indent(is);
print.indent();
isIdentifier();
const {types} = require('@putout/babel');
const {isIdentifier} = types;
isIdentifier();
MIT