3.1.0 β€’ Published 7 months ago

@putout/plugin-printer v3.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@putout/plugin-printer NPM version

🐊Putout adds support of transformations for @putout/printer.

Install

npm i @putout/plugin-printer -D

Rules

{
    "rules": {
        "printer/add-args": "on",
        "printer/apply-breakline": "on",
        "printer/apply-linebreak": "on",
        "printer/apply-computed-print": "on",
        "printer/remove-args": "on"
    }
}

apply-breakline

-print.newline();
-indent();
print.breakline();

apply-linebreak;

-indent();
-print.newline();
print.linebreak();

add-args

❌ Example of incorrect code

module.exports = {
    TSPropertySignature(path) {
        const {optional} = path.node;
        print('__key');
        maybe.print(optional, '?');
    },
};

βœ… Example of correct code

module.exports = {
    TSPropertySignature(path, {print, maybe}) {
        const {optional} = path.node;
        print('__key');
        maybe.print(optional, '?');
    },
};

apply-computed-print

❌ Example of incorrect code

print(path.get('block'));

βœ… Example of correct code

print('__block');

remove-args

❌ Example of incorrect code

print.indent(is);

βœ… Example of correct code

print.indent();

License

MIT

3.1.0

7 months ago

3.0.0

7 months ago

2.1.0

8 months ago

2.0.0

8 months ago

1.2.0

1 year ago

1.6.0

11 months ago

1.5.1

11 months ago

1.5.0

11 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago