babel-plugin-putout 5.0.0 → 6.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.
Files changed (3) hide show
  1. package/README.md +5 -14
  2. package/lib/index.js +9 -8
  3. package/package.json +13 -11
package/README.md CHANGED
@@ -1,20 +1,11 @@
1
1
  # babel-plugin-putout
2
2
 
3
- Use `putout` as `babel plugin`.
3
+ Use 🐊[**Putout**](https://github.com/coderaiser/putout) as `babel plugin`.
4
4
 
5
5
  ## Example
6
6
 
7
- **In**
8
-
9
- ```js
10
- // input code
11
- const s = 'hi';
12
- ```
13
-
14
- **Out**
15
-
16
- ```js
17
- // output code
7
+ ```diff
8
+ -const s = 'hi';
18
9
  ```
19
10
 
20
11
  ## Installation
@@ -50,7 +41,7 @@ $ babel --plugins putout script.js
50
41
  ### Via Node API
51
42
 
52
43
  ```javascript
53
- require("babel-core").transform("code", {
54
- plugins: ["putout"],
44
+ require('babel-core').transform('code', {
45
+ plugins: ['putout'],
55
46
  });
56
47
  ```
package/lib/index.js CHANGED
@@ -16,15 +16,12 @@ module.exports = () => {
16
16
  visitor: {
17
17
  Program(path, {filename, opts}) {
18
18
  const options = parseOptions({
19
+ printer: 'putout',
19
20
  filename,
20
21
  options: opts,
21
22
  });
22
23
 
23
- transform(
24
- path.container,
25
- code,
26
- options,
27
- );
24
+ transform(path.container, code, options);
28
25
  },
29
26
  },
30
27
 
@@ -35,9 +32,13 @@ module.exports = () => {
35
32
 
36
33
  generatorOverride(ast) {
37
34
  ast.program.directives = [];
38
- const code = print(ast);
39
- return {code};
35
+ const code = print(ast, {
36
+ printer: 'putout',
37
+ });
38
+
39
+ return {
40
+ code,
41
+ };
40
42
  },
41
43
  };
42
44
  };
43
-
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "babel-plugin-putout",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
+ "type": "commonjs",
4
5
  "description": "babel plugin for putout",
5
6
  "repository": "coderaiser/babel-plugin-putout",
6
7
  "author": "Coderaiser <coderaiser@cloudcmd.io>",
@@ -10,14 +11,15 @@
10
11
  "changelog": false,
11
12
  "devDependencies": {
12
13
  "@babel/core": "^7.12.3",
13
- "@babel/eslint-plugin-development": "^1.0.1",
14
- "babel-plugin-transform-inline-consecutive-adds": "^0.4.3",
15
- "eslint": "^7.0.0",
16
- "eslint-plugin-putout": "^6.0.0",
17
- "madrun": "^8.0.1",
18
- "mocha": "^8.1.3",
19
- "nyc": "^15.0.1",
20
- "supertape": "^4.0.0"
14
+ "@babel/eslint-plugin-development": "^7.14.5",
15
+ "babel-plugin-transform-inline-consecutive-adds": "^0.5.0-alpha.9",
16
+ "c8": "^7.5.0",
17
+ "eslint": "^8.0.1",
18
+ "eslint-plugin-n": "^16.0.0",
19
+ "eslint-plugin-putout": "^17.0.0",
20
+ "madrun": "^9.0.0",
21
+ "mocha": "^10.0.0",
22
+ "supertape": "^8.0.0"
21
23
  },
22
24
  "scripts": {
23
25
  "test": "madrun test",
@@ -31,14 +33,14 @@
31
33
  "report": "madrun report"
32
34
  },
33
35
  "engines": {
34
- "node": ">=14"
36
+ "node": ">=16"
35
37
  },
36
38
  "keywords": [
37
39
  "putout",
38
40
  "babel-plugin"
39
41
  ],
40
42
  "peerDependencies": {
41
- "putout": ">=14"
43
+ "putout": ">=29"
42
44
  },
43
45
  "publishConfig": {
44
46
  "access": "public"