From 3e029fcde02a84c9d831acd8747691aaed083463 Mon Sep 17 00:00:00 2001 From: Jan Werkhoven Date: Fri, 27 Oct 2017 20:26:18 +1100 Subject: [PATCH] Fix ast.remove is not a function error This PR fixes an error that occurs when `"eof-newline": false,` as reported and solved here: https://github.com/Glavin001/atom-beautify/issues/1705 --- src/options/block-indent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options/block-indent.js b/src/options/block-indent.js index b5f473fb..245211e5 100644 --- a/src/options/block-indent.js +++ b/src/options/block-indent.js @@ -45,7 +45,7 @@ let option = { var spaces = whitespaceNode.content.replace(/\n[ \t]+/gm, '\n'); if (spaces === '') { - ast.remove(i); + ast.removeChild(i); } else { whitespaceNode.content = spaces; }