From 5372fdb7f6b18c032cfad1f73a83e0dd8629383e Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Thu, 5 Apr 2018 15:46:09 -0400 Subject: [PATCH] linebreak-style: handle explicit default Closes GH-176. Closes GH-175. --- packages/remark-lint-linebreak-style/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/remark-lint-linebreak-style/index.js b/packages/remark-lint-linebreak-style/index.js index f3f5c83f..7789c3cb 100644 --- a/packages/remark-lint-linebreak-style/index.js +++ b/packages/remark-lint-linebreak-style/index.js @@ -68,6 +68,8 @@ function linebreakStyle(ast, file, preferred) { var index = content.indexOf('\n'); var type; + preferred = typeof preferred !== 'string' || preferred === 'consistent' ? null : preferred; + while (index !== -1) { type = content.charAt(index - 1) === '\r' ? 'windows' : 'unix';