Forum Discussion

Tank302's avatar
Tank302
Occasional Contributor
3 years ago
Solved

Code prettier

Please tell, is there an automatic code formatter in TestComplete? In order not to bother with indentations and for the whole team to write good code?

I've used Prettier before (https://prettier.io/), can I connect it as an external plugin?

Thanks.

  • Hi

    unfortunately, there is no such  plugin now.

     

    But good thing in Prettier that you can use it with commit hook:

    https://prettier.io/docs/en/precommit.html

     

    So, maybe it will be even more helpful to introduce guidelines for the whole team.

5 Replies

  • AGubarev's avatar
    AGubarev
    SmartBear Alumni (Retired)

    Hi

    unfortunately, there is no such  plugin now.

     

    But good thing in Prettier that you can use it with commit hook:

    https://prettier.io/docs/en/precommit.html

     

    So, maybe it will be even more helpful to introduce guidelines for the whole team.

    • Tank302's avatar
      Tank302
      Occasional Contributor

      No, that's not what I was asking. What you offer is fine-tuning the look of what is written.

       

      And I ask about the mechanism which would independently remove or add brackets, spaces, semicolons, etc., etc.

       

      You see, our code will be checked - and everyone should write according to the generally accepted rules of writing JS code. And Prettier copes with this task perfectly. But unfortunately we have to copy blocks of text, check online on another resource, and paste into the code editor already formatted code. This is not convenient. I would like to be able to connect such a skin test mechanism directly to the Test Complete code editor.