@putout/printer 17.0.1 → 17.0.3

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 (67) hide show
  1. package/ChangeLog +11 -0
  2. package/lib/tokenize/comment/parse-comments.js +1 -1
  3. package/lib/tokenize/comment/parse-leading-comments.js +1 -1
  4. package/lib/tokenize/comment/parse-trailing-comments.js +1 -1
  5. package/lib/tokenize/expressions/array-expression/indent.js +1 -1
  6. package/lib/tokenize/expressions/array-expression/is-object-after-simple.js +1 -1
  7. package/lib/tokenize/expressions/array-expression/newline.js +1 -1
  8. package/lib/tokenize/expressions/assignment-expression/assignment-expression.js +2 -2
  9. package/lib/tokenize/expressions/assignment-expression/maybe-parens-condition.js +1 -1
  10. package/lib/tokenize/expressions/binary-expression/binary-expression.js +1 -1
  11. package/lib/tokenize/expressions/call-expression/call-expression.js +2 -2
  12. package/lib/tokenize/expressions/class/class-property.js +1 -1
  13. package/lib/tokenize/expressions/class/class.js +1 -1
  14. package/lib/tokenize/expressions/conditional-expression.js +1 -1
  15. package/lib/tokenize/expressions/function/arrow-function-expression.js +2 -2
  16. package/lib/tokenize/expressions/function/class-method.js +1 -1
  17. package/lib/tokenize/expressions/function/function-declaration.js +1 -1
  18. package/lib/tokenize/expressions/function/function-expression.js +2 -2
  19. package/lib/tokenize/expressions/function/object-method.js +1 -1
  20. package/lib/tokenize/expressions/function/print-function-params.js +1 -1
  21. package/lib/tokenize/expressions/logical-expression/logical-expression.js +1 -1
  22. package/lib/tokenize/expressions/member-expression/chain.js +1 -1
  23. package/lib/tokenize/expressions/member-expression/is-looks-like-chain.js +1 -1
  24. package/lib/tokenize/expressions/member-expression/member-expressions.js +1 -1
  25. package/lib/tokenize/expressions/new-expression/new-expression.js +1 -1
  26. package/lib/tokenize/expressions/object-expression/object-expression.js +2 -2
  27. package/lib/tokenize/expressions/object-pattern/object-pattern.js +2 -2
  28. package/lib/tokenize/expressions/sequence-expression/sequence-expression.js +1 -1
  29. package/lib/tokenize/expressions/spread-element.js +1 -1
  30. package/lib/tokenize/expressions/unary-expression/unary-expressions.js +2 -2
  31. package/lib/tokenize/jsx/jsx-attribute.js +1 -1
  32. package/lib/tokenize/jsx/jsx-opening-element.js +1 -1
  33. package/lib/tokenize/literals/identifier.js +1 -1
  34. package/lib/tokenize/maybe/satisfy.js +1 -1
  35. package/lib/tokenize/statements/block-statement/block-statement.js +3 -3
  36. package/lib/tokenize/statements/block-statement/inside-if-with-no-body.js +1 -1
  37. package/lib/tokenize/statements/break-statement/break-statement.js +1 -1
  38. package/lib/tokenize/statements/continue-statement/continue-statement.js +1 -1
  39. package/lib/tokenize/statements/debugger-statement.js +1 -1
  40. package/lib/tokenize/statements/export-declaration/export-declaration.js +7 -7
  41. package/lib/tokenize/statements/export-declaration/export-default-declaration.js +1 -1
  42. package/lib/tokenize/statements/expression-statement/expression-statement.js +1 -1
  43. package/lib/tokenize/statements/for-of-statement/for-of-statement.js +5 -5
  44. package/lib/tokenize/statements/for-statement.js +1 -2
  45. package/lib/tokenize/statements/if-statement/if-statement.js +2 -2
  46. package/lib/tokenize/statements/import-declaration/import-declaration.js +3 -3
  47. package/lib/tokenize/statements/labeled-statement/labeled-statement.js +1 -1
  48. package/lib/tokenize/statements/program/program.js +1 -1
  49. package/lib/tokenize/statements/return-statement/return-statement.js +2 -2
  50. package/lib/tokenize/statements/try-statement/try-statements.js +1 -1
  51. package/lib/tokenize/statements/variable-declaration/variable-declaration.js +2 -2
  52. package/lib/tokenize/typescript/enum/ts-enum-declaration.js +1 -1
  53. package/lib/tokenize/typescript/function/ts-declare-function.js +1 -1
  54. package/lib/tokenize/typescript/function/ts-function-type.js +1 -1
  55. package/lib/tokenize/typescript/index.js +1 -5
  56. package/lib/tokenize/typescript/interface/ts-interface-declaration.js +1 -1
  57. package/lib/tokenize/typescript/ts-as-expression/ts-as-expression.js +1 -1
  58. package/lib/tokenize/typescript/ts-export-assignment/ts-export-assignment.js +1 -1
  59. package/lib/tokenize/typescript/ts-infer-type/ts-infer-type.js +1 -1
  60. package/lib/tokenize/typescript/ts-non-null-expression/ts-non-null-expression.js +6 -0
  61. package/lib/tokenize/typescript/ts-parameter-property/ts-parameter-property.js +1 -1
  62. package/lib/tokenize/typescript/ts-property-signature/ts-property-signature.js +2 -2
  63. package/lib/tokenize/typescript/ts-type-query/ts-type-query.js +1 -1
  64. package/lib/tokenize/typescript/ts-union-type/ts-union-type.js +1 -1
  65. package/lib/tokenize/typescript/type/ts-type-alias-declaration.js +1 -1
  66. package/lib/tokenize/typescript/type/ts-type-parameter.js +1 -1
  67. package/package.json +4 -1
