You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/05/17 11:54:00 UTC

[GitHub] [accumulo] milleruntime opened a new issue, #2713: Beatify JS code

milleruntime opened a new issue, #2713:
URL: https://github.com/apache/accumulo/issues/2713

   **Is your feature request related to a problem? Please describe.**
   The JS code in the Monitor does not have consistent formatting.
   
   **Describe the solution you'd like**
   I want to run a tool from the command line once to clean up the JS code and have it all consistently formatted. There is a Node JS tool that can be run, it is called `js-beautify`. https://www.npmjs.com/package/js-beautify
   
   **Describe alternatives you've considered**
   We can just leave it as is. Or any other JS formatting tool.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] ctubbsii closed issue #2713: Beatify JS code

Posted by GitBox <gi...@apache.org>.
ctubbsii closed issue #2713: Beatify JS code
URL: https://github.com/apache/accumulo/issues/2713


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] DomGarguilo commented on issue #2713: Beatify JS code

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on issue #2713:
URL: https://github.com/apache/accumulo/issues/2713#issuecomment-1133085866

   > > Run the following powershell script at the repo root to format all JavaScript files under `$Directory`.
   > 
   > A similar bash script:
   > 
   > ```shell
   > #! /usr/bin/env bash
   > npm install js-beautify
   > ~/node_modules/js-beautify/js/bin/js-beautify.js -n -j -s 2 server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/*
   > ```
   
   It looks like this can be simplified further using npx. Borrowing from @ctubbsii's script:
   ```
   npx js-beautify -r -n -j -s 2 server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/*
   ```
   Adding -r: `-r, --replace    Write output in-place, replacing input`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] ctubbsii commented on issue #2713: Beatify JS code

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on issue #2713:
URL: https://github.com/apache/accumulo/issues/2713#issuecomment-1132870682

   > Run the following powershell script at the repo root to format all JavaScript files under `$Directory`.
   
   A similar bash script:
   
   ```bash
   #! /usr/bin/env bash
   npm install js-beautify
   ~/node_modules/js-beautify/js/bin/js-beautify.js -n -j -s 2 server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/*
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] kitswas commented on issue #2713: Beatify JS code

Posted by GitBox <gi...@apache.org>.
kitswas commented on issue #2713:
URL: https://github.com/apache/accumulo/issues/2713#issuecomment-1132814765

   Run the following powershell script at the repo root to format all JavaScript files under `$Directory`. 
   
   ```powershell
   # Recursive_format using js-beautify
   
   npm -g install js-beautify
   
   $Directory = \server\monitor
   
   Get-ChildItem -Path $Directory -File -Recurse | Where-Object { $_.Extension -eq '.js' } | Foreach-Object { 
   	js-beautify $_.FullName -r
   }
   
   ```
   
   The differences can be tracked using Git.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org