@putout/plugin-putout-config 11.7.0 → 11.8.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 +29 -0
- package/lib/apply-variables/index.js +19 -0
- package/lib/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ npm i @putout/plugin-putout-config -D
|
|
|
29
29
|
- ✅ [apply-promises](#apply-promises);
|
|
30
30
|
- ✅ [apply-tape](#apply-tape);
|
|
31
31
|
- ✅ [apply-types](#apply-types);
|
|
32
|
+
- ✅ [apply-variables](#apply-variables);
|
|
32
33
|
- ✅ [convert-boolean-to-string](#convert-boolean-to-string);
|
|
33
34
|
- ✅ [move-formatter-up](#move-formatter-up);
|
|
34
35
|
- ✅ [remove-empty](#remove-empty);
|
|
@@ -57,6 +58,7 @@ npm i @putout/plugin-putout-config -D
|
|
|
57
58
|
"putout-config/apply-spread": "on",
|
|
58
59
|
"putout-config/apply-tape": "on",
|
|
59
60
|
"putout-config/apply-types": "on",
|
|
61
|
+
"putout-config/apply-variables": "on",
|
|
60
62
|
"putout-config/convert-boolean-to-string": "on",
|
|
61
63
|
"putout-config/move-formatter-up": "on",
|
|
62
64
|
"putout-config/remove-empty": "on",
|
|
@@ -267,6 +269,33 @@ Apply [`spread`](https://github.com/coderaiser/putout/tree/master/packages/plugi
|
|
|
267
269
|
}
|
|
268
270
|
```
|
|
269
271
|
|
|
272
|
+
## apply-variables
|
|
273
|
+
|
|
274
|
+
Apply [`variables`](https://github.com/coderaiser/putout/tree/master/packages/plugin-variables#readme) according to:
|
|
275
|
+
|
|
276
|
+
- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):
|
|
277
|
+
|
|
278
|
+
```diff
|
|
279
|
+
{
|
|
280
|
+
"rules": {
|
|
281
|
+
- "remove-useless-variables": "off",
|
|
282
|
+
- "remove-useless-variables/remove": "on",
|
|
283
|
+
- "remove-useless-variables/assignment": "on",
|
|
284
|
+
- "remove-useless-arguments/declaration": "on",
|
|
285
|
+
- "remove-useless-arguments/duplicate": "on",
|
|
286
|
+
- "remove-useless-arguments/rename": "on",
|
|
287
|
+
- "remove-unreferenced-variables": "on"
|
|
288
|
+
+ "variables": "off",
|
|
289
|
+
+ "variables/remove-useless": "on",
|
|
290
|
+
+ "variables/remove-useless-assignment": "on",
|
|
291
|
+
+ "variables/remove-useless-declarations": "on",
|
|
292
|
+
+ "variables/remove-useless-duplicates": "on",
|
|
293
|
+
+ "variables/remove-useless-rename": "on",
|
|
294
|
+
+ "variables/remove-unreferenced": "on"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
270
299
|
## apply-conditions
|
|
271
300
|
|
|
272
301
|
Apply [`conditions`](https://github.com/coderaiser/putout/tree/master/packages/plugin-conditions#readme) according to:
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {createRenameProperty} from '../rename-property.js';
|
|
2
|
+
|
|
3
|
+
const v41 = [
|
|
4
|
+
['remove-useless-variables', 'variables'],
|
|
5
|
+
['remove-useless-variables/remove', 'variables/remove-useless'],
|
|
6
|
+
['remove-useless-variables/assignment', 'variables/remove-useless-assignment'],
|
|
7
|
+
['remove-useless-variables/rename', 'variables/rename-useless-rename'],
|
|
8
|
+
['remove-useless-variables/duplicate', 'variables/remove-useless-duplicate'],
|
|
9
|
+
['remove-useless-variables/declaration', 'variables/remove-useless-declarations'],
|
|
10
|
+
['remove-unreferenced-variables', 'variables/remove-unreferenced'],
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const versions = [...v41];
|
|
14
|
+
|
|
15
|
+
export const {
|
|
16
|
+
report,
|
|
17
|
+
fix,
|
|
18
|
+
traverse,
|
|
19
|
+
} = createRenameProperty(versions);
|
package/lib/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import * as applyPromises from './apply-promises/index.js';
|
|
|
14
14
|
import * as applySpread from './apply-spread/index.js';
|
|
15
15
|
import * as applyTape from './apply-tape/index.js';
|
|
16
16
|
import * as applyTypes from './apply-types/index.js';
|
|
17
|
+
import * as applyVariables from './apply-variables/index.js';
|
|
17
18
|
import * as convertBooleanToString from './convert-boolean-to-string/index.js';
|
|
18
19
|
import * as renameRules from './rename-rules/index.js';
|
|
19
20
|
import * as removeEmpty from './remove-empty/index.js';
|
|
@@ -37,6 +38,7 @@ export const rules = {
|
|
|
37
38
|
'apply-spread': applySpread,
|
|
38
39
|
'apply-tape': applyTape,
|
|
39
40
|
'apply-types': applyTypes,
|
|
41
|
+
'apply-variables': applyVariables,
|
|
40
42
|
'convert-boolean-to-string': convertBooleanToString,
|
|
41
43
|
'move-formatter-up': MoveFormatterUp,
|
|
42
44
|
'rename-rules': renameRules,
|
package/package.json
CHANGED