Git Product home page Git Product logo

Comments (8)

spck-io avatar spck-io commented on July 28, 2024

There is already an unopinionated code formatter called indent.js that can be accessed in the plus icon menu of the quick keyboard, but if you prefer to use prettier, I can add this as an alternative opinionated formatter that can be changed in the settings.

from spck-issues.

Proxtx avatar Proxtx commented on July 28, 2024

I already discovered this tool but it is a little but it is not working very good:
`function createBlocks (width, height){
for(var i = 0;i<Math.floor(fieldWidth/width);i++){
blocksArray.push([]);
for(var z = 0;z<Math.floor(fieldHeight/height);z++){
blocksArray[i].push({color: "#000000"});
}
}
}

function loadBlocks (width, height){
  for(var i = 0;i<blocksArray.length;i++){
    for(var z = 0;z<blocksArray[i].length;z++){
      if(blocksArray[i][z].color){
        ctx.fillStyle=blocksArray[i][z].color;
      }
      ctx.fillRect(i*width, z*height, width, height);
    }
    }
    }
    initCanvas();
    createBlocks(blockWidth, blockHeight);
    genApple();
    loadBlocks(blockWidth, blockHeight);
    
    
    
    //Game
    
    function updateSnake (){`

For no reason it inserts spaces to the code.

from spck-issues.

Proxtx avatar Proxtx commented on July 28, 2024

I think nobody is actively developing indent.js(look at the dates)
Screenshot_20191204-163346

from spck-issues.

spck-io avatar spck-io commented on July 28, 2024

Ok, I can switch it. I am the developer for indent.js and there has been no bug reports on the repo. Just wondering if prettier can be configured to not put each element of an array on a new line? I find it super annoying when code prettifiers add a whole bunch of new lines to my code, but maybe that’s just me...

from spck-issues.

Proxtx avatar Proxtx commented on July 28, 2024

Maby you just add an option to the settings to choice which prettifier to use.

from spck-issues.

Proxtx avatar Proxtx commented on July 28, 2024

prettest.zip
Here is an test script by me (edit code.txt and run script)
A great think I like of prettier is the semi: true option Wich adds semicolons.

from spck-issues.

spck-io avatar spck-io commented on July 28, 2024

I looked into prettier and I’m shocked that the standalone bundle is over 30000 lines of code. Even when gzipped it still is a huge file, not to mention parsing through so much JavaScript will further slow down the editor load time. I’m going to switch to jsbeautifier, alternately I can refractor the formatter into a webworker, which hopefully shouldn’t bog down the editor start up time.

from spck-issues.

Proxtx avatar Proxtx commented on July 28, 2024

Ok... I'm really looking forward to it!

from spck-issues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.