@putout/printer 11.10.0 → 11.10.1

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2024.12.19, v11.10.1
2
+
3
+ feature:
4
+ - 6589deb @putout/printer: @putout/plugin-printer v4.0.0
5
+
1
6
  2024.12.18, v11.10.0
2
7
 
3
8
  feature:
package/lib/json.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isCallExpression,
5
6
  isIdentifier,
6
- } = require('@putout/babel').types;
7
-
7
+ } = types;
8
8
  const {isJSON} = require('@putout/operator-json');
9
9
 
10
10
  module.exports.maybeJSON = (ast, overrides) => {
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isDecorator,
5
6
  isMemberExpression,
6
- } = require('@putout/babel').types;
7
-
7
+ } = types;
8
8
  const {
9
9
  isLast,
10
10
  isCoupleLines,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const {isSimple} = require('@putout/operate');
4
-
4
+ const {types} = require('@putout/babel');
5
5
  const {
6
6
  isObjectExpression,
7
7
  isArrayExpression,
@@ -12,7 +12,7 @@ const {
12
12
  isNullLiteral,
13
13
  isStringLiteral,
14
14
  isSpreadElement,
15
- } = require('@putout/babel').types;
15
+ } = types;
16
16
 
17
17
  const {
18
18
  isStringAndMember,
@@ -5,10 +5,11 @@ const {
5
5
  maybePrintRightBrace,
6
6
  } = require('./maybe-write-brace');
7
7
 
8
+ const {types} = require('@putout/babel');
8
9
  const {
9
10
  isExpressionStatement,
10
11
  isAssignmentExpression,
11
- } = require('@putout/babel').types;
12
+ } = types;
12
13
 
13
14
  module.exports.AssignmentExpression = (path, printer, semantics) => {
14
15
  const {print} = printer;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isStringLiteral,
5
6
  isTemplateLiteral,
6
7
  isBinaryExpression,
7
- } = require('@putout/babel').types;
8
-
8
+ } = types;
9
9
  const isStringLike = (a) => {
10
10
  if (isStringLiteral(a))
11
11
  return true;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {isFunction} = require('@putout/babel').types;
3
+ const {types} = require('@putout/babel');
4
+ const {isFunction} = types;
4
5
  const {isNext} = require('../../is');
5
6
  const {markAfter} = require('../../mark');
6
7
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {isMemberExpression} = require('@putout/babel').types;
3
+ const {types} = require('@putout/babel');
4
+ const {isMemberExpression} = types;
4
5
 
5
6
  module.exports.Decorator = (path, {print, maybe}) => {
6
7
  const {expression} = path.node;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isTSModuleBlock,
5
6
  isBlockStatement,
6
7
  isExportNamedDeclaration,
7
- } = require('@putout/babel').types;
8
-
8
+ } = types;
9
9
  const {markAfter} = require('../../mark');
10
10
  const {isNext, isNextParent} = require('../../is');
11
11
  const {printParams} = require('./params');
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isLogicalExpression,
5
6
  isReturnStatement,
6
7
  isVariableDeclarator,
7
- } = require('@putout/babel').types;
8
+ } = types;
8
9
 
9
10
  module.exports.isRootOk = (path) => {
10
11
  return isReturnStatement(path) || isVariableDeclarator(path);
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isUnaryExpression,
5
6
  isArrowFunctionExpression,
6
7
  isIfStatement,
7
- } = require('@putout/babel').types;
8
-
8
+ } = types;
9
9
  const {chain} = require('./chain');
10
10
  const {satisfy} = require('../../is');
11
11
 
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
+ const {types} = require('@putout/babel');
3
4
  const {
4
5
  isIdentifier,
5
6
  isObjectPattern,
6
7
  isAssignmentPattern,
7
8
  isVariableDeclarator,
8
- } = require('@putout/babel').types;
9
-
9
+ } = types;
10
10
  const {wrongShorthand} = require('./wrong-shortand');
11
11
 
