Closed stradicat closed 5 years ago
This can be fixed by changing the web-beatutify-args variable to:
(defconst web-beautify-args '("-"))
The problem is with (js-beautify version 1.8.9) which is not respecting the contract.
js-beautify -f -
fails with error:
Unable to open path "$HOME/-"
Run `js-beautify -h` for help.
Instead js-beautify -
works fine.
This is a known issue, see beautify-web/js-beautify#1609
Confirmed, it works.
Just forked web-beautify
, removed the -f
from (defconst web-beautify-args '("-"))
in web-beautify.el
and made a pull request.
Have the same problem on Linux
Unable to open path "/home/wdemo/-"
Run `html-beautify -h` for help.
➜ node --version
v10.15.1
➜ npm --version
6.4.1
➜ js-beautify --version
1.8.9
web-beautify-html is an interactive autoloaded compiled Lisp function in ‘~/Config/.emacs.d/elpa/web-beautify-20161115.2247/web-beautify.el’.
(web-beautify-html)
Format region if active, otherwise the current buffer.
Formatting is done according to the html-beautify command.
Whenever I run
web-beautify-js
on a file, say/home/user/project/file.js
, I get the following error message:Why is a
-
replacing the actualfile.js
file name? It remember having usedweb-beautify-js
last year without problems.This happens at least in Emacs 26.1, both plain and with Spacemacs 0.200.13. Added
web-beautify
andjs2-mode
from MELPA, nothing else.(Currently using
js-beautify
version 1.8.9)