@putout/printer
Advanced tools
Comparing version 1.14.0 to 1.14.1
'use strict'; | ||
const {isFirst} = require('./is'); | ||
const {markBefore} = require('./mark'); | ||
const { | ||
isFirst, | ||
isNext, | ||
} = require('./is'); | ||
const { | ||
markBefore, | ||
hasPrevNewline, | ||
} = require('./mark'); | ||
@@ -44,2 +50,5 @@ module.exports.parseLeadingComments = (path, {print, indent}) => { | ||
if (isNext(path)) | ||
return; | ||
for (const {type, value} of trailingComments) { | ||
@@ -56,3 +65,3 @@ if (type === 'CommentLine') { | ||
function shouldAddNewlineBefore(path) { | ||
return path.isStatement() && !isFirst(path); | ||
return path.isStatement() && !isFirst(path) && !hasPrevNewline(path); | ||
} |
@@ -54,2 +54,7 @@ 'use strict'; | ||
module.exports.ObjectMethod = (path, {print}) => { | ||
const {kind} = path.node; | ||
if (kind !== 'method') | ||
print(`${kind} `); | ||
print('__key'); | ||
@@ -56,0 +61,0 @@ print('('); |
'use strict'; | ||
const {isCoupleLines} = require('../is'); | ||
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node; | ||
@@ -93,2 +92,1 @@ const isLogical = (path) => path.get('argument').isLogicalExpression(); | ||
} | ||
@@ -47,2 +47,3 @@ 'use strict'; | ||
), ' '); | ||
print('__argument'); | ||
@@ -49,0 +50,0 @@ |
{ | ||
"name": "@putout/printer", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
@@ -28,3 +28,2 @@ # Printer [![NPM version][NPMIMGURL]][NPMURL] | ||
// returns | ||
// returns | ||
` | ||
@@ -36,3 +35,2 @@ const a = (b, c) => { | ||
`; | ||
``` | ||
@@ -68,5 +66,3 @@ | ||
// returns | ||
// returns | ||
'const {a /* [hello world] */= 5} = b;\n'; | ||
``` | ||
@@ -73,0 +69,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56963
1638
70