@@ -13,6 +13,16 @@ npm i @putout/plugin-printer -D
1313
1414## Rules
1515
16+ - ✅ [ add-args] ( #add-args ) ;
17+ - ✅ [ apply-breakline] ( #apply-breakline ) ;
18+ - ✅ [ apply-linebreak] ( #apply-linebreak ) ;
19+ - ✅ [ apply-types] ( #apply-types ) ;
20+ - ✅ [ apply-computed-print] ( #apply-computed-print ) ;
21+ - ✅ [ declare] ( #declare ) ;
22+ - ✅ [ remove-args] ( #remove-args ) ;
23+
24+ ## Config
25+
1626``` json
1727{
1828 "rules" : {
@@ -42,6 +52,66 @@ print.breakline();
4252print.linebreak();
4353```
4454
55+ ## apply-types
56+
57+ ``` diff
58+ - const {isIdentifier} = require('@babel/types');
59+ + const {types} = require('@babel/types');
60+ + const {isIdentifier} = types;
61+ ```
62+
63+ ## add-args
64+
65+ ### ❌ Example of incorrect code
66+
67+ ``` js
68+ module .exports = {
69+ TSPropertySignature (path ) {
70+ const {optional } = path .node ;
71+ print (' __key' );
72+ maybe .print (optional, ' ?' );
73+ },
74+ };
75+ ```
76+
77+ ### ✅ Example of correct code
78+
79+ ``` js
80+ module .exports = {
81+ TSPropertySignature (path , {print, maybe}) {
82+ const {optional } = path .node ;
83+ print (' __key' );
84+ maybe .print (optional, ' ?' );
85+ },
86+ };
87+ ```
88+
89+ ## add-args
90+
91+ ### ❌ Example of incorrect code
92+
93+ ``` js
94+ module .exports = {
95+ TSPropertySignature (path ) {
96+ const {optional } = path .node ;
97+ print (' __key' );
98+ maybe .print (optional, ' ?' );
99+ },
100+ };
101+ ```
102+
103+ ### ✅ Example of correct code
104+
105+ ``` js
106+ module .exports = {
107+ TSPropertySignature (path , {print, maybe}) {
108+ const {optional } = path .node ;
109+ print (' __key' );
110+ maybe .print (optional, ' ?' );
111+ },
112+ };
113+ ```
114+
45115## add-args
46116
47117### ❌ Example of incorrect code
0 commit comments