@putout/plugin-putout-config 6.9.2 → 7.0.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 CHANGED
@@ -13,20 +13,21 @@ npm i @putout/plugin-putout-config -D
13
13
 
14
14
  ## Rules
15
15
 
16
- - ✅ [apply-conditions][#apply-conditions];
17
- - ✅ [apply-for-of][#apply-for-of];
18
- - ✅ [apply-labels][#apply-labels];
19
- - ✅ [apply-math][#apply-math];
20
- - ✅ [apply-nodejs][#apply-nodejs];
21
- - ✅ [apply-promises][#apply-promises];
22
- - ✅ [apply-tape][#apply-tape];
23
- - ✅ [apply-types][#apply-types];
24
- - ✅ [convert-boolean-to-string][#convert-boolean-to-string];
25
- - ✅ [move-formatter-up][#move-formatter-up];
26
- - ✅ [remove-empty][#remove-empty];
27
- - ✅ [remove-empty-file][#remove-empty-file];
28
- - ✅ [rename-property][#rename-property];
29
- - ✅ [rename-rules][#rename-rules];
16
+ - ✅ [apply-conditions](#apply-conditions);
17
+ - ✅ [apply-for-of](#apply-for-of);
18
+ - ✅ [apply-labels](#apply-labels);
19
+ - ✅ [apply-math](#apply-math);
20
+ - ✅ [apply-nodejs](#apply-nodejs);
21
+ - ✅ [apply-optional-chaining](#apply-conditions);
22
+ - ✅ [apply-promises](#apply-promises);
23
+ - ✅ [apply-tape](#apply-tape);
24
+ - ✅ [apply-types](#apply-types);
25
+ - ✅ [convert-boolean-to-string](#convert-boolean-to-string);
26
+ - ✅ [move-formatter-up](#move-formatter-up);
27
+ - ✅ [remove-empty](#remove-empty);
28
+ - ✅ [remove-empty-file](#remove-empty-file);
29
+ - ✅ [rename-property](#rename-property);
30
+ - ✅ [rename-rules](#rename-rules);
30
31
 
31
32
  ## Config
32
33
 
@@ -38,6 +39,7 @@ npm i @putout/plugin-putout-config -D
38
39
  "putout-config/apply-labels": "on",
39
40
  "putout-config/apply-math": "on",
40
41
  "putout-config/apply-nodejs": "on",
42
+ "putout-config/apply-optional-chaining": "on",
41
43
  "putout-config/apply-tape": "on",
42
44
  "putout-config/apply-types": "on",
43
45
  "putout-config/apply-promises": "on",
@@ -50,6 +52,27 @@ npm i @putout/plugin-putout-config -D
50
52
  }
51
53
  ```
52
54
 
55
+ ## apply-optional-chaining
56
+
57
+ Apply [`optional-chaining`](https://github.com/coderaiser/putout/tree/master/packages/plugin-optional-chaining#readme) according to:
58
+
59
+ - 🐊[**Putout v37**](https://github.com/coderaiser/putout/releases/tag/v37.0.0):
60
+
61
+ ```diff
62
+ {
63
+ "rules": {
64
+ - "convert-optional-to-logical/assign": "on",
65
+ - "convert-optional-to-logical/call": "off",
66
+ + "optional-chaining/convert-optional-assign-to-logical": "on",
67
+ + "optional-chaining/convert-optional-to-logical": "off"
68
+ - "apply-optional-chaining/assign": "off"
69
+ - "apply-optional-chaining/use": "on"
70
+ + "optional-chaining/convert-logical-assign-to-optional": "off",
71
+ + "optional-chaining/convert-logical-to-optional": "off"
72
+ }
73
+ }
74
+ ```
75
+
53
76
  ## apply-conditions
54
77
 
55
78
  Apply [`conditions`](https://github.com/coderaiser/putout/tree/master/packages/plugin-conditions#readme) according to:
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const {createRenameProperty} = require('../rename-property');
4
+
5
+ const v37 = [
6
+ ['convert-optional-to-logical/assign', 'optional-chaining/convert-optional-assign-to-logical'],
7
+ ['convert-optional-to-logical/call', 'optional-chaining/convert-optional-to-logical'],
8
+ ['apply-optional-chaining/assign', 'optional-chaining/convert-logical-assign-to-optional'],
9
+ ['apply-optional-chaining/use', 'optional-chaining/convert-logical-to-optional'],
10
+ ];
11
+
12
+ module.exports = createRenameProperty(v37);
@@ -3,7 +3,6 @@
3
3
  const {operator} = require('putout');
4
4
  const {
5
5
  readFileContent,
6
- findFile,
7
6
  removeFile,
8
7
  } = operator;
9
8
 
@@ -13,8 +12,8 @@ module.exports.fix = (filePath) => {
13
12
  removeFile(filePath);
14
13
  };
15
14
 
16
- module.exports.scan = (path, {push}) => {
17
- for (const file of findFile(path, '.putout.json')) {
15
+ module.exports.scan = (path, {push, trackFile}) => {
16
+ for (const file of trackFile(path, '.putout.json')) {
18
17
  const data = readFileContent(file);
19
18
 
20
19
  if (data.startsWith('{}'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout-config",
3
- "version": "6.9.2",
3
+ "version": "7.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps to maintain putout config",
@@ -11,7 +11,7 @@
11
11
  "changelog": false,
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/coderaiser/putout.git"
14
+ "url": "git+https://github.com/coderaiser/putout.git"
15
15
  },
16
16
  "scripts": {
17
17
  "test": "madrun test",
@@ -42,7 +42,7 @@
42
42
  "nodemon": "^3.0.1"
43
43
  },
44
44
  "peerDependencies": {
45
- "putout": ">=36"
45
+ "putout": ">=37"
46
46
  },
47
47
  "license": "MIT",
48
48
  "engines": {