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
@mykalimba3 жыл бұрын
0:28 "...is it two spaces or four spaces for a tab?" The correct answer is "neither", because it's a TAB!
@HenriqueErzinger5 ай бұрын
heresy!
@Born2DoubleUp3 жыл бұрын
I'm here! 😎 Great video, just posting a comment to show some support! Keep up the good work. 🤙
@MoonLightHAB3 жыл бұрын
Wow, i was searching up for this topic and your video just popped up in my recommended, nice timing haha.
@KevinPowell3 жыл бұрын
Perfect!
@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.
@Ana_Alien3 жыл бұрын
Although I don't speak English very well, I can understand you because of your great way of explaining
@ssj12603 жыл бұрын
"Although I don't speak English very well" he writes in perfect English with amazing grammar.
@rohanhazari46423 жыл бұрын
@@ssj1260 well he did say "speak" not write
@elpolodiablo54863 жыл бұрын
@@ssj1260 I think he used Google to translate from his native language to English. He forgot to translate his username though.
@Ana_Alien3 жыл бұрын
@@ssj1260 The answer is: Google Translate
@siraftel79153 жыл бұрын
Thanks a LOT. I just finish coding, and boom. This came out. So usefull as allways. Cheers
@ashleyhoward143 жыл бұрын
I love that you slowed down while saying "front end friends" just to make sure we understood 😂
@kaffeetscherl3 жыл бұрын
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.
@GiselLucero-w2r5 ай бұрын
Thanks, I can finally configure properly my prettier! It was a video short and easy to follow.
@seqidurrrrrr3 жыл бұрын
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.
@nivoset3 жыл бұрын
Always laugh and think of the pettier package. That just keeps changing prettier settings randomly.
@Nickforu3 жыл бұрын
Do off your auto safe 👍
@darz_k.3 жыл бұрын
@Amid embio Not nice to spam other channels Brother.
@kashgarinn3 жыл бұрын
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
@12Tsurugi2 жыл бұрын
Does such a tool exist?
@JakobBjerrePetersen2 жыл бұрын
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.
@mr0big3 жыл бұрын
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.
@folkrav3 жыл бұрын
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.
@HenriqueErzinger5 ай бұрын
if you are going to use one, it should be configured in the project.
@andreamuro8074 Жыл бұрын
Thanks for making prettier settings easy. I subscribed based on this video!! I'm excited to see more of your videos! 😁
@xavierkmuneku3 жыл бұрын
This is why I rate your channel Kevin, you always bring topics that many overlook... Keep it up!
@m3awna3 жыл бұрын
00:45 to 01:00 that's the SOLUTION to this idiocy. Hats off Kevin
@adrianterencehand3 жыл бұрын
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.
@tinmancode3 жыл бұрын
Hehehehe manually chasing down formatting. Why?
@soheil-slvt3 жыл бұрын
Hitting the bell on your channel is the best decision I've made on KZbin
@schizoidman94593 жыл бұрын
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. 👍
@local-admin3 жыл бұрын
Was just looking for a video by you on this. One of few I go to for css help, thanks for your time Kevin!
@local-admin3 жыл бұрын
@Amid embio Beautiful country you have!
@brokenMikrophone3 жыл бұрын
Thanks
@djmtype Жыл бұрын
Please consider doing a stylelint tutorial in conjunction with prettier. There doesn't seem to be any current videos covering this topic.
@Shulkerkiste3 жыл бұрын
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 ^^
@m3awna3 жыл бұрын
Why format yourself when you have ton of formatters (if you're using VScode like everyone today)
@Shulkerkiste3 жыл бұрын
@@m3awna Well, I don't format as an extra step but my code is formatted after typing it.
@m3awna3 жыл бұрын
@@Shulkerkiste that's what I'm talking about
@Shulkerkiste3 жыл бұрын
@@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.
@m3awna3 жыл бұрын
@@Shulkerkiste I thought you're doing the formatting yourself. That's why I suggested you use a formatter
@angelocina59143 жыл бұрын
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.
@cleecoloma Жыл бұрын
This was very helpful. Thanks Kevin!
@FreakySohl3 жыл бұрын
Thank you! This is gonna save me so much time! Keep 'em coming! Love your vids :)
@elkcityhazard3 жыл бұрын
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.
@adithmanu37153 жыл бұрын
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
@tinmancode3 жыл бұрын
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
@tinmancode3 жыл бұрын
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
@linchen59133 жыл бұрын
Thank you Kevin for bringing this beginner friendly topic which probably most of the senior developers won't even mention.
@mustafamuse29043 жыл бұрын
Thank you Kevin Powell the king of css.
@michaelfaith3 жыл бұрын
I love prettier. It's great, and coupled with eslint is a great combination for improved code quality
@tinmancode3 жыл бұрын
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
@michaelfaith3 жыл бұрын
@@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.
@utkarshadlakha89733 жыл бұрын
Looking for this for a while thanks for this
@shanejeremich4681 Жыл бұрын
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?
@yukiteru90992 жыл бұрын
Thank you Kevin, you really helped me a lot!
@dasunguy3 жыл бұрын
"Poorly formatted *code* was the bane of my existence. ... just trying to read like a string of *CSS* ... their *HTML* nesting ..." Oh, you!
@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?
@reflectionethio96623 жыл бұрын
Thank you Kevin , for what you are doing
@johnledger42303 жыл бұрын
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
@SophieExMachina3 жыл бұрын
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.
@busyrand3 жыл бұрын
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.
@Naej73 жыл бұрын
Same here, their « put the maximum amount of characters possible in one line » policy is dumb, and makes your code and html inconsistent
@somdhen3 жыл бұрын
Very much informative and this tutorial helps a lot. Thanks very much !
@amniar81582 жыл бұрын
thankyou so much man have a great day
@savankumar03 жыл бұрын
Back to back videos nice 😀 ❤️
@somnvm373 жыл бұрын
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
@hcgreier60373 жыл бұрын
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_mins3 жыл бұрын
Thanks for info. Do you have a video about tools you are using? I have not found any.
@vitamax37773 жыл бұрын
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?
@machperiod67843 жыл бұрын
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
@tinmancode3 жыл бұрын
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
@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.
@preetsojitra26503 жыл бұрын
Heyy Kevin, which vs code theme do you use?
@graaam1013 жыл бұрын
It bugs me that the HTML in the first example is missing closing `` on each line...lol
@yogiealfin36792 жыл бұрын
Why your img tag not formated with self closing tag like /> my prettier format it with self closing tag
@Peter-wx9qg Жыл бұрын
I'm not getting any options for prettier when searched under settings.
@felipeinfantinom3 жыл бұрын
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?
@LuBre3 жыл бұрын
Doesn't "remove semicolons" add a risk of breaking everything, as soon as you minify your js file?
@perkin5243 жыл бұрын
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?
@AChannelFrom20063 жыл бұрын
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.
@ashikmahmud40763 жыл бұрын
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 😔
@ahndeux3 жыл бұрын
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.
@tinmancode3 жыл бұрын
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
@tinmancode3 жыл бұрын
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
@Davyyd12 жыл бұрын
is there a way to space between line of code
@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.
@oliver1393 жыл бұрын
Nice video! Any chance you will talk about StyleLint as well?😃
@StevenHarris-v5d Жыл бұрын
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.
@zackpyle4963 жыл бұрын
Love Prettier! But I was just thinking the other day, how cool would it be if Prettier would also reorder your css properties?!
@dimofamo2 жыл бұрын
This! I'm quite consistent with indents but speaking about properties order I'm a mess 😭
@hectorcast9433 жыл бұрын
Hey am about to start my internship about front end development, I know the basic, but didn’t wanna do web development, any tips to give me so I can easily complete projects?
@stevenwilson55562 жыл бұрын
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.
@stevenwilson55562 жыл бұрын
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
@yogiealfin36792 жыл бұрын
But on the video img tag not using /> after format, any clue how to do that?
@stockholm122 жыл бұрын
@@yogiealfin3679 I'm wondering about that too. If anyone has a solution please let us know.
@senior_developer Жыл бұрын
How to do that with Styled-Components?
@yourregularguy43773 жыл бұрын
What if there are missing tags? Does it replace them?
@KevinPowell3 жыл бұрын
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.
@Codewow3 жыл бұрын
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.
@KevinPowell3 жыл бұрын
You can configure it to ignore certain file types. I've had to do that because it plays hell with a few, lol.
@dr8868 Жыл бұрын
This was great explanation.
@logicalfundy2 жыл бұрын
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.
@djmtype Жыл бұрын
Any way to prevent prettier from breaking up minmax values? It puts every number following a comma on its own line - yuk!
@doyourworkout56083 жыл бұрын
Thanks for showing this extension
@majkipl96843 жыл бұрын
im doing automaticly what's that program do
@HenriqueErzinger5 ай бұрын
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.
@tinmancode3 жыл бұрын
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
@f1amesoff2 жыл бұрын
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.
@yvesengt3 жыл бұрын
Does this work for Laravel blade files?
@choudharykeshav6913 жыл бұрын
Can someone please tell theme name
@farzamqureshi13892 жыл бұрын
How to use it for php?
@JimKernix3 жыл бұрын
An unrelated question involving VS Coe: Anyone have their color picker stop working? Mine has and I don't know how to get it back. Any suggestions?
@aryan7069_3 жыл бұрын
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.
@BenRangel3 жыл бұрын
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.
@castlemoyle3 жыл бұрын
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.
@theasianviking863 жыл бұрын
As much as I did love pretty.. it made my life hard when I added certain plugins that also formated my other style of code (example Scss) and because of that I rather go with only SASS formater and use VScode built-in formater
@adrian200653 жыл бұрын
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.
@TokyoXtreme3 жыл бұрын
You can easily set up HTML to be ignored by Prettier.
@kevinwg023 жыл бұрын
I don't bother with format they are many extensions doing it for me. I use prettier as well although sometimes I wonder wtf the parameters are because they seems to change somehow
@KevinPowell3 жыл бұрын
Could be with some setups, they come with a prettier config?
@kevinwg023 жыл бұрын
@@KevinPowell it's usually with some VScode updates
@pranjalroy63963 жыл бұрын
Hi Kevin! How are you doing?
@KevinPowell3 жыл бұрын
I'm doing great, thanks for asking :D
@AfifMChoudhury27 күн бұрын
So I just needed to usr ctrl + S ?????????????????????????? Damn, I was looking for this for stupid amount of hours
@m3awna3 жыл бұрын
prettier doesn't work with php on my machine
@Deriathan13 жыл бұрын
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.
@sonarsphere3 жыл бұрын
Thank you Kevin!
@garymaclaren719110 ай бұрын
Installed. Didn't work.
@DevilMan553 жыл бұрын
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.
@Knards3 жыл бұрын
Semicolons? Yes!
@leenardgalad54483 жыл бұрын
Yup its difficult to format a long code copied from stackoverflow
@amniar81582 жыл бұрын
never give up
@chefbennyj3 жыл бұрын
Tabs over spaces... tap, tap, tap, tap ... 😶 ... tap... 😳 tap... 😖 ... tap... 😬 ... ... ... tap 😆