@putout/plugin-putout 8.8.1 → 8.9.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 +29 -0
- package/lib/includer/index.js +14 -0
- package/lib/index.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ npm i @putout/plugin-putout -D
|
|
|
37
37
|
"putout/shorten-imports": "on",
|
|
38
38
|
"putout/check-replace-code": "on",
|
|
39
39
|
"putout/declare": "on",
|
|
40
|
+
"putout/includer": "on",
|
|
40
41
|
"putout/move-require-on-top-level": "on"
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -497,6 +498,34 @@ test('remove debugger: report', (t) => {
|
|
|
497
498
|
});
|
|
498
499
|
```
|
|
499
500
|
|
|
501
|
+
## includer
|
|
502
|
+
|
|
503
|
+
### ❌ Incorrect code example
|
|
504
|
+
|
|
505
|
+
```js
|
|
506
|
+
module.exports.include = () => 'cons __a = __b';
|
|
507
|
+
module.exports.exclude = () => 'var __a = __b';
|
|
508
|
+
|
|
509
|
+
module.exports.include = 'cons __a = __b';
|
|
510
|
+
module.exports.exclude = 'var __a = __b';
|
|
511
|
+
|
|
512
|
+
module.exports.include = ['cons __a = __b'];
|
|
513
|
+
module.exports.exclude = ['var __a = __b'];
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### ✅ Correct code Example
|
|
517
|
+
|
|
518
|
+
```js
|
|
519
|
+
module.exports.include = () => ['cons __a = __b'];
|
|
520
|
+
module.exports.exclude = () => ['var __a = __b'];
|
|
521
|
+
|
|
522
|
+
module.exports.include = () => ['cons __a = __b'];
|
|
523
|
+
module.exports.exclude = () => ['var __a = __b'];
|
|
524
|
+
|
|
525
|
+
module.exports.include = () => ['cons __a = __b'];
|
|
526
|
+
module.exports.exclude = () => ['var __a = __b'];
|
|
527
|
+
```
|
|
528
|
+
|
|
500
529
|
## License
|
|
501
530
|
|
|
502
531
|
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports.report = () => 'Includer functions should return array (https://git.io/Jyndl)';
|
|
4
|
+
|
|
5
|
+
module.exports.replace = () => ({
|
|
6
|
+
'module.exports.include = () => "__a"': 'module.exports.include = ["__a"]',
|
|
7
|
+
'module.exports.exclude = () => "__a"': 'module.exports.exclude = ["__a"]',
|
|
8
|
+
|
|
9
|
+
'module.exports.include = ["__a"]': 'module.exports.include = () => ["__a"]',
|
|
10
|
+
'module.exports.exclude = ["__a"]': 'module.exports.exclude = () => ["__a"]',
|
|
11
|
+
|
|
12
|
+
'module.exports.include = "__a"': 'module.exports.include = ["__a"]',
|
|
13
|
+
'module.exports.exclude = "__a"': 'module.exports.exclude= ["__a"]',
|
|
14
|
+
});
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-putout",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "putout plugin helps with plugins development",
|
|
6
|
-
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-putout",
|
|
6
|
+
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-putout#readme",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"release": false,
|
|
9
9
|
"tag": false,
|