Code Monkey home page Code Monkey logo

Comments (3)

dc7303 avatar dc7303 commented on June 24, 2024 1

@hackerwins Thank you for providing usable information.
In my opinion, newline per chain call are not the problem, it seems to be affected by the printWidth option of prettier.
In 1.x versions, if there were more than 3 calls, a newline occurred. In the current 2.x version this has been fixed, we are using version 2.0.5.

(reference)
version 1.x playground
version 2.x playground

So I tested it with the code of the part in problem.

printWidth: 80

    if (logger.isEnabled(LogLevel.Trivial)) {
      logger.trivial(
        changes
          .map(
            (change) =>
              `${change
                .getID()
                .getAnnotatedString()}\t${change.getAnnotatedString()}`,
          )
          .join('\n'),
      );
    }

printWidth: 90

    if (logger.isEnabled(LogLevel.Trivial)) {
      logger.trivial(
        changes
          .map(
            (change) =>
              `${change.getID().getAnnotatedString()}\t${change.getAnnotatedString()}`,
          )
          .join('\n'),
      );
    }

printWidth: 100

    if (logger.isEnabled(LogLevel.Trivial)) {
      logger.trivial(
        changes
          .map((change) => `${change.getID().getAnnotatedString()}\t${change.getAnnotatedString()}`)
          .join('\n'),
      );
    }

However, if we modify it and use it, it affects other parts as well.
For example

-    pbSetOperation.setParentCreatedAt(
-      toTimeTicket(setOperation.getParentCreatedAt()),
-    );
+    pbSetOperation.setParentCreatedAt(toTimeTicket(setOperation.getParentCreatedAt()));

Looking at this, I think there is a part that we have to give up in order for use prettier.
Let me know what you think.

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on June 24, 2024 1

For now, it would be nice to leave this issue open and wait for an update on Prettier.

from yorkie-js-sdk.

hackerwins avatar hackerwins commented on June 24, 2024

Yes. It would be nice to describe Prettier in Contribution.md. I thought it would be nice to have Prettier run automatically before commit using a tool like husky.

However, it could not be introduced due to the line break issue below. Do you have any idea about ​​this issue?
#44 (comment)

from yorkie-js-sdk.

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.