Skip to content

Commit 71fc338

Browse files
committed
fix: Fix the regex splitting input by line breaks
1 parent 731c8dc commit 71fc338

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function processFile (file) {
155155
const original = readFileSync(file, 'utf8')
156156
let source = processContents(original, file)
157157
if (options.inPlace) {
158-
const lines = original.split(/\?r\n/)
158+
const lines = original.split(/\r?\n/)
159159
const newLine = !lines[lines.length - 1]
160160
if (options.trailingNewline === true ||
161161
(options.trailingNewline !== false && newLine)) {

0 commit comments

Comments
 (0)