12
12
  const {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {isJSXElement} = require('@putout/babel').types;
4
-
3
+ const {types} = require('@putout/babel');
4
+ const {isJSXElement} = types;
5
5
  const isInsideArrow = ({parentPath}) => parentPath.isArrowFunctionExpression();
6
6
 
7
7
  module.exports.JSXElement = {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const rendy = require('rendy');
4
4
  const maybeSatisfy = require('./satisfy');
5
-
5
+ const {types} = require('@putout/babel');
6
6
  const {
7
7
  isProgram,
8
8
  isFile,
@@ -10,8 +10,7 @@ const {
10
10
  ExpressionStatement,
11
11
  Program,
12
12
  isStatement,
13
- } = require('@putout/babel').types;
14
-
13
+ } = types;
15
14
  const isFn = (a) => typeof a === 'function';
16
15
 
17
16
  module.exports.maybeThrow = (a, path, b) => {
@@ -8,6 +8,7 @@ const {
8
8
  satisfy,
9
9
  } = require('../../is');
10
10
 
11
+ const {types} = require('@putout/babel');
11
12
  const {
12
13
  isArrowFunctionExpression,
13
14
  isObjectMethod,
@@ -15,8 +16,7 @@ const {
15
16
  isExportDeclaration,
16
17
  isDoWhileStatement,
17
18
  isBlockStatement,
18
- } = require('@putout/babel').types;
19
-
19
+ } = types;
20
20
  const {markAfter} = require('../../mark');
21
21
  const {parseComments} = require('../../comment/comment');
22
22
  const {insideIfWithNoBody} = require('./inside-if-with-no-body');
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const {isExportNamespaceSpecifier} = require('@putout/babel').types;
3
+ const {types} = require('@putout/babel');
4
+ const {isExportNamespaceSpecifier} = types;
4
5
  const {markAfter, isMarkedAfter} = require('../../mark');
6
+
5
7
  const {
6
8
  isNewlineBetweenSiblings,
7
9
  exists,
@@ -119,4 +121,3 @@ module.exports.ExportNamedDeclaration = {
119
121
  markAfter(path);
120
122
  },
121
123
  };
122
-
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {isJSXElement} = require('@putout/babel').types;
4
-
3
+ const {types} = require('@putout/babel');
4
+ const {isJSXElement} = types;
5
5
  const {
6
6
  isPrevBody,
7
7
  noTrailingComment,
@@ -9,7 +9,8 @@ const {
9
9
  } = require('../../is');
10
10
 
11
11
  const {hasPrevNewline} = require('../../mark');
12
- const {isExportDeclaration} = require('@putout/babel').types;
12
+ const {types} = require('@putout/babel');
13
+ const {isExportDeclaration} = types;
13
14
  const {maybeSpaceAfterKeyword} = require('./maybe-space-after-keyword');
14
15
 
15
16
  const {isConcatenation} = require('../../expressions/binary-expression/concatenate');
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const {maybeParens} = require('../../maybe/maybe-parens');
4
+ const {types} = require('@putout/babel');
4
5
  const {
5
6
  isVariableDeclarator,
6
7
  isObjectExpression,
7
- } = require('@putout/babel').types;
8
+ } = types;
8
9
 
9
10
  module.exports.TSAsExpression = maybeParens((path, {print, maybe}) => {
10
11
  const is = isParens(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "11.10.0",
3
+ "version": "11.10.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
@@ -53,7 +53,7 @@
53
53
  "devDependencies": {
54
54
  "@putout/eslint": "^3.5.0",
55
55
  "@putout/plugin-minify": "^9.0.0",
56
- "@putout/plugin-printer": "^3.0.0",
56
+ "@putout/plugin-printer": "^4.0.0",
57
57
  "@putout/plugin-promises": "^16.0.0",
58
58
  "@putout/plugin-react-hook-form": "^4.0.0",
59
59
  "@putout/plugin-react-hooks": "^6.0.0",