package/ChangeLog CHANGED
@@ -1,3 +1,14 @@
1
+ 2026.01.17, v17.0.3
2
+
3
+ feature:
4
+ - 8bbeef9 @putout/printer: maybe-parens -> #maybe-parens
5
+ - c6d5b2d @putout/printer: TSNonNullExpression: improve support
6
+
7
+ 2026.01.11, v17.0.2
8
+
9
+ feature:
10
+ - 83bda2d apply private imports (https://github.com/coderaiser/putout/commit/b27db6567429e6c93207c23153a672b8aacdb8be)
11
+
1
12
  2026.01.11, v17.0.1
2
13
 
3
14
  fix:
@@ -1,4 +1,4 @@
1
- import {isNext} from '../is.js';
1
+ import {isNext} from '#is';
2
2
 
3
3
  export const parseComments = (path, {write, maybe}, semantics) => {
4
4
  if (!semantics.comments)
@@ -2,7 +2,7 @@ import {types} from '@putout/babel';
2
2
  import {
3
3
  hasTrailingComment,
4
4
  satisfy,
5
- } from '../is.js';
5
+ } from '#is';
6
6
  import {markBefore} from '../mark.js';
7
7
  import {maybeInsideFn} from './maybe-inside-fn.js';
8
8
  import {
@@ -3,7 +3,7 @@ import {
3
3
  isLast,
4
4
  isCoupleLines,
5
5
  isNext,
6
- } from '../is.js';
6
+ } from '#is';
7
7
  import {isLooksLikeChain} from '../expressions/member-expression/is-looks-like-chain.js';
8
8
  import {
9
9
  printTrailingComments,
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {isIndented} from '../../is.js';
2
+ import {isIndented} from '#is';
3
3
 
4
4
  const {
5
5
  isStringLiteral,
@@ -1,4 +1,4 @@
1
- import {isNextObject, isPrevObject} from '../../is.js';
1
+ import {isNextObject, isPrevObject} from '#is';
2
2
 
3
3
  const SIMPLE_TYPES = [
4
4
  'ArrayExpression',
@@ -8,7 +8,7 @@ import {
8
8
  isStringAndArray,
9
9
  isIdentifierAndIdentifier,
10
10
  isSimpleAndNotEmptyObject,
11
- } from '../../is.js';
11
+ } from '#is';
12
12
 
13
13
  const {
14
14
  isObjectExpression,
@@ -1,12 +1,12 @@
1
+ import {maybeParens} from '#maybe-parens';
1
2
  import {condition} from './maybe-parens-condition.js';
3
+ import {printSeparator} from './print-separator.js';
2
4
  import {
3
5
  printLeadingCommentLine,
4
6
  maybeInsideReturnWithCommentEnd,
5
7
  maybeInsideReturnWithCommentStart,
6
8
  printLeadingCommentBlock,
7
9
  } from './assignment-expression-comments.js';
8
- import {maybeParens} from '../../maybe/maybe-parens.js';
9
- import {printSeparator} from './print-separator.js';
10
10
 
11
11
  const isInsideBlock = ({parentPath}) => /BlockStatement|Program/.test(parentPath.type);
12
12
 
@@ -1,5 +1,5 @@
1
1
  import {hasLeadingComment} from '#is';
2
- import {isParens} from '../../maybe/maybe-parens.js';
2
+ import {isParens} from '#maybe-parens';
3
3
 
4
4
  export const condition = (path, printer, semantics) => {
5
5
  const {parentPath} = path;
@@ -1,9 +1,9 @@
1
+ import {maybeParens} from '#maybe-parens';
1
2
  import {
2
3
  concatenate,
3
4
  isConcatenation,
4
5
  } from './concatenate.js';
5
6
  import {maybeSpace} from './maybe-space.js';
6
- import {maybeParens} from '../../maybe/maybe-parens.js';
7
7
 
8
8
  export const BinaryExpression = maybeParens((path, {print, indent, maybe}) => {
9
9
  const {operator} = path.node;
@@ -1,5 +1,5 @@
1
- import {exists} from '../../is.js';
2
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {exists} from '#is';
2
+ import {maybeParens} from '#maybe-parens';
3
3
 
4
4
  const {isArray} = Array;
5
5
 
@@ -1,4 +1,4 @@
1
- import {exists} from '../../is.js';
1
+ import {exists} from '#is';
2
2
  import {maybePrintTypeAnnotation} from '../../maybe/maybe-type-annotation.js';
3
3
  import {maybeDecorators} from '../../maybe/maybe-decorators.js';
4
4
  import {printKey} from '../object-expression/print-key.js';
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {isNext} from '../../is.js';
2
+ import {isNext} from '#is';
3
3
  import {markAfter} from '../../mark.js';
4
4
  import {maybeDeclare} from '../../maybe/maybe-declare.js';
5
5
  import {parseComments} from '../../comment/comment.js';
@@ -1,4 +1,4 @@
1
- import {maybeParens} from '../maybe/maybe-parens.js';
1
+ import {maybeParens} from '#maybe-parens';
2
2
 
3
3
  export const ConditionalExpression = maybeParens((path, {print}) => {
4
4
  print('__test');
@@ -1,6 +1,6 @@
1
- import {exists} from '../../is.js';
1
+ import {exists} from '#is';
2
+ import {maybeParens} from '#maybe-parens';
2
3
  import {printParams} from './params.js';
3
- import {maybeParens} from '../../maybe/maybe-parens.js';
4
4
 
5
5
  export const ArrowFunctionExpression = maybeParens((path, printer, semantics) => {
6
6
  const {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isNext,
3
3
  hasTrailingComment,
4
- } from '../../is.js';
4
+ } from '#is';
5
5
  import {maybeDecorators} from '../../maybe/maybe-decorators.js';
6
6
  import {printKey} from '../object-expression/print-key.js';
7
7
  import {printKind} from './kind.js';
@@ -1,6 +1,6 @@
1
1
  import {types} from '@putout/babel';
2
+ import {isNext, isNextParent} from '#is';
2
3
  import {markAfter} from '../../mark.js';
3
- import {isNext, isNextParent} from '../../is.js';
4
4
  import {printParams} from './params.js';
5
5
 
6
6
  const not = (fn) => (...a) => !fn(...a);
@@ -1,6 +1,6 @@
1
- import {exists} from '../../is.js';
1
+ import {exists} from '#is';
2
+ import {maybeParens} from '#maybe-parens';
2
3
  import {printParams} from './params.js';
3
- import {maybeParens} from '../../maybe/maybe-parens.js';
4
4
 
5
5
  export const FunctionExpression = maybeParens((path, printer, semantics) => {
6
6
  const {
@@ -1,4 +1,4 @@
1
- import {isNewlineBetweenSiblings} from '../../is.js';
1
+ import {isNewlineBetweenSiblings} from '#is';
2
2
  import {printParams} from './params.js';
3
3
  import {printKey} from '../object-expression/print-key.js';
4
4
  import {printKind} from './kind.js';
@@ -1,5 +1,5 @@
1
+ import {hasLeadingComment} from '#is';
1
2
  import {printParams} from './params.js';
2
- import {hasLeadingComment} from '../../is.js';
3
3
 
4
4
  const isAllParamsHasLeadingComments = (path) => {
5
5
  const params = path.get('params');
@@ -1,4 +1,4 @@
1
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {maybeParens} from '#maybe-parens';
2
2
  import {chain, isRootOk} from './chain.js';
3
3
 
4
4
  export const LogicalExpression = maybeParens({
@@ -1,4 +1,4 @@
1
- import {hasTrailingComment} from '../../is.js';
1
+ import {hasTrailingComment} from '#is';
2
2
 
3
3
  const {assign} = Object;
4
4
 
@@ -1,6 +1,6 @@
1
1
  import {types} from '@putout/babel';
2
+ import {satisfy} from '#is';
2
3
  import {chain} from './chain.js';
3
- import {satisfy} from '../../is.js';
4
4
 
5
5
  const {
6
6
  isUnaryExpression,
@@ -1,6 +1,6 @@
1
1
  import {types} from '@putout/babel';
2
+ import {maybeParens} from '#maybe-parens';
2
3
  import {maybePrintComputed} from '../object-expression/maybe-print-computed.js';
3
- import {maybeParens} from '../../maybe/maybe-parens.js';
4
4
  import {isLooksLikeChain} from './is-looks-like-chain.js';
5
5
 
6
6
  const {
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {exists} from '../../is.js';
2
+ import {exists} from '#is';
3
3
  import {isMarkedAfter} from '../../mark.js';
4
4
 
5
5
  const {
@@ -1,5 +1,4 @@
1
1
  import {types} from '@putout/babel';
2
- import {parseComments} from '../../comment/comment.js';
3
2
  import {
4
3
  isCoupleLines,
5
4
  isForOf,
@@ -9,7 +8,8 @@ import {
9
8
  noLeadingComment,
10
9
  hasLeadingComment,
11
10
  exists,
12
- } from '../../is.js';
11
+ } from '#is';
12
+ import {parseComments} from '../../comment/comment.js';
13
13
  import {isInsideTuple} from './is-inside-tuple.js';
14
14
  import {isLooksLikeChain} from '../member-expression/is-looks-like-chain.js';
15
15
  import {isThirdObjectInsideArray} from './is-third-object-inside-array.js';
@@ -1,10 +1,10 @@
1
1
  import {types} from '@putout/babel';
2
- import {wrongShorthand} from './wrong-shorthand.js';
3
2
  import {
4
3
  isForOf,
5
4
  isCoupleLines,
6
5
  exists,
7
- } from '../../is.js';
6
+ } from '#is';
7
+ import {wrongShorthand} from './wrong-shorthand.js';
8
8
  import {moreThenMaxPropertiesInOneLine} from './more-then-max-properties-in-one-line.js';
9
9
  import {maybeTypeAnnotation} from '../../maybe/maybe-type-annotation.js';
10
10
  import {moreThenMaxPropertiesLengthInOneLine} from './more-then-max-properties-length-in-one-line.js';
@@ -1,5 +1,5 @@
1
1
  import {hasLeadingComment} from '#is';
2
- import {maybeParens} from '../../maybe/maybe-parens.js';
2
+ import {maybeParens} from '#maybe-parens';
3
3
  import {condition} from './maybe-write-brace.js';
4
4
  import {
5
5
  maybePrintComments,
@@ -1,4 +1,4 @@
1
- import {hasTrailingComment} from '../is.js';
1
+ import {hasTrailingComment} from '#is';
2
2
 
3
3
  export const SpreadElement = (path, printer) => {
4
4
  const {print} = printer;
@@ -1,5 +1,5 @@
1
- import {isLast, isNext} from '../../is.js';
2
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {isLast, isNext} from '#is';
2
+ import {maybeParens} from '#maybe-parens';
3
3
 
4
4
  const isWord = (a) => /^(delete|typeof|void|throw)$/.test(a);
5
5
 
@@ -1,4 +1,4 @@
1
- import {isCoupleLines} from '../is.js';
1
+ import {isCoupleLines} from '#is';
2
2
 
3
3
  export const JSXAttribute = {
4
4
  condition(path) {
@@ -1,4 +1,4 @@
1
- import {isCoupleLines} from '../is.js';
1
+ import {isCoupleLines} from '#is';
2
2
 
3
3
  const isNotJSX = ({parentPath}) => {
4
4
  const grandPath = parentPath.parentPath;
@@ -1,5 +1,5 @@
1
+ import {maybeParens} from '#maybe-parens';
1
2
  import {maybeDecorators} from '../maybe-get.js';
2
- import {maybeParens} from '../maybe/maybe-parens.js';
3
3
  import {maybeTypeAnnotation} from '../maybe/maybe-type-annotation.js';
4
4
 
5
5
  export const Identifier = maybeParens(maybeTypeAnnotation((path, printer) => {
@@ -1,4 +1,4 @@
1
- import {satisfy} from '../is.js';
1
+ import {satisfy} from '#is';
2
2
 
3
3
  export default (plugin) => {
4
4
  if (!plugin.afterSatisfy && !plugin.beforeSatisfy && !plugin.satisfy)
@@ -1,13 +1,13 @@
1
1
  import {types} from '@putout/babel';
2
- import {markAfter} from '../../mark.js';
3
- import {parseComments} from '../../comment/comment.js';
4
2
  import {
5
3
  isNext,
6
4
  isParentProgram,
7
5
  isLast,
8
6
  exists,
9
7
  satisfy,
10
- } from '../../is.js';
8
+ } from '#is';
9
+ import {markAfter} from '../../mark.js';
10
+ import {parseComments} from '../../comment/comment.js';
11
11
  import {insideIfWithNoBody} from './inside-if-with-no-body.js';
12
12
  import {getDirectives} from './get-directives.js';
13
13
  import {isCallInsideChain} from './is-call-inside-chain.js';
@@ -1,4 +1,4 @@
1
- import {exists} from '../../is.js';
1
+ import {exists} from '#is';
2
2
 
3
3
  export const insideIfWithNoBody = (path) => {
4
4
  if (!path.parentPath.isIfStatement())
@@ -3,7 +3,7 @@ import {
3
3
  isNextParent,
4
4
  isInsideIf,
5
5
  isInsideLabel,
6
- } from '../../is.js';
6
+ } from '#is';
7
7
 
8
8
  const isInsideCase = (path) => path.parentPath.isSwitchCase();
9
9
 
@@ -1,4 +1,4 @@
1
- import {isInsideLabel} from '../../is.js';
1
+ import {isInsideLabel} from '#is';
2
2
 
3
3
  export const ContinueStatement = (path, {print, maybe, write}) => {
4
4
  const {label} = path.node;
@@ -1,4 +1,4 @@
1
- import {isNext, isInsideIf} from '../is.js';
1
+ import {isNext, isInsideIf} from '#is';
2
2
 
3
3
  const isInsideBlock = (path) => path.parentPath.isBlockStatement();
4
4
 
@@ -1,16 +1,16 @@
1
1
  import {types} from '@putout/babel';
2
- import {isParentBlock} from '#is';
3
- import {
4
- markAfter,
5
- isMarkedAfter,
6
- hasPrevNewline,
7
- } from '../../mark.js';
8
2
  import {
3
+ isParentBlock,
9
4
  isNewlineBetweenSiblings,
10
5
  exists,
11
6
  isNext,
12
7
  isLast,
13
- } from '../../is.js';
8
+ } from '#is';
9
+ import {
10
+ markAfter,
11
+ isMarkedAfter,
12
+ hasPrevNewline,
13
+ } from '../../mark.js';
14
14
 
15
15
  const {
16
16
  isExportNamespaceSpecifier,
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {isNext} from '../../is.js';
2
+ import {isNext} from '#is';
3
3
 
4
4
  const {
5
5
  isVariableDeclaration,
@@ -10,7 +10,7 @@ import {
10
10
  hasTrailingComment,
11
11
  isCoupleLines,
12
12
  isInsideLabel,
13
- } from '../../is.js';
13
+ } from '#is';
14
14
  import {isInsideAssignNextAssignFunction} from './is-inside-assign-next-assign-function.js';
15
15
  import {
16
16
  printLeadingCommentLine,
@@ -1,14 +1,14 @@
1
+ import {
2
+ isFirst,
3
+ isNext,
4
+ isLast,
5
+ } from '#is';
1
6
  import {
2
7
  hasPrevNewline,
3
8
  markAfter,
4
9
  markBefore,
5
10
  isMarkedAfter,
6
11
  } from '../../mark.js';
7
- import {
8
- isFirst,
9
- isNext,
10
- isLast,
11
- } from '../../is.js';
12
12
 
13
13
  export const ForOfStatement = {
14
14
  beforeIf(path) {
@@ -1,5 +1,4 @@
1
- import {isInsideLabel} from '#is';
2
- import {exists} from '../is.js';
1
+ import {isInsideLabel, exists} from '#is';
3
2
  import {markAfter} from '../mark.js';
4
3
 
5
4
  export const ForStatement = {
@@ -1,10 +1,10 @@
1
1
  import {types} from '@putout/babel';
2
- import {markAfter} from '../../mark.js';
3
2
  import {
4
3
  exists,
5
4
  isNext,
6
5
  isInsideIf,
7
- } from '../../is.js';
6
+ } from '#is';
7
+ import {markAfter} from '../../mark.js';
8
8
 
9
9
  const {
10
10
  isBlockStatement,
@@ -1,14 +1,14 @@
1
1
  import {parseImportSpecifiers} from 'parse-import-specifiers';
2
+ import {isLast, isNext} from '#is';
2
3
  import {markAfter} from '../../mark.js';
3
- import {isLast, isNext} from '../../is.js';
4
4
  import {printAttributes} from './import-attribute.js';
5
-
6
- export {ImportAttribute} from './import-attribute.js';
7
5
  import {
8
6
  printTrailingCommentBlock,
9
7
  printTrailingCommentLine,
10
8
  } from './import-declaration-comments.js';
11
9
 
10
+ export {ImportAttribute} from './import-attribute.js';
11
+
12
12
  export const ImportDeclaration = {
13
13
  print(path, printer, semantics) {
14
14
  const {
@@ -1,4 +1,4 @@
1
- import {isInsideLabel} from '../../is.js';
1
+ import {isInsideLabel} from '#is';
2
2
 
3
3
  export const LabeledStatement = (path, {print, maybe}) => {
4
4
  maybe.indent(!isInsideLabel(path));
@@ -1,6 +1,6 @@
1
+ import {hasCoupleTrailingComments} from '#is';
1
2
  import {parseComments} from '../../comment/comment.js';
2
3
  import {getDirectives} from '../block-statement/get-directives.js';
3
- import {hasCoupleTrailingComments} from '../../is.js';
4
4
 
5
5
  export const Program = (path, printer, semantics) => {
6
6
  const {body} = path.node;
@@ -1,10 +1,10 @@
1
1
  import {types} from '@putout/babel';
2
- import {isInsideLabel} from '#is';
3
2
  import {
3
+ isInsideLabel,
4
4
  isPrevBody,
5
5
  noTrailingComment,
6
6
  isLast,
7
- } from '../../is.js';
7
+ } from '#is';
8
8
  import {hasPrevNewline} from '../../mark.js';
9
9
  import {maybeSpaceAfterKeyword} from './maybe-space-after-keyword.js';
10
10
 
@@ -1,4 +1,4 @@
1
- import {isNext} from '../../is.js';
1
+ import {isNext} from '#is';
2
2
 
3
3
  export const TryStatement = {
4
4
  print(path, {print}) {
@@ -1,12 +1,12 @@
1
1
  import {types} from '@putout/babel';
2
- import {hasPrevNewline} from '../../mark.js';
3
2
  import {
4
3
  isNext,
5
4
  isCoupleLines,
6
5
  isNewlineBetweenSiblings,
7
6
  exists,
8
7
  noTrailingComment,
9
- } from '../../is.js';
8
+ } from '#is';
9
+ import {hasPrevNewline} from '../../mark.js';
10
10
  import {maybeSpaceAfterKeyword} from './maybe-space-after-keyword.js';
11
11
  import {isConcatenation} from '../../expressions/binary-expression/concatenate.js';
12
12
  import {parseLeadingComments} from '../../comment/comment.js';
@@ -2,7 +2,7 @@ import {
2
2
  isNext,
3
3
  isNextParent,
4
4
  isLast,
5
- } from '../../is.js';
5
+ } from '#is';
6
6
  import {markAfter} from '../../mark.js';
7
7
 
8
8
  export const TSEnumDeclaration = {
@@ -1,5 +1,5 @@
1
+ import {isNext} from '#is';
1
2
  import {printParams} from '../../expressions/function/params.js';
2
- import {isNext} from '../../is.js';
3
3
  import {maybeDeclare} from '../../maybe/maybe-declare.js';
4
4
 
5
5
  const isInsideDefaultExport = (path) => {
@@ -1,6 +1,6 @@
1
+ import {maybeParens} from '#maybe-parens';
1
2
  import {printParams} from '../../expressions/function/params.js';
2
3
  import {printReturnType} from './print-return-type.js';
3
- import {maybeParens} from '../../maybe/maybe-parens.js';
4
4
 
5
5
  export const TSFunctionType = maybeParens((path, printer, semantics) => {
6
6
  const {print} = printer;
@@ -2,6 +2,7 @@ import {isNext} from '#is';
2
2
  import {printParams} from '../expressions/function/params.js';
3
3
  import {maybePrintTypeAnnotation} from '../maybe/maybe-type-annotation.js';
4
4
 
5
+ export {TSNonNullExpression} from './ts-non-null-expression/ts-non-null-expression.js';
5
6
  export {TSTypeLiteral} from './type/ts-type-literal.js';
6
7
  export {TSTypeAliasDeclaration} from './type/ts-type-alias-declaration.js';
7
8
  export {TSMappedType} from './mapped-type/ts-mapped-type.js';
@@ -150,11 +151,6 @@ export const TSTypePredicate = (path, {print}) => {
150
151
  print('__typeAnnotation');
151
152
  };
152
153
 
153
- export const TSNonNullExpression = (path, {print}) => {
154
- print('__expression');
155
- print('!');
156
- };
157
-
158
154
  export const TSImportEqualsDeclaration = (path, {print, maybe}) => {
159
155
  maybe.print(path.node.isExport, 'export ');
160
156
  print('import ');
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {isNext, isNextParent} from '../../is.js';
2
+ import {isNext, isNextParent} from '#is';
3
3
  import {maybeDeclare} from '../../maybe/maybe-declare.js';
4
4
  import {markAfter} from '../../mark.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import {types} from '@putout/babel';
2
- import {maybeParens} from '../../maybe/maybe-parens.js';
2
+ import {maybeParens} from '#maybe-parens';
3
3
 
4
4
  const {
5
5
  isVariableDeclarator,
@@ -1,4 +1,4 @@
1
- import {isNext} from '../../is.js';
1
+ import {isNext} from '#is';
2
2
 
3
3
  export const TSExportAssignment = {
4
4
  print: (path, {print}) => {
@@ -1,4 +1,4 @@
1
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {maybeParens} from '#maybe-parens';
2
2
 
3
3
  export const TSInferType = maybeParens((path, {print}) => {
4
4
  print('infer ');
@@ -0,0 +1,6 @@
1
+ import {maybeParens} from '#maybe-parens';
2
+
3
+ export const TSNonNullExpression = maybeParens((path, {print}) => {
4
+ print('__expression');
5
+ print('!');
6
+ });
@@ -1,4 +1,4 @@
1
- import {hasLeadingComment} from '../../is.js';
1
+ import {hasLeadingComment} from '#is';
2
2
 
3
3
  export const TSParameterProperty = (path, {print, maybe, indent}) => {
4
4
  const {
@@ -1,8 +1,8 @@
1
- import {maybePrintTypeAnnotation} from '../../maybe/maybe-type-annotation.js';
2
1
  import {
3
2
  hasTrailingComment,
4
3
  isNext,
5
- } from '../../is.js';
4
+ } from '#is';
5
+ import {maybePrintTypeAnnotation} from '../../maybe/maybe-type-annotation.js';
6
6
  import {printKey} from '../../expressions/object-expression/print-key.js';
7
7
  import {
8
8
  printLeadingCommentLine,
@@ -1,4 +1,4 @@
1
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {maybeParens} from '#maybe-parens';
2
2
 
3
3
  export const TSTypeQuery = maybeParens((path, {print}) => {
4
4
  print('typeof ');
@@ -1,4 +1,4 @@
1
- import {maybeParens} from '../../maybe/maybe-parens.js';
1
+ import {maybeParens} from '#maybe-parens';
2
2
 
3
3
  const insideTypeDeclaration = ({parentPath}) => parentPath.isTSTypeAliasDeclaration();
4
4
 
@@ -2,7 +2,7 @@ import {
2
2
  isLast,
3
3
  isNext,
4
4
  isNextParent,
5
- } from '../../is.js';
5
+ } from '#is';
6
6
  import {markAfter} from '../../mark.js';
7
7
  import {maybeDeclare} from '../../maybe/maybe-declare.js';
8
8
 
@@ -1,4 +1,4 @@
1
- import {exists} from '../../is.js';
1
+ import {exists} from '#is';
2
2
 
3
3
  export const TSTypeParameter = (path, {write, traverse}) => {
4
4
  const constraint = path.get('constraint');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "17.0.1",
3
+ "version": "17.0.3",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
@@ -66,6 +66,9 @@
66
66
  },
67
67
  "#is": {
68
68
  "default": "./lib/tokenize/is.js"
69
+ },
70
+ "#maybe-parens": {
71
+ "default": "./lib/tokenize/maybe/maybe-parens.js"
69
72
  }
70
73
  },
71
74
  "devDependencies": {