@putout/plugin-putout-config 11.14.0 → 12.1.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 +21 -0
- package/lib/apply-arguments/index.js +3 -2
- package/lib/apply-assignment/index.js +3 -2
- package/lib/apply-conditions/index.js +3 -2
- package/lib/apply-destructuring/index.js +3 -2
- package/lib/apply-esm/index.js +3 -2
- package/lib/apply-filesystem/index.js +15 -0
- package/lib/apply-for-of/index.js +4 -2
- package/lib/apply-labels/index.js +4 -2
- package/lib/apply-math/index.js +4 -2
- package/lib/apply-nodejs/index.js +3 -2
- package/lib/apply-optional-chaining/index.js +3 -2
- package/lib/apply-parens/index.js +3 -2
- package/lib/apply-promises/index.js +4 -2
- package/lib/apply-return/index.js +4 -2
- package/lib/apply-spread/index.js +3 -2
- package/lib/apply-tape/index.js +4 -2
- package/lib/apply-types/index.js +4 -2
- package/lib/apply-variables/index.js +3 -2
- package/lib/rename-rules/index.js +3 -2
- package/package.json +4 -4
- package/lib/rename-property.js +0 -39
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ npm i @putout/plugin-putout-config -D
|
|
|
18
18
|
- ✅ [apply-conditions](#apply-conditions);
|
|
19
19
|
- ✅ [apply-destructuring](#apply-destructuring);
|
|
20
20
|
- ✅ [apply-esm](#apply-esm);
|
|
21
|
+
- ✅ [apply-filesystem](#apply-filesystem);
|
|
21
22
|
- ✅ [apply-for-of](#apply-for-of);
|
|
22
23
|
- ✅ [apply-parens](#apply-parens);
|
|
23
24
|
- ✅ [apply-return](#apply-return);
|
|
@@ -49,6 +50,7 @@ npm i @putout/plugin-putout-config -D
|
|
|
49
50
|
"putout-config/apply-destructuring": "on",
|
|
50
51
|
"putout-config/apply-esm": "on",
|
|
51
52
|
"putout-config/apply-for-of": "on",
|
|
53
|
+
"putout-config/apply-filesystem": "on",
|
|
52
54
|
"putout-config/apply-labels": "on",
|
|
53
55
|
"putout-config/apply-math": "on",
|
|
54
56
|
"putout-config/apply-nodejs": "on",
|
|
@@ -114,6 +116,25 @@ Apply [`return`](https://github.com/coderaiser/putout/tree/master/packages/plugi
|
|
|
114
116
|
}
|
|
115
117
|
```
|
|
116
118
|
|
|
119
|
+
## apply-filesystem
|
|
120
|
+
|
|
121
|
+
Apply [`filesystem`](https://github.com/coderaiser/putout/tree/master/packages/plugin-filesystem#readme) according to:
|
|
122
|
+
|
|
123
|
+
- 🐊[**Putout v42**](https://github.com/coderaiser/putout/releases/tag/v42.0.0):
|
|
124
|
+
|
|
125
|
+
```diff
|
|
126
|
+
{
|
|
127
|
+
"rules": {
|
|
128
|
+
- "filesystem/remove-travis-yml-file": "off",
|
|
129
|
+
- "filesystem/remove-vim-swap-file": "off",
|
|
130
|
+
- "filesystem/remove-nyc-output-file": "off",
|
|
131
|
+
- "filesystem/remove-ds-store-file": "off",
|
|
132
|
+
- "filesystem/remove-empty-directory": "off",
|
|
133
|
+
+ "filesystem/remove-files": "off",
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
117
138
|
## apply-esm
|
|
118
139
|
|
|
119
140
|
Apply [`esm`](https://github.com/coderaiser/putout/tree/master/packages/plugin-esm#readme) according to:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v41 = [
|
|
4
5
|
['remove-useless-arguments', 'arguments'],
|
|
5
6
|
['remove-useless-arguments/arguments', 'arguments/remove-useless'],
|
|
@@ -16,4 +17,4 @@ export const {
|
|
|
16
17
|
report,
|
|
17
18
|
fix,
|
|
18
19
|
traverse,
|
|
19
|
-
} =
|
|
20
|
+
} = renameProperties(versions);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v39 = [
|
|
4
5
|
['split-assignment-expressions', 'assignment/split'],
|
|
5
6
|
['simplify-assignments', 'assignment/simplify'],
|
|
@@ -12,4 +13,4 @@ export const {
|
|
|
12
13
|
report,
|
|
13
14
|
fix,
|
|
14
15
|
traverse,
|
|
15
|
-
} =
|
|
16
|
+
} = renameProperties(v39);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v32 = [
|
|
4
5
|
['remove-useless-else', 'conditions/remove-useless-else'],
|
|
5
6
|
['merge-if-statements', 'conditions/merge-if-statements'],
|
|
@@ -26,4 +27,4 @@ export const {
|
|
|
26
27
|
report,
|
|
27
28
|
fix,
|
|
28
29
|
traverse,
|
|
29
|
-
} =
|
|
30
|
+
} = renameProperties(versions);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v41 = [
|
|
4
5
|
['apply-destructuring', 'destructuring'],
|
|
5
6
|
['apply-destructuring/object', 'destructuring/apply-object'],
|
|
@@ -22,4 +23,4 @@ export const {
|
|
|
22
23
|
report,
|
|
23
24
|
fix,
|
|
24
25
|
traverse,
|
|
25
|
-
} =
|
|
26
|
+
} = renameProperties(versions);
|
package/lib/apply-esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v41 = [
|
|
4
5
|
['esm/apply-index-to-import', ''],
|
|
5
6
|
];
|
|
@@ -29,4 +30,4 @@ export const {
|
|
|
29
30
|
report,
|
|
30
31
|
fix,
|
|
31
32
|
traverse,
|
|
32
|
-
} =
|
|
33
|
+
} = renameProperties(versions);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
4
|
+
|
|
5
|
+
export const {
|
|
6
|
+
report,
|
|
7
|
+
fix,
|
|
8
|
+
traverse,
|
|
9
|
+
} = renameProperties([
|
|
10
|
+
['filesystem/remove-travis-yml', 'filesystem/remove-file'],
|
|
11
|
+
['filesystem/remove-vim-swap-file', 'filesystem/remove-file'],
|
|
12
|
+
['filesystem/remove-nyc-output-file', 'filesystem/remove-file'],
|
|
13
|
+
['filesystem/remove-ds-store-file', 'filesystem/remove-file'],
|
|
14
|
+
['filesystem/remove-empty-directory', 'filesystem/remove-file'],
|
|
15
|
+
]);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['convert-for-to-for-of', 'for-of/for'],
|
|
9
11
|
['convert-for-each-to-for-of', 'for-of/for-each'],
|
|
10
12
|
['convert-for-in-to-for-of', 'for-of/for-in'],
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['remove-unused-labels', 'labels/remove-unused'],
|
|
9
11
|
['convert-label-to-object', 'labels/convert-to-object'],
|
|
10
12
|
]);
|
package/lib/apply-math/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['convert-math-pow', 'math/apply-exponential'],
|
|
9
11
|
['apply-numeric-separators', 'math/apply-numeric-separators'],
|
|
10
12
|
['convert-imul-to-multiplication', 'math/apply-multiplication'],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v24 = [
|
|
4
5
|
['remove-process-exit', 'nodejs/remove-process-exit'],
|
|
5
6
|
['convert-top-level-return', 'nodejs/convert-top-level-return'],
|
|
@@ -9,7 +10,7 @@ export const {
|
|
|
9
10
|
report,
|
|
10
11
|
fix,
|
|
11
12
|
traverse,
|
|
12
|
-
} =
|
|
13
|
+
} = renameProperties([
|
|
13
14
|
...v24,
|
|
14
15
|
['strict-mode/add-missing', 'nodejs/add-missing-strict-mode'],
|
|
15
16
|
['strict-mode/remove-useless', 'nodejs/remove-useless-strict-mode'],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v37 = [
|
|
4
5
|
['convert-optional-to-logical/assign', 'optional-chaining/convert-optional-assign-to-logical'],
|
|
5
6
|
['convert-optional-to-logical/call', 'optional-chaining/convert-optional-to-logical'],
|
|
@@ -11,4 +12,4 @@ export const {
|
|
|
11
12
|
report,
|
|
12
13
|
fix,
|
|
13
14
|
traverse,
|
|
14
|
-
} =
|
|
15
|
+
} = renameProperties(v37);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v37 = [
|
|
4
5
|
['add-missing-parens', 'parens/add-missing'],
|
|
5
6
|
];
|
|
@@ -8,4 +9,4 @@ export const {
|
|
|
8
9
|
report,
|
|
9
10
|
fix,
|
|
10
11
|
traverse,
|
|
11
|
-
} =
|
|
12
|
+
} = renameProperties(v37);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['remove-useless-variables/await', 'promises/remove-useless-variables'],
|
|
9
11
|
]);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['apply-early-return', 'return/apply-early'],
|
|
9
11
|
['remove-useless-return', 'return/remove-useless'],
|
|
10
12
|
['simplify-boolean-return', 'return/simplify-boolean'],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v41 = [
|
|
4
5
|
['remove-useless-spread', 'spread'],
|
|
5
6
|
['remove-useless-spread/nested', 'spread/simplify-nested'],
|
|
@@ -15,4 +16,4 @@ export const {
|
|
|
15
16
|
report,
|
|
16
17
|
fix,
|
|
17
18
|
traverse,
|
|
18
|
-
} =
|
|
19
|
+
} = renameProperties(versions);
|
package/lib/apply-tape/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['convert-mock-require-to-mock-import', 'tape/convert-mock-require-to-mock-import'],
|
|
9
11
|
]);
|
package/lib/apply-types/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
|
|
3
|
+
const {renameProperties} = operator;
|
|
2
4
|
|
|
3
5
|
export const {
|
|
4
6
|
report,
|
|
5
7
|
fix,
|
|
6
8
|
traverse,
|
|
7
|
-
} =
|
|
9
|
+
} = renameProperties([
|
|
8
10
|
['convert-typeof-to-is-type', 'types/convert-typeof-to-is-type'],
|
|
9
11
|
['remove-useless-type-conversions', 'types/remove-useless-type-conversions'],
|
|
10
12
|
['remove-useless-typeof', 'types/remove-useless-typeof'],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v41 = [
|
|
4
5
|
['remove-useless-variables', 'variables'],
|
|
5
6
|
['remove-useless-variables/remove', 'variables/remove-useless'],
|
|
@@ -21,4 +22,4 @@ export const {
|
|
|
21
22
|
report,
|
|
22
23
|
fix,
|
|
23
24
|
traverse,
|
|
24
|
-
} =
|
|
25
|
+
} = renameProperties(versions);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {operator} from 'putout';
|
|
2
2
|
|
|
3
|
+
const {renameProperties} = operator;
|
|
3
4
|
const v29 = [
|
|
4
5
|
['declare-undefined-variables', 'declare'],
|
|
5
6
|
['apply-array-at', 'array-at'],
|
|
@@ -15,7 +16,7 @@ export const {
|
|
|
15
16
|
report,
|
|
16
17
|
fix,
|
|
17
18
|
traverse,
|
|
18
|
-
} =
|
|
19
|
+
} = renameProperties([
|
|
19
20
|
...v29,
|
|
20
21
|
...v26,
|
|
21
22
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
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",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"c8": "^10.0.0",
|
|
37
37
|
"eslint": "^10.0.0",
|
|
38
38
|
"eslint-plugin-n": "^17.0.0",
|
|
39
|
-
"eslint-plugin-putout": "^
|
|
40
|
-
"madrun": "^
|
|
39
|
+
"eslint-plugin-putout": "^31.0.0",
|
|
40
|
+
"madrun": "^13.0.0",
|
|
41
41
|
"nodemon": "^3.0.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"putout": ">=
|
|
44
|
+
"putout": ">=42"
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"engines": {
|
package/lib/rename-property.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {operator} from 'putout';
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
traverseProperties,
|
|
5
|
-
__json,
|
|
6
|
-
setLiteralValue,
|
|
7
|
-
remove,
|
|
8
|
-
} = operator;
|
|
9
|
-
|
|
10
|
-
export const createRenameProperty = (tuples) => ({
|
|
11
|
-
report,
|
|
12
|
-
fix,
|
|
13
|
-
traverse: createTraverse(tuples),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const report = ({from, to}) => `Rename property: '${from}' -> '${to}'`;
|
|
17
|
-
|
|
18
|
-
const fix = ({path, to}) => {
|
|
19
|
-
if (!to) {
|
|
20
|
-
remove(path.parentPath.parentPath);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
setLiteralValue(path.node.key, to);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const createTraverse = (tuples) => ({push}) => ({
|
|
28
|
-
[__json](mainPath) {
|
|
29
|
-
for (const [from, to] of tuples) {
|
|
30
|
-
for (const path of traverseProperties(mainPath, from)) {
|
|
31
|
-
push({
|
|
32
|
-
path,
|
|
33
|
-
from,
|
|
34
|
-
to,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
});
|