Giter VIP home page Giter VIP logo

Comments (3)

thernstig avatar thernstig commented on May 22, 2024 1

We do use Prettier, but unfortunately Prettier cannot account for self-made white spaces such as line breaks to delimit parts in the code. This renders the usage of this tool not possible for us unfortunately, but thanks anyway for a good tool.

from cjstoesm.

thernstig avatar thernstig commented on May 22, 2024

In addition it removed comments, such as:

    log4js.addLayout('json', () => (logEvent) => {
      const generalFields = {
        // Mandatory fields
        foo: '1.0', // Current version of foo

The Current version of foo was removed by the tool.

from cjstoesm.

wessberg avatar wessberg commented on May 22, 2024

Hi there,

cjstoesm leverages TypeScript to parse your source code into Abstract Syntax Trees grouped together as Source Files in a Program, and as with many other ASTs, TypeScript doesn't treat whitespace as nodes in the tree, but rather has its own opinionated printer that doesn't know about or care about the original structure of the source code. So by design, it is not possible to guarantee the same structure as the original code in terms of whitespace. I would generally recommend using a tool such as Prettier in a way that ensures that your code is auto-formatted according to a set of rules you define internally in your team for each commit.

Unfortunately, the same can be said about comments, but this should be fixable. So I'll close this issue and create another one for tracking the preservation of comments. Thanks for your feedback

from cjstoesm.

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.