The Common Coder
The Common Coder
  • 38
  • 21 305
Prettier & ESLint in Visual Studio Code: The Ultimate Guide
Learn how to set up Prettier and ESLint in Visual Studio Code to keep your code looking sharp and error-free!
Prettier and ESLint each have their own role: Prettier ensures your code style is clean and consistent, while ESLint catches errors and enforces JavaScript best practices. However, they don’t always work seamlessly together. In this video, we'll show you how to configure Prettier and ESLint to play nicely and how to optimize Visual Studio Code to get the best out of both tools.
Do you already use Prettier or ESLint in your projects? Let me know in the comments!
📺 SUBSCRIBE FOR MORE!
www.youtube.com/@thecommoncoder?sub_confirmation=1
--------------------------------------------------------------------------
✅ PREREQUISITES
Install Node.js: ➡️ ua-cam.com/video/twsYxYaQikI/v-deo.html
Install VS Code: ➡️ ua-cam.com/video/wx391N_MEgI/v-deo.html
Install ESLint: ➡️ ua-cam.com/video/eieTlMwCwWU/v-deo.html
Using ESLint in VS Code: ➡️ ua-cam.com/video/ycPl2NUFksg/v-deo.html
Install & Configure Prettier in VS Code: ➡️ ua-cam.com/video/_fzbg6_-JuE/v-deo.html
--------------------------------------------------------------------------
📚 ADDITIONAL RESOURCES
Download Node.js: www.nodejs.org
Download VS Code: code.visualstudio.com
Prettier: www.prettier.io
ESLint: eslint.org
--------------------------------------------------------------------------
⏱️ TIMESTAMPS
00:00 - Introduction
00:13 - Prerequisites
00:47 - The End Goal
01:17 - Project Overview
03:58 - Installing the Prettier & ESLint Plugin
06:22 - Demo 1
06:46 - Fixing ESLint Errors on Save
09:08 - Demo 2
09:25 - Final Thoughts
10:02 - Outro
--------------------------------------------------------------------------
🌎 CONNECT WITH ME!
UA-cam: www.youtube.com/@thecommoncoder
Facebook: profile.php?id=61556597704873
Instagram: the.common.coder
X: the_common_codr
LinkedIn: www.linkedin.com/company/the-common-coder
Reddit: www.reddit.com/user/TheCommonCoder
GitHub: github.com/the-common-coder
--------------------------------------------------------------------------
💰 AFFILIATE DISCLAIMER
Some links in this description are affiliate links. If you make a purchase through these links, I may earn a small commission at no extra cost to you. Your support helps keep this channel running. Thank you!
#eslint #prettier #thecommoncoder
Переглядів: 239

Відео

