Skip to content

Commit 7423806

Browse files
committed
fix: Fix the regex splitting input by line breaks
1 parent 7eebd76 commit 7423806

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
@@ -205,7 +205,7 @@ function processFile (file) {
205205
const original = readFileSync(file, 'utf8')
206206
let source = processContents(original, file)
207207
if (options.inPlace) {
208-
const lines = original.split(/\?r\n/)
208+
const lines = original.split(/\r?\n/)
209209
const newLine = !lines[lines.length - 1]
210210
if (options.trailingNewline === true ||
211211
(options.trailingNewline !== false && newLine)) {

0 commit comments

Comments
 (0)