Skip to content

Commit

Permalink
chore: @putout/printer: v5.37.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Oct 24, 2023
1 parent f01afa3 commit 0e3d85d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2023.10.24, v5.37.0

feature:
- f01afa3 @putout/printer: TSInterfaceBody: simplify

2023.10.24, v5.36.0

feature:
Expand Down
7 changes: 2 additions & 5 deletions lib/tokenize/comment/parse-leading-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ const {types} = require('@putout/babel');
const {
hasTrailingComment,
satisfy,
isNext,
isPrev,

} = require('../is');

const {markBefore} = require('../mark');
const {maybeInsideFn} = require('./maybe-inside-fn');

const {
isTSModuleDeclaration,
isTSInterfaceDeclaration,
isObjectProperty,
isVariableDeclarator,
isClassProperty,
Expand Down Expand Up @@ -68,8 +64,9 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics)
if (type === 'CommentBlock') {
const looksLikeMethod = path.isClassMethod();
const looksLikeDirective = path.isDirective();
const looksLikeProp = path.isObjectProperty();// || path.isTSPropertySignature();
const looksLikeProp = path.isObjectProperty();

// || path.isTSPropertySignature();
if (looksLikeProp)
print.breakline();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {isNext, isNextParent} = require('../../is');
const {maybeDeclare} = require('../../maybe/maybe-declare');

module.exports.TSInterfaceDeclaration = {
print: maybeDeclare((path, {print, indent, maybe}) => {
print: maybeDeclare((path, {print, maybe}) => {
const {node, parentPath} = path;

maybe.indent(!isExportDeclaration(parentPath));
Expand All @@ -36,4 +36,3 @@ module.exports.TSInterfaceDeclaration = {
print.breakline();
},
};

9 changes: 3 additions & 6 deletions lib/tokenize/typescript/ts-property-signature.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
'use strict';

const {maybePrintTypeAnnotation} = require('../maybe/maybe-type-annotation');

const {
maybeTypeAnnotation,
maybePrintTypeAnnotation,
} = require('../maybe/maybe-type-annotation');
const {
hasLeadingComment,
hasTrailingComment,
isNext,
} = require('../is');
Expand All @@ -16,6 +13,7 @@ module.exports.TSPropertySignature = (path, printer) => {
maybe,
write,
} = printer;

const {optional, readonly} = path.node;

maybe.print(readonly, 'readonly ');
Expand All @@ -32,4 +30,3 @@ module.exports.TSPropertySignature = (path, printer) => {
if (isNext(path) && hasTrailingComment(path))
write.newline();
};

4 changes: 1 addition & 3 deletions lib/tokenize/typescript/type/ts-type-literal.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

const {isNext} = require('../../is');

module.exports.TSTypeLiteral = (path, {indent, traverse, write, maybe}) => {
module.exports.TSTypeLiteral = (path, {indent, traverse, write}) => {
const members = path.get('members');
write('{');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@putout/printer",
"version": "5.36.0",
"version": "5.37.0",
"type": "commonjs",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
"description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
Expand Down

0 comments on commit 0e3d85d

Please sign in to comment.