A JavaScript beautifier that reformats and reindents bookmarklets, poorly-written JavaScript, unpack scripts packed by Dean Edward’s popular packer, as well as deobfuscate scripts processed by javascriptobfuscator.com.
Questions tagged [js-beautify]
97 questions
14
votes
1 answer
how to configure jsbeautifier settings to actually beautify my HTML/Javascript code
I have seen several questions about how to format HTML and javascript code. A common answer seems to be that jsbeautify (and GitHub page for jsbeautify.js) is a good solution.
However, I can't seem to get it to properly format any of my code, and…

Michael
- 9,060
- 14
- 61
- 123
12
votes
2 answers
How to force closing HTML tags on a new line?
In VS Code, I use Beautify extensively. But it unnerves me that closing tags always wrap on the same line as "floating" text, or self-closing tags. For instance, before Beautify :

LeKevoid
- 426
- 6
- 19
10
votes
2 answers
ESLint : Fast way to solve "Irregular whitespace not allowed"
I'm trying to use ESLint to enforce a coding style on a project, and I have many Irregular whitespace not allowed errors caused by code like this :
var a = b || 10; //note the 2 spaces between || and 10
if (a === 10) { // again, 2 spaces between…

IggY
- 3,005
- 4
- 29
- 54
9
votes
1 answer
Vscode with beautify does not indent django html templates
I am looking to format my django templates in the same manner as HTML.
Beautify ends up treating my templates like text, and not indenting their contents.
For example, after formatting my code looks like this:
{% if title %}
Django…

Peter S
- 827
- 1
- 8
- 24
9
votes
1 answer
js-beautify indentation of case labels
js-beautify, when used from the command line (latest version, on both Windows and Linux) indents case labels, leading to double indentation of case blocks. I posted this as an issue on github:
https://github.com/einars/js-beautify/issues/367
in…

rwallace
- 31,405
- 40
- 123
- 242
8
votes
2 answers
`no such file or directory` While installing js beautify in npm
I get this error when i use npm -g install js-beautify
npm ERR! path /home/developer/software/nodejs/lib/node_modules/js-
beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such…

Ragas
- 3,005
- 6
- 25
- 42
8
votes
1 answer
How To Set Atom-Beautify Wrap HTML Attribute
I use atom-beautify to format html,but it allways put all the attributes in one line. How can I set atom-beautify to keep attributes in different lines.
…

Patato
- 1,464
- 10
- 12
8
votes
2 answers
JsFormat rule for newline in es6 imports
JsFormat for Sublime Text 3 conforms to most ES6 standards, however, when auto-formatting import statements, it adds a new line to object imports. Here is what the pre-formatted line looks like:
import {func1, func2, func3} from 'some-module';
When…

ZekeDroid
- 7,089
- 5
- 33
- 59
6
votes
0 answers
Adjusting Atom-Beautify/JS-Beautify for Laravel Blade
I like to customize JS-Beautify in Atom to better format my blade files.
Our manual style looks like this:
{{--
Template Name: Full Width Template
--}}
@extends('layouts.app')
@section('content')
…

Slam
- 3,125
- 1
- 15
- 24
6
votes
1 answer
npm install is not working | npm ERR! path | npm ERR! code | npm ERR! errno | npm ERR! syscall | npm ERR! enoent
I've been using the vue-cli for two weeks and everything had been working fine until today. I was setting up this project locally.
https://drive.google.com/open?id=0BwGw1zyyKjW7S3RYWXRaX24tQ3c
When entered npm install the following errors…

Daniel Sarmiento
- 63
- 1
- 1
- 4
6
votes
3 answers
How to write file to html with beauty?
I would like to write to the test.html file this html:
AwesomeComis awesome
Which will be lokk like:…

kodaek98
- 453
- 1
- 5
- 17
5
votes
0 answers
Beautify in VS Code: Is there a way to use single-line formatting for styles with one property, but multi-line for styles with multiple properties?
I use Beautify obsessively to keep my CSS nice and clean.
However, I wish I could have it use single-line formatting for single-property styles, and multi-line formatting for multi-property styles.
One Property:
❌ What it gives me:
#slidebox {
…

BevansDesign
- 4,908
- 1
- 12
- 14
5
votes
2 answers
VSCode: How to make Beautify and Emmet run on .tpl files (Smarty)?
I'm working on an old project on VSCode, and I found out that the html formatter and emmet syntax isn't working for .tpl (Smarty templating engine) files.
It's inconveniencing my workflow, and unfortunately I don't see any extensions in the…

Abana Clara
- 4,602
- 3
- 18
- 31
5
votes
0 answers
js-beautify config for Arrays of Objects
Is there any way to configure js-beautify to keep the following format:
"structure": [
{
"name": "heading",
"text": "",
"default": "",
"type": "string"
},
{
"name": "flickr-album-id",
"text": "",
"type": "string"
…

Lukas E.
- 139
- 1
- 10
5
votes
1 answer
HTML Beautify Settings in Brackets
I understand that the Brackets Beautify extension is based on JS Beautify, and that I have a suite of preference settings available because of that, but I have no idea of how to alter them through the Brackets settings.json file. Does anyone have…

TheComte
- 133
- 1
- 1
- 6