@putout/plugin-conditions 4.2.0 → 4.2.1
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
CHANGED
|
@@ -13,6 +13,23 @@ npm i @putout/plugin-conditions -D
|
|
|
13
13
|
|
|
14
14
|
## Rules
|
|
15
15
|
|
|
16
|
+
- ✅ [add-return](#add-return);
|
|
17
|
+
- ✅ [apply-comparison-order](#apply-comparison-order);
|
|
18
|
+
- ✅ [apply-consistent-blocks](#apply-consistent-blocks);
|
|
19
|
+
- ✅ [apply-if](#apply-if);
|
|
20
|
+
- ✅ [convert-comparison-to-boolean](#convert-comparison-to-boolean);
|
|
21
|
+
- ✅ [convert-equal-to-strict-equal](#convert-equal-to-strict-equal);
|
|
22
|
+
- ✅ [evaluate](#evaluate);
|
|
23
|
+
- ✅ [merge-if-statements](#merge-if-statements);
|
|
24
|
+
- ✅ [remove-boolean](#remove-boolean);
|
|
25
|
+
- ✅ [remove-constant](#remove-constant);
|
|
26
|
+
- ✅ [remove-same-values-condition](hremove-same-values-condition);
|
|
27
|
+
- ✅ [remove-useless-else](#remove-ureless-else);
|
|
28
|
+
- ✅ [remove-zero](#remove-zero);
|
|
29
|
+
- ✅ [simplify](#simplify);
|
|
30
|
+
|
|
31
|
+
## Config
|
|
32
|
+
|
|
16
33
|
```json
|
|
17
34
|
{
|
|
18
35
|
"rules": {
|
|
@@ -336,7 +353,7 @@ if (x)
|
|
|
336
353
|
console.log();
|
|
337
354
|
```
|
|
338
355
|
|
|
339
|
-
## remove-same-values-condition
|
|
356
|
+
## remove-same-values-condition
|
|
340
357
|
|
|
341
358
|
Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/e537d4ec636d4a9b849063a8326b70ae/661041b3fbb1e3678bf7f828e4c8bf6ca723f89d).
|
|
342
359
|
|
|
@@ -35,7 +35,7 @@ module.exports.match = () => ({
|
|
|
35
35
|
module.exports.replace = () => ({
|
|
36
36
|
'if (__a) {if (__b) {__c}}': 'if (__a) if (__b) __c',
|
|
37
37
|
'if (__a) {__b}': 'if (__a) __b',
|
|
38
|
-
'if (__a) {__b} else {__c}':
|
|
38
|
+
'if (__a) {__b} else {__c}': 'if (__a) __b; else __c',
|
|
39
39
|
'if (__a) __b; else __body': 'if (__a) {__b} else __body',
|
|
40
40
|
'if (__a) __body; else __b': ({__b}, path) => {
|
|
41
41
|
if (isBlockStatement(__b))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-conditions",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds support of conditions transformations",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@putout/plugin-for-of": "*",
|
|
36
|
-
"@putout/test": "^
|
|
37
|
-
"c8": "^
|
|
38
|
-
"eslint": "^
|
|
39
|
-
"eslint-plugin-n": "^
|
|
40
|
-
"eslint-plugin-putout": "^
|
|
36
|
+
"@putout/test": "^9.0.0",
|
|
37
|
+
"c8": "^9.0.0",
|
|
38
|
+
"eslint": "^9.0.0",
|
|
39
|
+
"eslint-plugin-n": "^17.0.0",
|
|
40
|
+
"eslint-plugin-putout": "^22.0.0",
|
|
41
41
|
"lerna": "^6.0.1",
|
|
42
|
-
"madrun": "^
|
|
42
|
+
"madrun": "^10.0.0",
|
|
43
43
|
"montag": "^1.2.1",
|
|
44
44
|
"nodemon": "^3.0.1"
|
|
45
45
|
},
|