@putout/plugin-putout-config 12.2.1 β 12.3.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 +1 -1
- package/lib/remove-empty/index.js +19 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -679,7 +679,7 @@ Checkout in π[**Putout Editor**](https://putout.cloudcmd.io/#/gist/48ce05b358
|
|
|
679
679
|
Checkout in π[**Putout Editor**](https://putout.vercel.app/#/gist/3d4878a71fe3fe5a2676b2f1380bad2e/071b8db5c4c8e00f73b2d6d3ded040d0d64d2977).
|
|
680
680
|
When `.putout.json` content is:
|
|
681
681
|
|
|
682
|
-
```
|
|
682
|
+
```json
|
|
683
683
|
{}
|
|
684
684
|
```
|
|
685
685
|
|
|
@@ -15,15 +15,12 @@ export const include = () => [
|
|
|
15
15
|
|
|
16
16
|
export const filter = (path) => {
|
|
17
17
|
const {parentPath, node} = path;
|
|
18
|
-
|
|
19
18
|
const {properties, elements} = node;
|
|
20
19
|
|
|
21
20
|
if (!parentPath.isObjectProperty())
|
|
22
21
|
return false;
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!/rules|match|plugins/.test(key))
|
|
23
|
+
if (!isKey(parentPath))
|
|
27
24
|
return false;
|
|
28
25
|
|
|
29
26
|
if (path.isObjectExpression())
|
|
@@ -31,3 +28,21 @@ export const filter = (path) => {
|
|
|
31
28
|
|
|
32
29
|
return !elements.length;
|
|
33
30
|
};
|
|
31
|
+
|
|
32
|
+
function isKey(parentPath) {
|
|
33
|
+
const key = parentPath.get('key').node.value;
|
|
34
|
+
|
|
35
|
+
if (!/rules|plugins|match/.test(key)) {
|
|
36
|
+
const keyPath = parentPath.parentPath.parentPath.get('key');
|
|
37
|
+
|
|
38
|
+
if (!keyPath.node)
|
|
39
|
+
return false;
|
|
40
|
+
|
|
41
|
+
const {value} = keyPath.node;
|
|
42
|
+
|
|
43
|
+
if (value !== 'match')
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return true;
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout-config",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "πPutout plugin helps to maintain putout config",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@putout/eslint-flat": "^4.0.0",
|
|
35
35
|
"@putout/test": "^15.0.0",
|
|
36
|
-
"c8": "^10.0.0",
|
|
37
36
|
"eslint": "^10.0.0",
|
|
38
37
|
"eslint-plugin-n": "^17.0.0",
|
|
39
38
|
"eslint-plugin-putout": "^31.0.0",
|
|
40
39
|
"madrun": "^13.0.0",
|
|
41
|
-
"nodemon": "^3.0.1"
|
|
40
|
+
"nodemon": "^3.0.1",
|
|
41
|
+
"superc8": "^12.0.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"putout": ">=42"
|