How to Use Prettier with VS Code! (2024 Full Tutorial)
Переглядів 25514 днів тому
Are you tired of messy, inconsistent code? Let's fix that with Prettier and VS Code! Prettier is an opinionated code formatter helps keep your code styling consistent across projects and teams. In this video, we'll walk you through how to use Prettier with Visual Studio Code. First, we'll learn how to install Prettier into our projects via the command line. Next, we'll install and configure the...
The BEST Way to Use ESLint with Visual Studio Code!
Переглядів 32021 день тому
Let's learn the BEST way to use ESLint with Visual Studio Code: The ESLint Extension! ESLint is an essential tool for developers wanting to write clean and error-free JavaScript code. In this video, we'll learn how to bring ESLint's features into Visual Studio Code by installing the official ESLint extension. We'll cover the prerequisites for using the ESLint extension, how to install it into V...
How to Set Up ESLint in 2024 (For Beginners)
Переглядів 1,6 тис.Місяць тому
How to Set Up ESLint in 2024 (For Beginners)
How to Download and Install Node.js in 2024 | Mac & Windows
Переглядів 914Місяць тому
How to Download and Install Node.js in 2024 | Mac & Windows
HTML Elements and Attributes: A Beginner's Guide
Переглядів 125Місяць тому
HTML Elements and Attributes: A Beginner's Guide
Git Essentials in VS Code: A Step-by-Step Guide
Переглядів 1,6 тис.2 місяці тому
Git Essentials in VS Code: A Step-by-Step Guide
How To Deploy a React App on GitHub Pages (Two Different Ways)
Переглядів 2863 місяці тому
How To Deploy a React App on GitHub Pages (Two Different Ways)
Top 5 Must-Know Git And GitHub Commands!
Переглядів 1963 місяці тому
Top 5 Must-Know Git And GitHub Commands!
How to Use GitHub Pages: 2024 Beginner's Guide
Переглядів 3,6 тис.3 місяці тому
How to Use GitHub Pages: 2024 Beginner's Guide
How To Delete and Restore a Repository on GitHub in 2024
Переглядів 563 місяці тому
How To Delete and Restore a Repository on GitHub in 2024
How to Upload Your Project On GitHub in 8 Minutes!
Переглядів 2363 місяці тому
How to Upload Your Project On GitHub in 8 Minutes!
How to Create an SSH Key for GitHub in 2024 | Mac & Windows
Переглядів 3614 місяці тому
How to Create an SSH Key for GitHub in 2024 | Mac & Windows
Git Tutorial: Learn How To Use Git in 23 Minutes!
Переглядів 1044 місяці тому
Git Tutorial: Learn How To Use Git in 23 Minutes!
How to Download and Install Git in 2024 | Mac & Windows
Переглядів 3214 місяці тому
How to Download and Install Git in 2024 | Mac & Windows
How to Create a GitHub Account (For Beginners!)
Переглядів 1865 місяців тому
How to Create a GitHub Account (For Beginners!)
Top 10 VS Code Extensions for Web Developers (And How to Use Them!)
Переглядів 875 місяців тому
Top 10 VS Code Extensions for Web Developers (And How to Use Them!)
Ten VS Code Keyboard Shortcuts Every Developer Should Know!
Переглядів 755 місяців тому
Ten VS Code Keyboard Shortcuts Every Developer Should Know!
Visual Studio Code: An Overview and Tutorial for Beginners!
Переглядів 6815 місяців тому
Visual Studio Code: An Overview and Tutorial for Beginners!
Installing Visual Studio Code on Mac and Windows (Step-by-Step)
Переглядів 1305 місяців тому
Installing Visual Studio Code on Mac and Windows (Step-by-Step)
Understanding HTML Block and Inline Elements!
Переглядів 596 місяців тому
Understanding HTML Block and Inline Elements!
How To Validate HTML Code - What You Need To Know
Переглядів 466 місяців тому
How To Validate HTML Code - What You Need To Know
What is HTML: Exploring the Basics
Переглядів 446 місяців тому
What is HTML: Exploring the Basics

