Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:00
    bobtiki starred beautify-web/js-beautify
  • Jan 31 2019 18:35
    Nico-Duduf starred beautify-web/js-beautify
  • Jan 31 2019 17:02
    bitwiseman commented #1625
  • Jan 31 2019 13:45
  • Jan 31 2019 13:02
    oleedd commented #1625
  • Jan 31 2019 12:50
  • Jan 31 2019 11:26
    bitwiseman unlabeled #1625
  • Jan 31 2019 11:26
    bitwiseman labeled #1625
  • Jan 31 2019 10:55
    bitwiseman closed #1625
  • Jan 31 2019 10:55
    bitwiseman commented #1625
  • Jan 31 2019 09:49
    oleedd commented #1625
  • Jan 31 2019 08:55
    bitwiseman commented #1625
  • Jan 31 2019 08:54
    bitwiseman labeled #1625
  • Jan 31 2019 02:22
    lettenj61 starred beautify-web/js-beautify
  • Jan 30 2019 19:48
    oleedd opened #1625
  • Jan 30 2019 17:08
  • Jan 30 2019 16:06
    bitwiseman commented #1532
  • Jan 30 2019 11:28
    bitwiseman commented #1623
  • Jan 30 2019 11:16

    bitwiseman on v1.9.0-beta5

    (compare)

  • Jan 30 2019 11:16

    bitwiseman on release

    correctly indenting handlebars/… added test for indenting handle… comment referring to issue whic… and 13 more (compare)

Liam Newman
@bitwiseman
@rowild There are issues filed around eslint (including a blanket request to support an “eslint" setting), but I haven’t had time to work on them. What is eslint’s complaiint for what you showed above?
Robert Wildling
@rowild

@bitwiseman It’s about the indent: eslint want 4, jsbeautify creates 6.

But I actually decided to use only eslint for JS formatting now. Hope you don’t mind! I way always of the opinion that both, eslint AND jsbeautify have to be used alongside, but it turns out, that I was wrong. So I will continue using jsbeautiy for CSS and HTML, and eslint for JS only. That seems to work just fine. I hope this is ok with you! :-)

Thank you very much for your help!

Liam Newman
@bitwiseman
Cool. Glad you figured out a use that works for you.
notcool
@__notcool_twitter

Hi I'm tryout the cli js-beautify to format html contents

Indent with Tabs, Tabsize - 2 How can i set ?

--indent-size 2 is overriding if i pass --indent-with-tabs

js-beautify --indent-with-tabs --indent-size 2 -r sample.html
Liam Newman
@bitwiseman
What version are you using?
aswinkumar863
@aswinkumar863

Hi, I'm using js-beautify to format Smarty template files in vscode extension.

The syntax is similar to handlebars, but only single braces. I'm facing some issue like aswinkumar863/smarty-vscode-support#9 in formatting.

My question is that, is there any way to add/modify directive. So that the formatter ignores the smarty tags.

This is not a feature request, necessarily, I'm happy to fork the repo, but any help would be hugely appreciated. Thank you.

Liam Newman
@bitwiseman
Ah, and now I see your question here. :| Sorry for missing it before
Mayank Shouche
@mayankshouche
Hello! I opened a PR as a fix to #1801 and I'm having some trouble with the Azure build pipeline. Running 'make ci' locally doesn't result in any errors, but on Azure, (specifically on the Linux with Python builds) I'm getting a fail on the git status check that shows the one line I added as a diff. Any help with resolving this would be appreciated! Here is the build results as reference.
Liam Newman
@bitwiseman
@mayankshouche Sorry, I didn’t see this before. Did you get this figured out?
Mayank Shouche
@mayankshouche
@bitwiseman no worries! the PR was for a duped issue anyway, so it's closed. I'll definitely try and get it figured out if it happens again
AsaGohann
@AsaGohann

Hi! Can I format this

if(a ==1) {} else{return a++;}

into

if(a==1) {
} else {
    return a++;
}

I got this in the web

if (a == 1) {} else {
    return a++;
}

the first {} is not my expect

Liam Newman
@bitwiseman
@AsaGohann empty braces always collapse currently.
aswinkumar863
@aswinkumar863
@bitwiseman I have added smarty to templating options, as you guided beautify-web/js-beautify#1820 and aswinkumar863/smarty-vscode-support#84. Thank you for your kind guidance. Unfortunately, I am having 3 failed test cases, where indent_handlebars = "true" if I am not wrong handlebars gets conflicted with smarty because of { brace. Any help would be hugely appreciated. Thank you.
Robert Wildling
@rowild
Hi! I am looking for an option to ignore html code formating in certain sections of a template engine called “Fluid” (<f:if …></f:if>). Tried the “unformatted_content_delimiter”, but that does not work (or I did not understand its usage, the documentation is not very good in that aspect). Is there anything html-comment like? E.g. “<!— beautify:ignore-start —> … <!— beautify:ignore-end —>”? I am aware that i am not the frst one to ask this, but I do not find any infomration about that or any other way. Which is a bit strange, because there are many template engines out there – how are they handled, i wonder?

