@putout/plugin-putout-config 11.12.0 β 11.13.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 +10 -0
- package/lib/apply-esm/index.js +5 -0
- package/lib/rename-property.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,6 +116,16 @@ Apply [`return`](https://github.com/coderaiser/putout/tree/master/packages/plugi
|
|
|
116
116
|
|
|
117
117
|
Apply [`esm`](https://github.com/coderaiser/putout/tree/master/packages/plugin-esm#readme) according to:
|
|
118
118
|
|
|
119
|
+
- π[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):
|
|
120
|
+
|
|
121
|
+
```diff
|
|
122
|
+
{
|
|
123
|
+
"rules": {
|
|
124
|
+
- "esm/add-index-to-import": "on"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
119
129
|
- π[**Putout v40**](https://github.com/coderaiser/putout/releases/tag/v40.0.0):
|
|
120
130
|
|
|
121
131
|
```diff
|
package/lib/apply-esm/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import {createRenameProperty} from '../rename-property.js';
|
|
2
2
|
|
|
3
|
+
const v41 = [
|
|
4
|
+
['esm/apply-index-to-import', ''],
|
|
5
|
+
];
|
|
6
|
+
|
|
3
7
|
const v40 = [
|
|
4
8
|
['putout/apply-index-to-import', 'esm/apply-index-to-import'],
|
|
5
9
|
];
|
|
@@ -18,6 +22,7 @@ const v37 = [
|
|
|
18
22
|
const versions = [
|
|
19
23
|
...v37,
|
|
20
24
|
...v40,
|
|
25
|
+
...v41,
|
|
21
26
|
];
|
|
22
27
|
|
|
23
28
|
export const {
|
package/lib/rename-property.js
CHANGED
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
traverseProperties,
|
|
5
5
|
__json,
|
|
6
6
|
setLiteralValue,
|
|
7
|
+
remove,
|
|
7
8
|
} = operator;
|
|
8
9
|
|
|
9
10
|
export const createRenameProperty = (tuples) => ({
|
|
@@ -15,6 +16,11 @@ export const createRenameProperty = (tuples) => ({
|
|
|
15
16
|
const report = ({from, to}) => `Rename property: '${from}' -> '${to}'`;
|
|
16
17
|
|
|
17
18
|
const fix = ({path, to}) => {
|
|
19
|
+
if (!to) {
|
|
20
|
+
remove(path.parentPath.parentPath);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
setLiteralValue(path.node.key, to);
|
|
19
25
|
};
|
|
20
26
|
|
package/package.json
CHANGED