csscomb / csscomb.js

CSS coding style formatter
http://csscomb.com/
MIT License
3.28k stars 459 forks source link

"eof-newline": false causes UnhandledPromiseRejectionWarning #575

Closed userabuser closed 5 years ago

userabuser commented 6 years ago

When eof-newline is set to false in config, I receive UnhandledPromiseRejectionWarning.

(node:7393) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: ast.remove is not a function
(node:7393) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

When set to true in config, no exception.

When omitted from the config, no exception.

Config example:

{
    "remove-empty-rulesets": true,
    "always-semicolon": true,
    "color-case": "lower",
    "block-indent": "    ",
    "color-shorthand": false,
    "element-case": "lower",
    "eof-newline": false,
    "leading-zero": true,
    "quotes": "double",
    "sort-order-fallback": "abc",
    "space-after-colon": " ",
    "space-before-combinator": " ",
    "space-after-combinator": " ",
    "space-between-declarations": "\n",
    "space-before-opening-brace": " ",
    "space-after-opening-brace": "\n",
    "space-after-selector-delimiter": "\n",
    "space-before-selector-delimiter": "",
    "space-before-closing-brace": "\n",
    "strip-spaces": true,
    "tab-size": true,
    "unitless-zero": true,
    "vendor-prefix-align": true
}

I have tried various config arrangements, various target files with and without complex rule-sets and the problem persists.

Node: v7.10.1 OS: Windows 10 File: *.scss Compile method: CLI

I have not tried this on OSX yet nor specifically dug through the source to determine the absolute problem.

Related:

501

502

ryanaltvater commented 6 years ago

Any update(s)? I am also experiencing this on Windows 10. I have not experienced this on macOS, which I also use.

Node: 10.4.1 OS: Windows 10 (April Update) File: .html or .scss Compile method: Keyboard shortcut

jirsbek commented 5 years ago

I've got the same problem. The reason I've got eof-newline set to false is .editorconfig handles the newlines for me and also when cssbomb's newline is added caret is moved to the ending new line which is pretty annoying (using latest Atom a plugin csscomb-atom).

jdalton commented 5 years ago

Fixed by #552.