Page MenuHomeSealhub

Prettier - formatter kodu
Updated 2,427 Days AgoPublic

Version 2 of 22: You are viewing an older version of this document, as it appeared on Sep 10 2017, 18:53.

Prettier to automatyczny formatter kodu. W przeciwieństwie do innych linterów, on nie tylko krzyczy, gdy kod nie trzyma się standardów formatowania, ale jest w stanie automatycznie go poprawić.

Aby zainstalować Prettier, wykonaj

# npm install - prettier

Następnie skonfiguruj swoje IDE/edytor tekstu tak, aby automatycznie formatowały kod prettierem:

https://github.com/prettier/prettier#editor-integration

Ustalone w tym wątku na forum parametru Prettiera to (z pominięciem tych, które domyślnie mają już ustaloną przez nas wartość i nie trzeba ich oddzielnie ustawiać):

--tab-width=4  --trailing-comma=es5
Tags
  • Unknown Object (Project)
Referenced Files
F45802: image.png
Nov 27 2018, 13:09
F44556: image.png
Nov 11 2018, 11:23
F44552: image.png
Nov 11 2018, 11:23
F44550: Settings - VSCodium_182.png
Nov 11 2018, 11:23
F44546: Extension: Prettier - Code formatter - VSCodium_179.png
Nov 11 2018, 11:23
F44548: VSCodium_181.png
Nov 11 2018, 11:23
F44542: VSCodium_177.png
Nov 11 2018, 11:23
F44544: VSCodium_178.png
Nov 11 2018, 11:23
Subscribers
None
Last Author
kuba-orlik
Last Edited
Sep 10 2017, 18:53

Event Timeline

kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik added a project: Unknown Object (Project).Jul 20 2018, 13:55
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik shifted this object from the Restricted Space space to the S5 Publiczna space.Sep 20 2019, 18:13