Тёмный

Formatting your code is a waste of time - use Prettier instead 

Kevin Powell
Подписаться 943 тыс.
Просмотров 90 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 195   
@JayWithABeanie
@JayWithABeanie 2 года назад
Thank you for taking the time in your life to create these videos to help us all out. It's especially interesting that you're able to keep bringing out new and interesting content for beginning and experienced web developers
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@Ana_Alien
@Ana_Alien 2 года назад
Although I don't speak English very well, I can understand you because of your great way of explaining
@ssj1260
@ssj1260 2 года назад
"Although I don't speak English very well" he writes in perfect English with amazing grammar.
@rohanhazari4642
@rohanhazari4642 2 года назад
@@ssj1260 well he did say "speak" not write
@elpolodiablo5486
@elpolodiablo5486 2 года назад
@@ssj1260 I think he used Google to translate from his native language to English. He forgot to translate his username though.
@Ana_Alien
@Ana_Alien 2 года назад
@@ssj1260 The answer is: Google Translate
@nivoset
@nivoset 2 года назад
Always laugh and think of the pettier package. That just keeps changing prettier settings randomly.
@WebDevFreelancer4
@WebDevFreelancer4 2 года назад
Do off your auto safe 👍
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@darz_k.
@darz_k. 2 года назад
@@amidembio6155 Not nice to spam other channels Brother.
@Born2DoubleUp
@Born2DoubleUp 2 года назад
I'm here! 😎 Great video, just posting a comment to show some support! Keep up the good work. 🤙
@MoonLightHAB
@MoonLightHAB 2 года назад
Wow, i was searching up for this topic and your video just popped up in my recommended, nice timing haha.
@KevinPowell
@KevinPowell 2 года назад
Perfect!
@mykalimba
@mykalimba 2 года назад
0:28 "...is it two spaces or four spaces for a tab?" The correct answer is "neither", because it's a TAB!
@HenriqueErzinger
@HenriqueErzinger Месяц назад
heresy!
@kabijoshi5949
@kabijoshi5949 Год назад
My policy is I subscribe only if, I learn new thing or two when I read the video for a specific query. And I subscribed. Thank you.
@kashgarinn
@kashgarinn 2 года назад
This just makes me realize that formatting should be interpreted when you open the file, not when you write or save it. i.e. there should be no need for a global corporate formatting system because you should be able to choose your formatting individually, and that formatting is set when you open/save the file
@12Tsurugi
@12Tsurugi 2 года назад
Does such a tool exist?
@JakobBjerrePetersen
@JakobBjerrePetersen 2 года назад
And how would that work when you're merging stuff that your coworker did (that is formatted totally wrong, according to your local formatting style guide lines)? Your coworker creates a block of code that you need to edit a bit, then it's entirely reformatted, and you have now touched every single line of code. Goodbye GIT blame.
@GiselLucero-w2r
@GiselLucero-w2r Месяц назад
Thanks, I can finally configure properly my prettier! It was a video short and easy to follow.
@kaffeetscherl
@kaffeetscherl 2 года назад
A nice feature you can use with the command line is creating git hooks. Configure your formatter locally as you like but as soon as you commit changes, it will be formatted according to the guidelines.
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@ashleyhoward14
@ashleyhoward14 2 года назад
I love that you slowed down while saying "front end friends" just to make sure we understood 😂
@siraftel7915
@siraftel7915 2 года назад
Thanks a LOT. I just finish coding, and boom. This came out. So usefull as allways. Cheers
@seqidurrrrrr
@seqidurrrrrr 2 года назад
I've moved away from prettier-eslint by combining eslint-plugin-prettier and eslint-config-prettier. This perfectly combines the two, letting prettier take over all formatting linting using your config, and doesn't require more plugins to use.
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@mr0big
@mr0big 2 года назад
If you happen to work in a team make sure you either use the same auto-formatter with the same setting across the whole team, or nobody should use anything at all. if you try live in between then you will encounter a ton of conflicts on every merge. Using a lazy autoformatter that only changes the lines you actually touched might work as well.
@folkrav
@folkrav 2 года назад
Enforcing code quality tools as a CI step is a must in growing teams. First thing we do in all projects is setup eslint, prettier, and a basic testing config.
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@HenriqueErzinger
@HenriqueErzinger Месяц назад
if you are going to use one, it should be configured in the project.
@SophieExMachina
@SophieExMachina 2 года назад
I don't like Prettier because it enforces certain code style rules like collapsing statements to one line in JavaScript.. Or not letting you break objects and arrays into multiple lines unless it exceeds the max-width you set on your lines. I really prefer having objects and arrays into multiple lines because it makes it so much easier to edit them. Additionally, it also has benefits in Git because Git picks up the changes in an array or object better that way because you only removed or added a few lines rather than editing the array/object on one line. Because of this I don't use Prettier anymore and prefer letting ESLint handle it all.
@busyrand
@busyrand 2 года назад
Thanks for providing your personal solution. I'm working on a project an I miss Prettier, but I remember the things you said about it handling JavaScript and PHP so I've been hesitant to grab and Install it.
@Naej7
@Naej7 2 года назад
Same here, their « put the maximum amount of characters possible in one line » policy is dumb, and makes your code and html inconsistent
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@andreamuro8074
@andreamuro8074 10 месяцев назад
Thanks for making prettier settings easy. I subscribed based on this video!! I'm excited to see more of your videos! 😁
@Shulkerkiste
@Shulkerkiste 2 года назад
For me, formatting code is one of the easiest things in programming. I always write perfect formatted code directly. I often see programmers who don't care about good formatting which is really awkward for me ^^
@m3awna
@m3awna 2 года назад
Why format yourself when you have ton of formatters (if you're using VScode like everyone today)
@Shulkerkiste
@Shulkerkiste 2 года назад
@@m3awna Well, I don't format as an extra step but my code is formatted after typing it.
@m3awna
@m3awna 2 года назад
@@Shulkerkiste that's what I'm talking about
@Shulkerkiste
@Shulkerkiste 2 года назад
​@@m3awna Then I don't understand your suggestion. I'm just typing for example: selector { width: 42px; } instead of selector{ width:1337px;} I'm using the JetBrains IDEs. Maybe it is easier and faster to write formatted code with these IDEs. I'm not using VSC so I don't know.
@m3awna
@m3awna 2 года назад
@@Shulkerkiste I thought you're doing the formatting yourself. That's why I suggested you use a formatter
@junsu-ho
@junsu-ho Год назад
I found that box-shadow is annoying in Prettier, I like to have each on separate line, prettier clumps everything together ... that's not readable, anyone knows how to fix it?
@adrianterencehand
@adrianterencehand 2 года назад
Fantastic video! When I add up the time spent manually chasing correct formatting, Kevin you might have given me back literal days this year ❤️ not necessarily with regard to the technical detail, rather affirming that it’s *okay* to just let a formatter do it’s thing.
@tinmancode
@tinmancode 2 года назад
Hehehehe manually chasing down formatting. Why?
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@xavierkmuneku
@xavierkmuneku 2 года назад
This is why I rate your channel Kevin, you always bring topics that many overlook... Keep it up!
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@m3awna
@m3awna 2 года назад
00:45 to 01:00 that's the SOLUTION to this idiocy. Hats off Kevin
@soheil6180
@soheil6180 2 года назад
Hitting the bell on your channel is the best decision I've made on RU-vid
@schizoidman9459
@schizoidman9459 2 года назад
Me again. This is a huge help. I do agree that formatting code is a loss of time. Unfortunately this is not available for other languages. In Java this would be very complicated because of Javadoc, but Eclipse already has some automatic standard formatting, which helps a lot. By the way, it would be nice if Javadoc would be formatted as we see the code on the IDE (Eclipse), instead of needing to hover over with the mouse. Javadoc kind of obfuscates the code. It looks like that you have not only excellent communication skills but also a lot of practice in programming and teaching (I knew!!!). I don't know if it is also because your English is Canadian that it makes it sound better. But I believe one can barely notice any Canadian spelling of yours except for the pronunciation of "out" as in "about". Most Canadians are easily recognized in this spelling. 👍
@djmtype
@djmtype Год назад
Please consider doing a stylelint tutorial in conjunction with prettier. There doesn't seem to be any current videos covering this topic.
@local-admin
@local-admin 2 года назад
Was just looking for a video by you on this. One of few I go to for css help, thanks for your time Kevin!
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@local-admin
@local-admin 2 года назад
@@amidembio6155 Beautiful country you have!
@somnvm37
@somnvm37 2 года назад
thb this plugin lacks costamisaion. It doesn't allow me to make as much spaces as I want (if I want to allign all the comments) and many other things
@michaelfaith
@michaelfaith 2 года назад
I love prettier. It's great, and coupled with eslint is a great combination for improved code quality
@tinmancode
@tinmancode 2 года назад
How did you get them to cooperate. I have a colleague who is struggling with the two cos they don't play nice and Eslint is in the build process so the code just breaks on some of prettier formating randomly. Eslint throws a spoilt fit randomly
@michaelfaith
@michaelfaith 2 года назад
@@tinmancode Kevin mentions it briefly, there's a third library called eslint-config-prettier, which turns off the eslint rules that conflict with prettier's formatting rules. If you don't add that, then yeah they do tend to battle each other on certain things. Add that library and they work really well together. We have three package.json scripts in our setup. "format" is for developers to use locally before committing and it runs prettier with the --write flag. "format:check" is for the build pipeline, and runs the prettier validation without write. And then "lint" is for local and build pipeline, and runs the eslint check.
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@ashikmahmud4076
@ashikmahmud4076 2 года назад
I have used Beautify formatter since almost 2 yr. Yesterday I was trying to switch into prettier formatter but I can't some reason of issues. As like can't format HTML file in my case. I tried more and more for staying prettier but I can't stayed Eventually, I switched back in Beautify formatter 😔
@dasunguy
@dasunguy 2 года назад
"Poorly formatted *code* was the bane of my existence. ... just trying to read like a string of *CSS* ... their *HTML* nesting ..." Oh, you!
@adithmanu3715
@adithmanu3715 2 года назад
Hi Kevin, I am not a fan of CSS but, your videos inspire me to use it. My question is: Is material UI a good choice when styling in React-based frameworks
@tinmancode
@tinmancode 2 года назад
Is white a good paint for cars? Is range rover a good choice for asphalt based roads, Why. Pick it cos you want to learn it, or you like it or you are exploring. The time of your project is also a good point to consider. If you really have to pick one then you need something to compare them against. Like how long will it take to learn that framework vs the time to deliver if the work has a deadline. Do you need pre built components that are already built to speed up your development. Or do you have a custom interface created by a designer for you which means you have to write extra code to make the material ui look like the design you were giving. Do you have custom behaviors needs for your elements and are most supported by the library you pick. Tab indexing and other accessible web requirements. You don't want your org to fail ADA compliance
@tinmancode
@tinmancode 2 года назад
Your requirements should influence what you choose. Other just pick a random ui library every new project and as well a random js framework too
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@FreakySohl
@FreakySohl 2 года назад
Thank you! This is gonna save me so much time! Keep 'em coming! Love your vids :)
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@BenRangel
@BenRangel 2 года назад
I dislike Prettier for CSS cause it's not configurable enough. printWidth: 80 is fine as a general rule but I don't want it line breaking in the middle of a selector. When I have 3 comma separated selectors I want 3 lines of code. Even if one selector is too wide I don't wanna see it broken up into 2 lines of code. Consider this: article section header h1, article section aside header h1, aside h1 { color:red; } The second selector contains a line break. Makes it hard to read because it's 3 selectors so you expect 3 lines. Not 4 lines. Sure I could increase the printWidth but then long background gradients I intentionally split up into multiple lines will be re formatted into a single line. And I don't wanna sprinkle my code with ignore comments. I wanna config by rule. lineBreakSelectors: false, lineBreakPropertyValues: true But you can't do that.
@utkarshadlakha8973
@utkarshadlakha8973 2 года назад
Looking for this for a while thanks for this
@elkcityhazard
@elkcityhazard 2 года назад
didn't think there was much to say about prettier but if Kevin Powell has a video about it then I'm definitely going to find out what I don't know.
@mustafamuse2904
@mustafamuse2904 2 года назад
Thank you Kevin Powell the king of css.
@shanejeremich4681
@shanejeremich4681 11 месяцев назад
How come when you save your HTML file with Prettier, it auto formats your code where I/ see the image element does not have the forward slash in the self-closing tag? Every time I save with Prettier, it always adds an unnecessary slash. Is there a setting or something I'm overlooking?
@somdhen
@somdhen 2 года назад
Very much informative and this tutorial helps a lot. Thanks very much !
@angelocina5914
@angelocina5914 2 года назад
thks mate for your video! I can suggest you to remember to unflag option in Prettier "Require Config", because in some case when you install Prettier first time this is flagged and Prettier doesn't work without a configuration file in the root of project. i hope this is helpful.
@Peter-wx9qg
@Peter-wx9qg 10 месяцев назад
I'm not getting any options for prettier when searched under settings.
@cobain200
@cobain200 Год назад
I hope you guys can help me! How can i write a line of Html Code that should be ignored by prettier. For example i have two paragraphs next to each other as CSS -Inline-Block lorem lorem and i want them to stay like this.....Prettier puts them one under the other. Please help.
@reflectionethio9662
@reflectionethio9662 2 года назад
Thank you Kevin , for what you are doing
@bushigi5913
@bushigi5913 2 года назад
Thank you Kevin for bringing this beginner friendly topic which probably most of the senior developers won't even mention.
@cleecoloma
@cleecoloma Год назад
This was very helpful. Thanks Kevin!
@StevenHarris-v5d
@StevenHarris-v5d 8 месяцев назад
Prettier is designed to eliminate bike shedding about style formatting. If you don't have this problem there are more configurable options out there. Opinions are often wrong, and while prettier is "standard" and "consistent" is is neither intelligent nor meaningful in many contexts. It can actually pollute code that would otherwise be easy to read, and can result in inconsistent patterns. I can think of a lot of contexts where prettier helps: React code being one of them. But there are other code patterns that are better suited to formatting by eslint extensions or similar configurable formatters. My experience is that prettier causes friction when not being used for its intended purpose: to eliminate debate. If your code team members are mature and can comport themselves effectively, there is often no need to introduce the "prettier layer" - and often a liberal exclusion in .prettierignore is more effective at keeping velocity than having prettier in your pipeline. Yes, this is also an opinion - but one you will see disallowed in any prettier moderated forum as such debate is excluded by definition. For this reason, prettier is a bike shedding about bike shedding, IMHO.
@yukiteru9099
@yukiteru9099 2 года назад
Thank you Kevin, you really helped me a lot!
@yogiealfin3679
@yogiealfin3679 Год назад
Why your img tag not formated with self closing tag like /> my prettier format it with self closing tag
@f1amezof
@f1amezof 2 года назад
I just don't like how few formatting options Prettier has. And I don't like how it's uglifying my code. So I'm using ESLint instead.
@stevenwilson5556
@stevenwilson5556 Год назад
Prettier out of the box puts /> at the end of a lot of HEADER tags when you save the HTML file, which breaks WC3 validation. It's not obvious how to turn this "feature" off.
@stevenwilson5556
@stevenwilson5556 Год назад
OK, went through to prettier and dug through this on a message board, it cannot be changed. There's a long discussion on pros and cons and such, but if you use prettier, you cannot get your HTML file validated on the W3C validator as it will choke on the self-closing meta header tags by default
@yogiealfin3679
@yogiealfin3679 Год назад
But on the video img tag not using /> after format, any clue how to do that?
@stockholm12
@stockholm12 Год назад
@@yogiealfin3679 I'm wondering about that too. If anyone has a solution please let us know.
@djmtype
@djmtype Год назад
Any way to prevent prettier from breaking up minmax values? It puts every number following a comma on its own line - yuk!
@HenriqueErzinger
@HenriqueErzinger Месяц назад
I have a few strong opinions about formatting, and a few of those disagree with Prettier's, but the one that I REALLY hate is that it doesn't align variables and properties values, and even removes the alignment if you do it manually. IntelliJ's builtin formatter is much better IMO, but not everyone uses IntelliJ (not even myself anymore at this point) and Prettier kinda became the industry's standard so I live with it, but I still don't like it.
@DexterMorgan
@DexterMorgan Год назад
Nothing like taking code from your co-workers and completely changing the formatting to your own because screw you Greg for leaving me with the bar tab.
@ahndeux
@ahndeux 2 года назад
I find Prettier to be frustrating to work with on HTML files. Its great for CSS, JS and other code, but it can be a struggle with HTML. It tends to randomly not work and its not easy to figure out why. Simply putting a span inside a div can break the code and it won't format when saved.
@tinmancode
@tinmancode 2 года назад
You probably want to check if you have a syntax error. If you use vscode then look at the bottom right. When prettier stop formatting. It will have a warning triangle. Click it and it will point out what's missing. It's not much help when html elements are missing are more than is needed. But the presence of the triangle should prompt you that your hl has issue. In that case first indent all the lines using the indent shortcut then start folding blocks of html one chunk at a time. Just do that carefully and you'll find the problem tag
@tinmancode
@tinmancode 2 года назад
Debugging is an art and skill sometimes. And always look at the error messages in your editor. I've realized a ton of my bugs are syntax related when the code stops working completely. I check syntax before logic errors except if the code runs
@logicalfundy
@logicalfundy 2 года назад
Tried Prettier, but it misunderstood a bunch of my Typescript code and just messed it up. It's a bit *too* opinionated. Happier with just ESLint. The point should not really be to "take decisions away" - but to provide a reasonable baseline.
@dr8868
@dr8868 Год назад
This was great explanation.
@brokenMikrophone
@brokenMikrophone 2 года назад
Thanks
@graaam101
@graaam101 2 года назад
It bugs me that the HTML in the first example is missing closing `` on each line...lol
@savankumar0
@savankumar0 2 года назад
Back to back videos nice 😀 ❤️
@senior_developer
@senior_developer Год назад
How to do that with Styled-Components?
@hcgreier6037
@hcgreier6037 2 года назад
Might by hair splitting, but the title of the video is a little bit confusing. Formatting code is not a waste of time, it's just a waste of time doing it by HAND 😎 Like your videos very much!
@smarter_in_5_mins
@smarter_in_5_mins 2 года назад
Thanks for info. Do you have a video about tools you are using? I have not found any.
@Davyyd1
@Davyyd1 2 года назад
is there a way to space between line of code
@perkin524
@perkin524 2 года назад
I am unable to make Prettier work for html docs with a php extension - despite trying to install the Prettier php extension. Could you make a quick video showing how to do that?
@vitamax3777
@vitamax3777 2 года назад
prettier extension is configured as a formatter but cannot format the file 😥there was a problem in sass file after installing the prettier. Somebody know why?
@LuBre
@LuBre 2 года назад
Doesn't "remove semicolons" add a risk of breaking everything, as soon as you minify your js file?
@AChannelFrom2006
@AChannelFrom2006 2 года назад
I remember losing some marks on an assignment at uni because of my formatting. I have always been a 2 spaces person. Something that I don't like is tabbed code.
@adrian20065
@adrian20065 2 года назад
I like using prettier for css and js. But I disabled it because I don't like the way it format html file. I would use it if I can disable it from not formatting html. Thanks Kevin.
@TokyoXtreme
@TokyoXtreme 2 года назад
You can easily set up HTML to be ignored by Prettier.
@majkipl9684
@majkipl9684 2 года назад
im doing automaticly what's that program do
@Codewow
@Codewow 2 года назад
Considering all of my projects have been solo projects... my formatting is literally whatever the hell I feel like in the moment... so yeah. Never look at my code if you get angry hahaha. I use a prettifier plugin to help clean it up, but it also causes some problems.. so I can't use it often.
@KevinPowell
@KevinPowell 2 года назад
You can configure it to ignore certain file types. I've had to do that because it plays hell with a few, lol.
@oliver139
@oliver139 2 года назад
Nice video! Any chance you will talk about StyleLint as well?😃
@doyourworkout5608
@doyourworkout5608 2 года назад
Thanks for showing this extension
@tinmancode
@tinmancode 2 года назад
I have a colleague that has prettier and Eslint. Even Rússia and usa get along better than those two extensions. And the code breaks because Eslint is hooked into the build and there are some prettier formatting it hates. Working on that code base is miserable. I would rather code in binary with a pencil and paper
@zackpyle496
@zackpyle496 2 года назад
Love Prettier! But I was just thinking the other day, how cool would it be if Prettier would also reorder your css properties?!
@dimofamo
@dimofamo 2 года назад
This! I'm quite consistent with indents but speaking about properties order I'm a mess 😭
@m3awna
@m3awna 2 года назад
prettier doesn't work with php on my machine
@castlemoyle
@castlemoyle 2 года назад
Prettier is the one Code add-on that I've NEVER been able to successfully been able to install and have work right. I was so hopeful when I saw this video. But no luck for me. After following your video step by step, I still have ugly code. So sad.
@machperiod6784
@machperiod6784 2 года назад
Hoping you will soon upload a video describing actual website webpage layout formatting as I'm having difficulty in arranging layouts how to put things in a right place so that it could make the actual webpage
@tinmancode
@tinmancode 2 года назад
You'd probably need start with a design on paper or figma or xd and then try identifying the parts of the design like anatomy of a organism and the try to write your code that way. Create code or html elements for the big organs first like where does the navbar go. The aside. Your headings and body. Little stuff and have fun
@952a259
@952a259 Год назад
Thanks a lot! 👍
@leenardgalad5448
@leenardgalad5448 2 года назад
Yup its difficult to format a long code copied from stackoverflow
@garymaclaren7191
@garymaclaren7191 6 месяцев назад
Installed. Didn't work.
@johnledger4230
@johnledger4230 2 года назад
Hi, I have watched a lot of your CSS videos and found many ot them very useful. However prettier, and other code formatters I have looked at do not seem to be able to be configured to the very strict way I write my code and have done for many years If there is a config option for prettier that does this then I would be glad to learn it. I do essentially Allman style code formatting in all languages, where opening braces and parentheses appear on a line by themselves and align verically with the matchung closing brace/parenthesis. The exception is where all the enclosed code can fit comfortably on one line. Also the indented code is indented by 1 tab, and not a number of spaces. I know this is controversial but I would like to know if any formatter can be configured this way. I got VSC to nearly do it right once but have not tried recently
@amidembio6155
@amidembio6155 2 года назад
You should see this video. So relaxing and useful for programmer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpzSxozSoII.html
@felipeinfantinom
@felipeinfantinom 2 года назад
Hi, nice video. I watch a lot of your videos. Couldn't seem to find any about Tailwind CSS, would you maybe consider making a video about it?
@yourregularguy4377
@yourregularguy4377 2 года назад
What if there are missing tags? Does it replace them?
@KevinPowell
@KevinPowell 2 года назад
Don't think so, no. Specially since it's hard to say what tag is actually missing at times depending on how things are nested, and also, as a lot of elements have optional closing tags, like paragraphs, list items, and a few others... I could be wrong on that though, I haven't tested it out specifically.
@sonarsphere
@sonarsphere 2 года назад
Thank you Kevin!
@aryan7069_
@aryan7069_ 2 года назад
Prettier is great but only one thing i dont like... In my react jsx code on formatting prettier adds {" "} on starting and end of word inside html element.
@farzamqureshi1389
@farzamqureshi1389 2 года назад
How to use it for php?
@nishantkumar6960
@nishantkumar6960 2 года назад
Thank You
@t20miguelvillarica33
@t20miguelvillarica33 2 года назад
Your vids are great!!
@Deriathan1
@Deriathan1 2 года назад
I honestly pretty much hate Prettier. I dont like opinionated formaters at all. :) And I think in many way Prettier is incompatible with coding standards. Even in this video: That HTML should be whole on new line and not wrapped by preset line width. Not mentioning missing tags. ... Prettier and HTML really doesn't go together. If someone wants to use it then only for JS, TS, etc, but not for templates.
@CargoCrates
@CargoCrates 2 года назад
Plz make setup tour
@Knards
@Knards 2 года назад
Semicolons? Yes!
@ghiffaralfinfaiz5989
@ghiffaralfinfaiz5989 Год назад
thank you
@samuelsimon4087
@samuelsimon4087 2 года назад
Formatting is THE most important thing just to make code readable. However its done is not my business. people not formatting code is the equivalent of using code like while (*s++ = *t++); to copy one string to another in C. Its correct no doubt, but unreadable to any person
@ondrejhanslik9368
@ondrejhanslik9368 Год назад
Okey, the point of "just use Prettier" means that you don't understand the point of formatting at all. What problem formatting solves? The answer is readability. The whole point of formatting is to increase readability. We always have many stylistic rules but even with many stylistic rules there are always multiple options to format your code while following the rules. The problem with automatic formatters is that they don't care about readability. They care about the rules and they just always pick one specific option to format the code. The biggest problem is usually with line wrapping. Oh, you decided to split this condition over three lines so that it's obvious what it does? Prettify just wraps it back into one line.
@pranjalroy6396
@pranjalroy6396 2 года назад
Hi Kevin! How are you doing?
@KevinPowell
@KevinPowell 2 года назад
I'm doing great, thanks for asking :D
@yves5960
@yves5960 2 года назад
Does this work for Laravel blade files?
@YannMetalhead
@YannMetalhead 2 года назад
Good video.
@DevilMan55
@DevilMan55 2 года назад
This is like saying grammar and punctuation doesn't matter. You can't know a good, opinionated prettier if you've never tried to format your code nicely. It is essential to leave behind code that others can read. It is a core skill of programmers that they care about how code is formatted. Does prettier remove bad variable names? Does prettier remove redundant code? Does prettier work in C# or C++ or Java or RUST or Python? Does prettier acknowledge a good coder's consistency? Does prettier help you think about what you're doing? I disagree with your premise - formatting your code properly is not a waste of time - it is an essential skill and well worth thinking about. Taking the time to do it is never wasted. The opinions of prettier were based on that time that was taken to care about code format and, as irrelevant as this is, in my opinion - since we're going with opinion - I can format code way better than it can - because I care to - because I practice doing it. It is far more important that we take the time to format our code consistently than it is to rely on tools to do it. Tools are fine, but, they are no more than polish on the gem of a well organized mind. The programmer, herself, needs to care about such things - two carpenters may build a functional chair, but one might build a more elegant one. This is care of craft.
@gedtoon6451
@gedtoon6451 Год назад
I had a lot of pain with Prettier. To save some people time, IT DOSE NOT WORK WITH PYTHON!!!!
@danel1922
@danel1922 2 года назад
its 4 spaces! everything else is crazy
@Alexifeu
@Alexifeu 24 дня назад
Awesome
@chefbennyj
@chefbennyj 2 года назад
Tabs over spaces... tap, tap, tap, tap ... 😶 ... tap... 😳 tap... 😖 ... tap... 😬 ... ... ... tap 😆
Далее
Using CSS custom properties like this is a waste
16:12
Просмотров 172 тыс.
Flexbox design patterns you can use in your projects
15:33
How To Setup Prettier
12:11
Просмотров 145 тыс.
How Senior Programmers ACTUALLY Write Code
13:37
Просмотров 1,5 млн
18 Weird and Wonderful ways I use Docker
26:18
Просмотров 150 тыс.
You're (Probably) Using Prettier Wrong
6:04
Просмотров 109 тыс.
I gave three AI models a CSS quiz
50:31
Просмотров 12 тыс.
Why I Stopped Using Prettier
12:49
Просмотров 11 тыс.
Flexbox or grid - How to decide?
18:51
Просмотров 728 тыс.
The 6 most important CSS concepts for beginners
28:58
Просмотров 156 тыс.
I learned to code from scratch in 1 year. Here's how.
41:55