КОМЕНТАРІ

  • @Ahmed.Hadjou
    @Ahmed.Hadjou 2 години тому

    Awesome tutorial! keep up the great work!

  • @amanshaw5846
    @amanshaw5846 4 дні тому

    Thanks for the video

  • @ExpertZainab
    @ExpertZainab 4 дні тому

    What about this

  • @itachiuchiha1734
    @itachiuchiha1734 8 днів тому

    finally, simple straight forward tutorial, thanks man

  • @StephenRayner
    @StephenRayner 8 днів тому

    Biome………………………….

    • @thecommoncoder
      @thecommoncoder 7 днів тому

      I haven’t had a chance to use Biome yet, but I’m going to check it out and will probably make a video on it. StandardJS is another good option too if you want something that’s just plug and play. Thanks for the comment! 🙏

  • @theVegan47
    @theVegan47 10 днів тому

    Another amazing video. This is gold! Thanks.

    • @thecommoncoder
      @thecommoncoder 9 днів тому

      Happy to help! Thanks for checking out my videos! 🙏

  • @theVegan47
    @theVegan47 10 днів тому

    Great extensions. Thank you! I'm doing the Odin Project course and these extensions are quite helpful along with the course and general development.

  • @theVegan47
    @theVegan47 10 днів тому

    Great keybindings. Learn a few new ones. Thank you!

    • @thecommoncoder
      @thecommoncoder 9 днів тому

      Awesome! I've found that getting familiar with keyboard shortcuts makes a big difference in my overall workflow. Thanks for watching! 🙏

  • @theVegan47
    @theVegan47 10 днів тому

    Great video! Thank you for this straight to the point video with useful tips. I was confused by older videos and even chatGPT trying to help me set this up as they refer to older versions and file types. Subbed!

  • @arthurmuthee7303
    @arthurmuthee7303 10 днів тому

    The best Visual Studio and Github Masterclass you will ever find on the internet. Simple yet highly actionable.

  • @arthurmuthee7303
    @arthurmuthee7303 10 днів тому

    Best Visual Studio and Github Masterclass ever. Simple and very actionable tutorial that I highly recommend.

  • @user-tx4wj7qk4t
    @user-tx4wj7qk4t 11 днів тому

    My understanding is that eslint-config-prettier is no longer needed

    • @thecommoncoder
      @thecommoncoder 11 днів тому

      @@user-tx4wj7qk4t You don’t need to explicitly set up “eslint-config-prettier” anymore, but you do need to install it as a dependency otherwise “eslint-plugin-prettier” will throw an error.

    • @user-tx4wj7qk4t
      @user-tx4wj7qk4t 11 днів тому

      @@thecommoncoder since 9.0 eslint doesn't have formatting rules anymore and the lead maintainer of typescript recommends against `eslint-config-prettier` in his article "You Probably Don't Need eslint-config-prettier or eslint-plugin-prettier"

    • @thecommoncoder
      @thecommoncoder 11 днів тому

      @@user-tx4wj7qk4t I tried to use the plugin without the config, but I got an error that the plugin was missing. You can probably get by without either these days, but some people use 3rd party or platform level ESLint configs that enable rules that are depreciated. It’s still to know how setup prettier’s recommend config so that they play nice together.

    • @user-tx4wj7qk4t
      @user-tx4wj7qk4t 10 днів тому

      @@thecommoncoder I mean the whole thing was always a mess and has been even more so since 9.0. really most people should just switch to biomejs at this point

    • @firedforfighting
      @firedforfighting 8 днів тому

      @@user-tx4wj7qk4t I am stoked you made this comment! I just tried biomejs and I will not be going back to eslint/prettier!!..free at last 🙌

  • @thecommoncoder
    @thecommoncoder 11 днів тому

    Any questions on using Prettier & ESLint with VS Code? Let me know! 👇

  • @user-tx4wj7qk4t
    @user-tx4wj7qk4t 11 днів тому

    Does CSS Peek have any real use for tailwind? I think the tailwindcss extension handles all of that right?

    • @thecommoncoder
      @thecommoncoder 11 днів тому

      @@user-tx4wj7qk4t I’ve only played with Tailwind a little bit, but from the looks of it, it seems like you only need the Tailwind extension if thats how you are working with CSS in your projects.

  • @user-tx4wj7qk4t
    @user-tx4wj7qk4t 12 днів тому

    Thank you for the video but in practice it is significant more complicated. First of all you have to enable flat config in vscode to prevent issues (many many things are broken in general in the ecosystem because of this), you need to combine it with typescript since most people use that as well as a number of other extremely common plugins and it leads to 10+ dependencies installed an a very different looking config file. That's not even mentioning framework integrations like astro or mega linters like Trunk

    • @thecommoncoder
      @thecommoncoder 12 днів тому

      @@user-tx4wj7qk4t Definitely agree that most setups are usually more complicated than this. A lot of the JavaScript ecosystem is needlessly complicated IMO, so I’m mainly trying to break down some of the individual pieces in simple ways to help people understand the fundamentals. Thanks for the feedback! 🙏

    • @user-tx4wj7qk4t
      @user-tx4wj7qk4t 12 днів тому

      @@thecommoncoder it is because js isn't an intelligently designed language and is very imperative so it needs all of its faults made up for. In haskell or purescript you barely need any tooling because the language is inherently solid. With that being said a video on typescript integration with eslint would be fairly helpful. Particularly strict typing

  • @user-tx4wj7qk4t
    @user-tx4wj7qk4t 13 днів тому

    Thank you for the video but this tool isn't very practical. Do you know of an alternative? I found HTMLHint is popular and has a vscode extension. And eslint has a plug-in called @eslint-html. Neither seem to be as picky as the wc3 validator though. Also the other issue is that people often don't directly use html files anymore but files like .Astro which contain HTML in them

  • @lite_anime
    @lite_anime 19 днів тому

    Bro do a video of setting up eslint + prettier with typescript

    • @thecommoncoder
      @thecommoncoder 19 днів тому

      @@lite_anime thanks for the suggestion! I’ll add that to my list. 🙏 It shouldn’t be too different than the regular JS setup, but you’ll probably need the TypeScript plugin for ESLint.

  • @thecommoncoder
    @thecommoncoder 19 днів тому

    Are you team tabs or spaces? Let me know! 👇

  • @Neosilvium27
    @Neosilvium27 22 дні тому

    I’m probably gonna need this so ima save this for later :D

  • @BrianCullen85
    @BrianCullen85 24 дні тому

    Great video. Is there a way to visualise the branches?

    • @thecommoncoder
      @thecommoncoder 24 дні тому

      I’ve always used the GitLens extension in the past, but it’s changed a lot over the years and they charge for the premium features. I see a lot of folks recommending GitGraph these days (also an extension). Hope that helps!

    • @user-tx4wj7qk4t
      @user-tx4wj7qk4t 12 днів тому

      ​@@thecommoncoderA gitlens video would be great.

  • @FloorMann
    @FloorMann 26 днів тому

    first

  • @wanmohdazwanwanazman7688
    @wanmohdazwanwanazman7688 26 днів тому

    Are you included in the good cops too?

    • @thecommoncoder
      @thecommoncoder 26 днів тому

      I'm confused. What does this mean? 😆

  • @thecommoncoder
    @thecommoncoder 27 днів тому

    Are you using ESLint in your projects? Let me know! 👇

  • @sergiocely10-dev
    @sergiocely10-dev Місяць тому

    Thank you for the video, it was very helpful.

  • @ZachPerrySwift
    @ZachPerrySwift Місяць тому

    Finally an easy, simple tutorial to follow. Thankyou!

  • @thecommoncoder
    @thecommoncoder Місяць тому

    What else would you like to learn about ESLint? Let me know! 👇

    • @olabanjoolakunori5151
      @olabanjoolakunori5151 22 дні тому

      Formatting imports and using the plugins that helop do that. Great video btw

    • @thecommoncoder
      @thecommoncoder 20 днів тому

      @olabanjoolakunori5151 I'm working on a video about prettier right now, and then I'll follow that one up with a video about using ESLint and Prettier together to do some auto formatting. Thanks for watching!

    • @olabanjoolakunori5151
      @olabanjoolakunori5151 20 днів тому

      @@thecommoncoder That's superb, thank you🙏🏾

  • @christopherlyons7613
    @christopherlyons7613 Місяць тому

    Question. In video #3 (How to Upload Your Project) you didn't do the configuration first. Does this configuration need to be done in order for the video #3 steps to work properly?

    • @thecommoncoder
      @thecommoncoder Місяць тому

      Good question! This video and the upload project video are loosely related, but are more or less independent topics. This video focuses more on the essential commands for working with GitHub, while the other video is more about taking an existing project on your computer and putting it up on GitHub. There is definitely some overlap though. 👍

  • @christopherlyons7613
    @christopherlyons7613 Місяць тому

    Question. If I want to have my Git account accessible by anyone (I'm an instructor and want to have my students access this account to get code & files stored there) do you still have to create an SSH key? Would that require anyone accessing the account to go through the SSH creation process first? Appreciate any info. Thanks.

    • @thecommoncoder
      @thecommoncoder Місяць тому

      @@christopherlyons7613 Great question! As long as your repositories are public, students will have read-only access to any code within the repository (even without an SSH key or a GitHub account). They can either clone the repo using HTTPS, the GitHub CLI, or by downloading the repo as a zip file. The SSH key becomes important when you are creating your own repositories, or you are a contributor to another repository and GitHub needs to know who you are. Hope that helps!

    • @christopherlyons7613
      @christopherlyons7613 Місяць тому

      ​@@thecommoncoderGreat thank you. So if I create a PUBLIC repository then anyone can download (CLONE) the repository regardless of SSH key status, correct? Now what happens if I create a PRIVATE repository? Which I'm leaning to since I'd rather restrict access just to my students (but I wouldn't want to have them create SSH keys and require me to add/delete all that for every class). This is where a userid/password seems to make more sense for my use case. Is there any way to configure it to work the way I want?

    • @thecommoncoder
      @thecommoncoder Місяць тому

      @christopherlyons7613 For a private repo, you'll have to grant each student access to the repo. Students would need to setup an SSH key for read-only access in that case, but that doesn't require anything to be done on your end. However, you will have to manually add the list of students to the repository though, which can be tedious depending on the number of students. For some additional context, SSH keys are computer/account specific. This means that each student would manage their own SSH key(s) for their GitHub Account. It essentially sets up the authentication between their computer and their GitHub account so you don't have to put in a username/password each time something on your computer interacts with GitHub (command line, VS Code, GitHub Desktop, etc).

    • @christopherlyons7613
      @christopherlyons7613 Місяць тому

      @@thecommoncoder K. Is there any way to setup a PUBLIC repo that you can restrict who can gain access? Guess that doesn't really make sense but I think what I need to do will be easiest to handle with a PUBLIC repo but I'd like to limit that to just class students. I don't want to take them through SSH setup nor really require them to have a Git account to access the files. I could also just do this through a shared cloud drive. But I wanted to at least introduce them to Git & GitHub and thought this would be a way to do that.

    • @thecommoncoder
      @thecommoncoder Місяць тому

      @christopherlyons7613 Not that I'm aware of. I feel like you run the same risk either way with a public repo or a shared cloud drive link. That link could theoretically be shared with anyone just the same as a link to the repository. It think the best option in this case would be a public repo if you don't want to manage access.

  • @architsingh1572
    @architsingh1572 Місяць тому

    I have downloaded the node.js but it is not running javascript code .

    • @thecommoncoder
      @thecommoncoder Місяць тому

      Are you able to run "node -v" in the command line and see the version? If not, you might want to try re-installing and/or restarting your computer. If the above command works, how are you trying to run your JavaScript code? To run code in a JavaScript file, you'll need to type "node path/to/javascript/file.js" in the command line in order to run it. Usually, you'll want to navigate to the location of your project with the command line, and then run your project files from there. For example, if your project was in "~/Documents/Code/MyProject" and your JavaScript file was called "index.js", you'd want to first navigate to the project folder using "cd ~/Documents/Code/MyProject", then run "node index.js" whenever you wanted to run your code. Hope that helps!

    • @architsingh1572
      @architsingh1572 Місяць тому

      @@thecommoncoder Thanks 😀

    • @Sa33d215
      @Sa33d215 Місяць тому

      I can't run it I got a message saying to run the file in a shell now I try to run it and an error message came up. please help me

  • @thecommoncoder
    @thecommoncoder Місяць тому

    What else would you like to learn about Node.js? Let me know! 👇

  • @VictorVictory-te2ij
    @VictorVictory-te2ij Місяць тому

    Thanks for going in-depth with your explanations. Looking forward to more of such trainings from you! Keep it up Sir!

    • @thecommoncoder
      @thecommoncoder Місяць тому

      You're very welcome. Thanks for watching! 😊

  • @thecommoncoder
    @thecommoncoder Місяць тому

    What else would you like to learn about HTML? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 2 місяці тому

    What else would you like to learn about Git and VS Code? Let me know! 👇

    • @drivetrainerYT
      @drivetrainerYT Місяць тому

      Please do more, Really dense and practical delivery, thank you

    • @thecommoncoder
      @thecommoncoder Місяць тому

      @drivetrainerYT Thats the plan! Thanks for watching 🙏

  • @BytesByBlinken
    @BytesByBlinken 2 місяці тому

    thanks. I was able to deploy my first page this way. Love the video

    • @thecommoncoder
      @thecommoncoder 2 місяці тому

      That’s awesome! Glad it was helpful. 😊

  • @thecommoncoder
    @thecommoncoder 3 місяці тому

    What else would you like to learn about GitHub Pages? Let me know! 👇

  • @georgelep7031
    @georgelep7031 3 місяці тому

    Please do one custom Domains

  • @cbbcbb6803
    @cbbcbb6803 3 місяці тому

    What exactly does lightweight mean? Need a tutorial for vscode on Linux too.

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      In this context, “lightweight” just means that it’s not very resource intensive on your machine. Its main focus is on the code, but it can be customized and extended based on what types of projects that you are working on. Other editors offer a more “all in one” solution, but they are usually more resource intensive, take up more disk space, and are specific to a certain type of development. Most of what is in this video should apply to Linux as well, but any keyboard shortcuts might be a little bit different.

  • @arunbalakrishnan8978
    @arunbalakrishnan8978 3 місяці тому

    All the best for your new channel. Make some unique videos. will get lot of followers..

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      Thanks man! I appreciate the kind words. 🙏

  • @samuelstefansalvatierra6894
    @samuelstefansalvatierra6894 3 місяці тому

    do you need to upgrade your github to access pages?

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      Nope! You can use GitHub Pages with a standard GitHub account. That's what I'm using in this video. 😁

  • @thecommoncoder
    @thecommoncoder 3 місяці тому

    What else would you like to learn about Git and GitHub? Let me know! 👇

  • @souvikroy14
    @souvikroy14 3 місяці тому

    It would be great if you also provide the git commands in form of pdf for future reference

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      That's a really good idea! I think a gist or something similar might actually work better than a PDF, that way it's easy to copy and can be updated if needed. 👍

  • @souvikroy14
    @souvikroy14 3 місяці тому

    Bro keep up the good work 👍

  • @TheKingofparis148
    @TheKingofparis148 3 місяці тому

    good content like the video gained a sub! will watch more of your content

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      Thanks for the sub! 🙏 I'll be making a video soon about essential Git commands when working with GitHub, which will include things like "git clone", "git pull" and "git push".

  • @thecommoncoder
    @thecommoncoder 3 місяці тому

    What else would you like to learn about GitHub Pages? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 3 місяці тому

    What else would you like to learn about GitHub? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 4 місяці тому

    What else would you like to learn about Git and GitHub? Let me know! 👇

    • @nepovlog7703
      @nepovlog7703 3 місяці тому

      Every essential basic thing such as fork, clone, push, and public repository for beginners and intermediate levels.

    • @thecommoncoder
      @thecommoncoder 3 місяці тому

      I've got a Git tutorial on my channel that goes over the basics, but it doesn't get into the GitHub specific commands. I plan on making a video about the GitHub Flow soon, which will cover things like cloning, branching, pushing, merging and pull requests. Here's the Git tutorial if you are interested: ua-cam.com/video/O4zb_bLRdPE/v-deo.html

  • @thecommoncoder
    @thecommoncoder 4 місяці тому

    What else would you like to learn about GitHub? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 4 місяці тому

    What else would you like to learn about Git? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 4 місяці тому

    What else would you like to know about Git? Let me know! 👇

  • @thecommoncoder
    @thecommoncoder 5 місяців тому

    What else would you like to know about GitHub? Let me know! 👇