Prettier
هذا المحتوى لا يتوفر بلغتك بعد.
Prettier removes all original styling and ensures that all outputted code conforms to a consistent style.
Prettier takes your code and reprints it from scratch by taking the line length into account.
Example
For example, take the following code:
It fits in a single line so it’s going to stay as is. However, we’ve all run into this situation:##
Suddenly our previous format for calling function breaks down because this is too long. Prettier is going to do the painstaking work of reprinting it like that for you:
Prettier enforces a consistent code style (i.e. code formatting that won’t affect the AST) across your entire codebase because it disregards the original styling* by parsing it away and re-printing the parsed AST with its own rules that take the maximum line length into account, wrapping code when necessary.
More Features In The Video
Useful Resouces
- Prettier Docs https://prettier.io/docs/en/