eslint-plugin-putout 13.12.0 → 14.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/lib/evaluate/README.md +5 -4
- package/lib/evaluate/index.js +5 -3
- package/lib/putout/README.md +1 -5
- package/package.json +3 -3
package/lib/evaluate/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Evaluate
|
|
2
2
|
|
|
3
|
-
Evaluate expression started with `__putout_evaluate: `.
|
|
4
|
-
|
|
3
|
+
Evaluate expression started with `__putout_evaluate: `. Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules)
|
|
4
|
+
|
|
5
|
+
Provided code is processed with [`@putout/plugin-declare-undefined-variables`](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare-undefined-variables):
|
|
5
6
|
|
|
6
7
|
```js
|
|
7
8
|
__putout_evaluate: join("hello", " ", "world");
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
and converted to:
|
|
11
12
|
|
|
12
13
|
```js
|
|
13
14
|
const fn = (__filename, __dirname, require) => {
|
package/lib/evaluate/index.js
CHANGED
|
@@ -30,15 +30,17 @@ module.exports.fix = ({text, node, filename}) => {
|
|
|
30
30
|
function evaluate({value, filename}) {
|
|
31
31
|
value = value.replace(/__putout_evaluate:\s?/, 'return ');
|
|
32
32
|
const {code} = putout(value, {
|
|
33
|
+
fix: true,
|
|
33
34
|
rules: {
|
|
34
|
-
'convert-
|
|
35
|
+
'nodejs/convert-top-level-return': 'off',
|
|
35
36
|
},
|
|
36
37
|
plugins: [
|
|
37
|
-
'
|
|
38
|
+
'nodejs',
|
|
38
39
|
'convert-esm-to-commonjs',
|
|
40
|
+
'declare-undefined-variables',
|
|
39
41
|
],
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
const fn = Function('__filename', '__dirname', 'require', code);
|
|
43
|
-
return fn(filename, dirname(
|
|
45
|
+
return fn(filename, dirname(filename), require);
|
|
44
46
|
}
|
package/lib/putout/README.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# Putout (`putout`)
|
|
2
2
|
|
|
3
|
-
🐊[`Putout`](https://github.com/coderaiser/putout) used as eslint plugin.
|
|
4
|
-
|
|
5
|
-
## Rule Details
|
|
6
|
-
|
|
7
|
-
Rules run [putout rules](https://github.com/coderaiser/putout#built-in-transforms) in `eslint`.
|
|
3
|
+
🐊[`Putout`](https://github.com/coderaiser/putout) used as eslint plugin runs [putout rules](https://github.com/coderaiser/putout#built-in-transforms) in `eslint`.
|
|
8
4
|
|
|
9
5
|
And can be [configured](https://eslint.org/docs/user-guide/configuring#configuring-rules) according to [putout configuration](https://github.com/coderaiser/putout#configuration).
|
|
10
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "eslint plugin for putout",
|
|
6
6
|
"release": false,
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"try-to-catch": "^3.0.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
|
-
"node": ">=
|
|
64
|
+
"node": ">=16"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"eslint": ">=8.0.0",
|
|
68
|
-
"putout": ">=
|
|
68
|
+
"putout": ">=25"
|
|
69
69
|
},
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"publishConfig": {
|