In VSCode, I also tried to set the gnore paths:

  "beautify.ignore": [
    "./public/typo3conf/ext/theme/Resources/Private/**/*.*"
  ],

but the setting is not recognised. Am i using the glob pattern in a wrong way?

JuanFML
@JuanFML
Hi everyone! I am new here and I am taking on a good first issue, but I am struggling while building and running tests, when I try to run make js it tells me it can't find the file js-beautify/build, can anyone help me with this?
Liam Newman
@bitwiseman
@JuanFML I can help…
can you send a bit more of your log?
11 replies
AllinolCP
@AllinolCP
Hello!
I am currently working on a deobfuscator for games but how do I disable the var merging up ?
image.png
image.png
That is what happening right now,
I wanted it to be like the bottom one
Liam Newman
@bitwiseman
The beautifier doesn’t change the top to the bottom or the other way around. It is (generally) a whitespace-only formatter.
AllinolCP
@AllinolCP
oh, ok thanks!
Robert Wildling
@rowild

Hi! Is it possible to have jsbeautify format span tags that are “out of order”? I have this:

<span>{page.title}


</span>

and would like to have this:

<span>{page.title}</span>
Liam Newman
@bitwiseman
No, because the first and the second will appear different.
The best the tool could do accurately would be <span>{page.title} </span>.
However, I don’t thnk I can do that currently.
Oh, turns out I’m wrong.
If you set "preserve_newlines": false, it will collapse the first input to:
 <span>{page.title} </span>
But that will collapse a lot of other things as well, so beware.
ripπ
@mostlyrip:matrix.org
[m]
Hi, i am currently implmenting a check function (#741) and wanted to test my python implementation. I have little python experience and can't find a way to execute js-beautify after building with make py
2 replies
Alzamer
@Alzamer
Hello, I wanted to start contributing to js-beautifier. I found this issue (#1840) easy, so I modified the appropriate regex. I build locally, run make ci, everything worked - I was testing on Ubuntu. My PR (#1903) is failing on MacOs - I checked the logs, and I don't know what went wrong. The error says Post-build git status check - FAILED. Where do I made mistake? Aren't these unstaged changes made in tests?
Liam Newman
@bitwiseman
@Alzamer Thanks for contributing. The check ensures that we don't have uncommitted changes in the workspace after the build. It sometimes runs into issue with different environments. I've fixed the issue for you.
Caroline Kistler
@carolinekistler
Hi guys! I am starting on issue #1823 and would like some clarification on what the desired output is? Thanks!
Liam Newman
@bitwiseman
@carolinekistler The output should be the same for <button>Click here</button><!--end button--> and <button>Click here</button><!-- end button-->
@carolinekistler I've updated the issue with an example.
ripπ
@mostlyrip:matrix.org
[m]
Thanks. That builds the test files? My question was more regarding the final 'executable'.
Liam Newman
@bitwiseman
make py
I think I'm not understanding your request.
ripπ
@mostlyrip:matrix.org
[m]
Basicly I did 'make py' but I cant run the files I build / where are they located?. For javascript I just execute the file in js/bin. Maybe I am understanding that python build thing wrong?
Liam Newman
@bitwiseman
Yeah, python doesn't need any building to run really, but we do use a python virtualenv. try ./tools/python-dev js-beautify
ripπ
@mostlyrip:matrix.org
[m]
Thanks, thats exactly what I needed
Alzamer
@Alzamer
Hi, I made 2 PR's (#1927 and #1928 ) which seems to me are working. Both of them are not passing the Post-build git status check. I request for help, because I think I encountered same error april 10th. If not, what am I overlooking?
Liam Newman
@bitwiseman
@Alzamer Run make all (or just make). When that is done, you will see you local workspace has some changes. Commit and push those changes.
Liam Newman
@bitwiseman
@Alzamer Looks like there was a change in the black formatter for python. I've pushed a fix.
DannySalvatore
@DannySalvatore
I am trying to decode one js file
Please can someone help?
Liam Newman
@bitwiseman
@DannySalvatore Sure. https://beautifier.io/ issue?