@putout/plugin-putout-config 6.6.0 → 6.8.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
@@ -16,6 +16,7 @@ npm i @putout/plugin-putout-config -D
16
16
  - ✅ [apply-conditions][#apply-conditions];
17
17
  - ✅ [apply-for-of][#apply-for-of];
18
18
  - ✅ [apply-labels][#apply-labels];
19
+ - ✅ [apply-math][#apply-math];
19
20
  - ✅ [apply-nodejs][#apply-nodejs];
20
21
  - ✅ [apply-promises][#apply-promises];
21
22
  - ✅ [apply-tape][#apply-tape];
@@ -34,6 +35,7 @@ npm i @putout/plugin-putout-config -D
34
35
  "putout-config/apply-conditions": "on",
35
36
  "putout-config/apply-for-of": "on",
36
37
  "putout-config/apply-labels": "on",
38
+ "putout-config/apply-math": "on",
37
39
  "putout-config/apply-nodejs": "on",
38
40
  "putout-config/apply-tape": "on",
39
41
  "putout-config/apply-types": "on",
@@ -145,39 +147,67 @@ Apply [`labels`](https://github.com/coderaiser/putout/tree/master/packages/plugi
145
147
  }
146
148
  ```
147
149
 
150
+ ## apply-math
151
+
152
+ Apply [`math`](https://github.com/coderaiser/putout/tree/master/packages/plugin-labels#readme) according to 🐊[**Putout v28**](https://github.com/coderaiser/putout/releases/tag/v28.0.0).
153
+
154
+ ```diff
155
+ {
156
+ "rules": {
157
+ - "convert-math-pow": "off",
158
+ - "apply-numeric-separators": "off",
159
+ - "convert-imul-to-multiplication": "off",
160
+ - "convert-sqrt-to-hypot": "off"
161
+ + "math/apply-exponential": "off",
162
+ + "math/apply-numeric-separators": "off",
163
+ + "math/apply-multiplication": "off",
164
+ + "math/convert-sqrt-to-hypot": "off"
165
+ }
166
+ }
167
+ ```
168
+
148
169
  ## apply-nodejs
149
170
 
150
171
  Apply [`nodejs`](https://github.com/coderaiser/putout/tree/master/packages/plugin-nodejs#readme) according to:
151
172
 
152
- - 🐊[**Putout v33**](https://github.com/coderaiser/putout/releases/tag/v33.0.0);
153
- - 🐊[**Putout v34**](https://github.com/coderaiser/putout/releases/tag/v34.0.0);
154
-
155
- ### ❌ Example of incorrect code
173
+ - 🐊[**Putout v28**](https://github.com/coderaiser/putout/releases/tag/v33.0.0):
156
174
 
157
- ```json
175
+ ```diff
158
176
  {
159
177
  "rules": {
160
- "strict-mode/add-missing": "off",
161
- "strict-mode/remove-useless": "off",
162
- "convert-esm-to-commonjs": "off",
163
- "convert-commonjs-to-esm": "off"
178
+ - "convert-top-level-return": "off",
179
+ + "nodejs/convert-top-level-return": "off"
180
+ - "remove-process-exit": "off"
181
+ + "nodejs/remove-process-exit": "off"
164
182
  }
165
183
  }
166
184
  ```
167
185
 
168
- ### Example of correct code
186
+ - 🐊[**Putout v33**](https://github.com/coderaiser/putout/releases/tag/v33.0.0):
169
187
 
170
- ```json
188
+ ```diff
171
189
  {
172
190
  "rules": {
173
- "nodejs/add-missing-strict-mode": "off",
174
- "nodejs/remove-useless-strict-mode": "off",
175
- "nodejs/convert-esm-to-commonjs": "off",
176
- "nodejs/convert-commonjs-to-esm": "off"
191
+ - "convert-esm-to-commonjs": "on",
192
+ - "convert-commonjs-to-esm": "on'
193
+ + "nodejs/convert-esm-to-commonjs": "on",
194
+ + "nodejs/convert-commonjs-to-esm": "on'
177
195
  }
178
196
  }
179
197
  ```
180
198
 
199
+ - 🐊[**Putout v34**](https://github.com/coderaiser/putout/releases/tag/v34.0.0):
200
+
201
+ ```diff
202
+ {
203
+ "rules": {
204
+ - "strict-mode/add-missing": "off",
205
+ - "strict-mode/remove-useless": "off"
206
+ + "nodejs/remove-useless-strict-mode": "off",
207
+ + "nodejs/add-missing-strict-mode": "off"
208
+ }
209
+ ```
210
+
181
211
  ## apply-promises
182
212
 
183
213
  Apply [`promises`](https://github.com/coderaiser/putout/tree/master/packages/plugin-promises#readme) according to:
@@ -342,6 +372,19 @@ Rename rules according to:
342
372
  }
343
373
  ```
344
374
 
375
+ - 🐊[**Putout v26**](https://github.com/coderaiser/putout/releases/tag/v26.0.0):
376
+
377
+ ```diff
378
+ {
379
+ "rules": {
380
+ - "strict-mode/add": "off",
381
+ - "strict-mode/remove": "off",
382
+ + "strict-mode/add-missing": "off",
383
+ + "strict-mode/remove-useless": "off",
384
+ }
385
+ }
386
+ ```
387
+
345
388
  ## License
346
389
 
347
390
  MIT
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const {createRenameProperty} = require('../rename-property');
4
+
5
+ module.exports = createRenameProperty([
6
+ ['convert-math-pow', 'math/apply-exponential'],
7
+ ['apply-numeric-separators', 'math/apply-numeric-separators'],
8
+ ['convert-imul-to-multiplication', 'math/apply-multiplication'],
9
+ ['convert-sqrt-to-hypot', 'math/convert-sqrt-to-hypot'],
10
+ ]);
@@ -2,7 +2,13 @@
2
2
 
3
3
  const {createRenameProperty} = require('../rename-property');
4
4
 
5
+ const v24 = [
6
+ ['remove-process-exit', 'nodejs/remove-process-exit'],
7
+ ['convert-top-level-return', 'nodejs/convert-top-level-return'],
8
+ ];
9
+
5
10
  module.exports = createRenameProperty([
11
+ ...v24,
6
12
  ['strict-mode/add-missing', 'nodejs/add-missing-strict-mode'],
7
13
  ['strict-mode/remove-useless', 'nodejs/remove-useless-strict-mode'],
8
14
  ['convert-esm-to-commonjs', 'nodejs/convert-esm-to-commonjs'],
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  const applyConditions = require('./apply-conditions');
4
4
  const applyForOf = require('./apply-for-of');
5
5
  const applyLabels = require('./apply-labels');
6
+ const applyMath = require('./apply-math');
6
7
  const applyNodejs = require('./apply-nodejs');
7
8
  const applyPromises = require('./apply-promises');
8
9
  const applyTape = require('./apply-tape');
@@ -16,6 +17,7 @@ module.exports.rules = {
16
17
  'apply-conditions': applyConditions,
17
18
  'apply-for-of': applyForOf,
18
19
  'apply-labels': applyLabels,
20
+ 'apply-math': applyMath,
19
21
  'apply-nodejs': applyNodejs,
20
22
  'apply-promises': applyPromises,
21
23
  'apply-tape': applyTape,
@@ -7,4 +7,12 @@ const v29 = [
7
7
  ['apply-maybe', 'maybe'],
8
8
  ];
9
9
 
10
- module.exports = createRenameProperty(v29);
10
+ const v26 = [
11
+ ['strict-mode/add', 'strict-mode/add-missing'],
12
+ ['strict-mode/remove', 'strict-mode/remove-useless'],
13
+ ];
14
+
15
+ module.exports = createRenameProperty([
16
+ ...v29,
17
+ ...v26,
18
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout-config",
3
- "version": "6.6.0",
3
+ "version": "6.8.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",