@putout/plugin-optional-chaining 1.0.3 → 1.0.4
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.
|
@@ -12,7 +12,7 @@ module.exports.fix = (path) => {
|
|
|
12
12
|
assign: true,
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
const logicalNode = template.ast(logical);
|
|
15
|
+
const logicalNode = template.ast.fresh(logical);
|
|
16
16
|
|
|
17
17
|
logicalNode.right.right = path.parentPath.node.right;
|
|
18
18
|
replaceWith(path.parentPath, logicalNode);
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const convertLogicalAssignToOptional = require('./convert-logical-assign-to-optional');
|
|
4
4
|
const convertLogicalToOptional = require('./convert-logical-to-optional');
|
|
5
5
|
const convertOptionalAssignToLogical = require('./convert-optional-assign-to-logical');
|
|
6
6
|
const convertOptionalToLogical = require('./convert-optional-to-logical');
|
|
7
7
|
|
|
8
8
|
module.exports.rules = {
|
|
9
|
-
'convert-assign-to-optional': ['off',
|
|
9
|
+
'convert-logical-assign-to-optional': ['off', convertLogicalAssignToOptional],
|
|
10
10
|
'convert-logical-to-optional': convertLogicalToOptional,
|
|
11
11
|
'convert-optional-assign-to-logical': convertOptionalAssignToLogical,
|
|
12
12
|
'convert-optional-to-logical': ['off', convertOptionalToLogical],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-optional-chaining",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout plugin adds ability apply optional chaining",
|
|
File without changes
|