Skip to content

oxc-transform generates \n (new line) for each \r (carriage return) #13059

@hyrious

Description

@hyrious

Ideally it should just print \r or simply remove them, instead of generating 2 \n here.

import { isolatedDeclaration } from 'oxc-transform'

console.log([
	isolatedDeclaration('a.ts',
		// Simulates windows file line-ending.
		[
			'/**',
			' * Comment.',
			' */',
			'export const a: number = 1;'
		].join('\r\n')
	).code
])
// → [ '/**\n\n* Comment.\n\n*/\nexport declare const a: number;\n' ]

Metadata

Metadata

Assignees

Labels

A-codegenArea - Code GenerationC-bugCategory - Bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions