@putout/plugin-putout-config 11.1.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -3
- package/lib/apply-arguments/index.js +16 -0
- package/lib/apply-spread/index.js +18 -0
- package/lib/index.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,13 +13,15 @@ npm i @putout/plugin-putout-config -D
|
|
|
13
13
|
|
|
14
14
|
## Rules
|
|
15
15
|
|
|
16
|
+
- ✅ [apply-arguments](#apply-arguments);
|
|
16
17
|
- ✅ [apply-assignment](#apply-assignment);
|
|
17
18
|
- ✅ [apply-conditions](#apply-conditions);
|
|
18
19
|
- ✅ [apply-destructuring](#apply-destructuring);
|
|
19
20
|
- ✅ [apply-esm](#apply-esm);
|
|
20
|
-
- ✅ [apply-return](#apply-return);
|
|
21
|
-
- ✅ [apply-parens](#apply-parens);
|
|
22
21
|
- ✅ [apply-for-of](#apply-for-of);
|
|
22
|
+
- ✅ [apply-parens](#apply-parens);
|
|
23
|
+
- ✅ [apply-return](#apply-return);
|
|
24
|
+
- ✅ [apply-spread](#apply-spread);
|
|
23
25
|
- ✅ [apply-labels](#apply-labels);
|
|
24
26
|
- ✅ [apply-math](#apply-math);
|
|
25
27
|
- ✅ [apply-nodejs](#apply-nodejs);
|
|
@@ -39,6 +41,7 @@ npm i @putout/plugin-putout-config -D
|
|
|
39
41
|
```json
|
|
40
42
|
{
|
|
41
43
|
"rules": {
|
|
44
|
+
"putout-config/apply-arguments": "on",
|
|
42
45
|
"putout-config/apply-assignment": "on",
|
|
43
46
|
"putout-config/apply-conditions": "on",
|
|
44
47
|
"putout-config/apply-destructuring": "on",
|
|
@@ -49,10 +52,11 @@ npm i @putout/plugin-putout-config -D
|
|
|
49
52
|
"putout-config/apply-nodejs": "on",
|
|
50
53
|
"putout-config/apply-optional-chaining": "on",
|
|
51
54
|
"putout-config/apply-parens": "on",
|
|
55
|
+
"putout-config/apply-promises": "on",
|
|
52
56
|
"putout-config/apply-return": "on",
|
|
57
|
+
"putout-config/apply-spread": "on",
|
|
53
58
|
"putout-config/apply-tape": "on",
|
|
54
59
|
"putout-config/apply-types": "on",
|
|
55
|
-
"putout-config/apply-promises": "on",
|
|
56
60
|
"putout-config/convert-boolean-to-string": "on",
|
|
57
61
|
"putout-config/move-formatter-up": "on",
|
|
58
62
|
"putout-config/remove-empty": "on",
|
|
@@ -146,6 +150,29 @@ Apply [`esm`](https://github.com/coderaiser/putout/tree/master/packages/plugin-e
|
|
|
146
150
|
}
|
|
147
151
|
```
|
|
148
152
|
|
|
153
|
+
## apply-arguments
|
|
154
|
+
|
|
155
|
+
Apply [`arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-arguments#readme) according to:
|
|
156
|
+
|
|
157
|
+
- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):
|
|
158
|
+
|
|
159
|
+
```diff
|
|
160
|
+
{
|
|
161
|
+
"rules": {
|
|
162
|
+
- "convert-arguments-to-rest": "off",
|
|
163
|
+
- "remove-useless-arguments/arguments": "on",
|
|
164
|
+
- "remove-useless-arguments/method": "on",
|
|
165
|
+
- "remove-useless-arguments/unused": "on",
|
|
166
|
+
- "remove-useless-arguments/json-parse": "on"
|
|
167
|
+
+ "arguments/apply-rest": "on",
|
|
168
|
+
+ "arguments/remove-useless": "on",
|
|
169
|
+
+ "arguments/remove-useless-from-method": "on",
|
|
170
|
+
+ "arguments/remove-unused": "on",
|
|
171
|
+
+ "arguments/apply-json-parse": "on"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
149
176
|
## apply-destructuring
|
|
150
177
|
|
|
151
178
|
Apply [`destructuring`](https://github.com/coderaiser/putout/tree/master/packages/plugin-destructuring#readme) according to:
|
|
@@ -211,6 +238,27 @@ Apply [`optional-chaining`](https://github.com/coderaiser/putout/tree/master/pac
|
|
|
211
238
|
}
|
|
212
239
|
```
|
|
213
240
|
|
|
241
|
+
## apply-spread
|
|
242
|
+
|
|
243
|
+
Apply [`spread`](https://github.com/coderaiser/putout/tree/master/packages/plugin-spread#readme) according to:
|
|
244
|
+
|
|
245
|
+
- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):
|
|
246
|
+
|
|
247
|
+
```diff
|
|
248
|
+
{
|
|
249
|
+
"rules": {
|
|
250
|
+
- "remove-useless-spread": "on",
|
|
251
|
+
- "remove-useless-spread/array": "on",
|
|
252
|
+
- "remove-useless-spread/object": "on",
|
|
253
|
+
- "remove-useless-spread/nested": "on"
|
|
254
|
+
+ "spread": "on",
|
|
255
|
+
+ "spread/remove-useless-array": "on",
|
|
256
|
+
+ "spread/remove-useless-object": "on",
|
|
257
|
+
+ "spread/simplify-nested": "on"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
214
262
|
## apply-conditions
|
|
215
263
|
|
|
216
264
|
Apply [`conditions`](https://github.com/coderaiser/putout/tree/master/packages/plugin-conditions#readme) according to:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {createRenameProperty} from '../rename-property.js';
|
|
2
|
+
|
|
3
|
+
const v41 = [
|
|
4
|
+
['remove-useless-arguments/arguments', 'arguments/remove-useless'],
|
|
5
|
+
['remove-useless-arguments/method', 'arguments/remove-useless-from-method'],
|
|
6
|
+
['remove-useless-arguments/unused', 'arguments/remove-unused'],
|
|
7
|
+
['remove-useless-arguments/json-parse', 'apply-json-parse'],
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
const versions = [...v41];
|
|
11
|
+
|
|
12
|
+
export const {
|
|
13
|
+
report,
|
|
14
|
+
fix,
|
|
15
|
+
traverse,
|
|
16
|
+
} = createRenameProperty(versions);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {createRenameProperty} from '../rename-property.js';
|
|
2
|
+
|
|
3
|
+
const v41 = [
|
|
4
|
+
['remove-useless-spread', 'spread'],
|
|
5
|
+
['remove-useless-spread/nested', 'spread/simplify-nested'],
|
|
6
|
+
['remove-useless-spread/array', 'spread/remove-useless-array'],
|
|
7
|
+
['remove-useless-spread/object', 'spread/remove-useless-object'],
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
const versions = [
|
|
11
|
+
...v41,
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export const {
|
|
15
|
+
report,
|
|
16
|
+
fix,
|
|
17
|
+
traverse,
|
|
18
|
+
} = createRenameProperty(versions);
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as applyArguments from './apply-arguments/index.js';
|
|
2
|
+
import * as applyDestructuring from './apply-destructuring/index.js';
|
|
1
3
|
import * as applyAssignment from './apply-assignment/index.js';
|
|
2
4
|
import * as applyConditions from './apply-conditions/index.js';
|
|
3
5
|
import * as applyEsm from './apply-esm/index.js';
|
|
@@ -9,6 +11,7 @@ import * as applyLabels from './apply-labels/index.js';
|
|
|
9
11
|
import * as applyMath from './apply-math/index.js';
|
|
10
12
|
import * as applyNodejs from './apply-nodejs/index.js';
|
|
11
13
|
import * as applyPromises from './apply-promises/index.js';
|
|
14
|
+
import * as applySpread from './apply-spread/index.js';
|
|
12
15
|
import * as applyTape from './apply-tape/index.js';
|
|
13
16
|
import * as applyTypes from './apply-types/index.js';
|
|
14
17
|
import * as convertBooleanToString from './convert-boolean-to-string/index.js';
|
|
@@ -18,6 +21,8 @@ import * as MoveFormatterUp from './move-formatter-up/index.js';
|
|
|
18
21
|
import * as removeEmptyFile from './remove-empty-file/index.js';
|
|
19
22
|
|
|
20
23
|
export const rules = {
|
|
24
|
+
'apply-arguments': applyArguments,
|
|
25
|
+
'apply-destructuring': applyDestructuring,
|
|
21
26
|
'apply-assignment': applyAssignment,
|
|
22
27
|
'apply-conditions': applyConditions,
|
|
23
28
|
'apply-esm': applyEsm,
|
|
@@ -29,6 +34,7 @@ export const rules = {
|
|
|
29
34
|
'apply-parens': applyParens,
|
|
30
35
|
'apply-promises': applyPromises,
|
|
31
36
|
'apply-return': applyReturn,
|
|
37
|
+
'apply-spread': applySpread,
|
|
32
38
|
'apply-tape': applyTape,
|
|
33
39
|
'apply-types': applyTypes,
|
|
34
40
|
'convert-boolean-to-string': convertBooleanToString,
|
package/package.json
CHANGED