ESLint with VSCode, Prettier, Husky and React For Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ก.ค. 2024
  • ESLint, Prettier, Husky, VSCode and React for applying different style guides and forcing a specific code style across the whole codebase. In this video, we will go through what is ESLint, Prettier and Husky and how to properly set up to use with VSCode and React with Typescript to get the best modern project setup!
    ⭐ Timestamps ⭐
    00:00 Intro
    00:55 Setting up ESLint
    07:41 Best ESLint Config
    09:39 Linting your Project
    18:49 Overriding ESLint rules
    19:22 Setting up Prettier with VSCode
    21:31 Best Prettier Config
    25:11 ESLint VSCode Helper Extension
    27:49 Git Pre-commit linting w/ Husky
    🧭 Turn Design into React Code | From prototype to Full website in no time
    • Turn Design into React...
    🧭 Watch Tutorial on Designing the website on Figma
    • I Design a onecolor We...
    🧭 Watch Create a Modern React Login/Register Form with smooth Animations
    • Create a Modern React ...
    🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools
    • Debug React Apps Like ...
    🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React
    • Master React Like Pro ...
    🧭 Learn Redux For Beginners | React Redux from Zero To Hero build a real-world app
    • Debug React Apps Like ...
    🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize
    • Build Login/Register A...
    🧭 Introduction to GraphQL with Apollo and React
    • Introduction to GraphQ...
    🐦 Follow me on Twitter: / ipenywis
    💻 Github Profile: github.com/ipenywis
    Made with 💗 by Coderone

ความคิดเห็น • 105

  • @realnanodude
    @realnanodude 2 ปีที่แล้ว +6

    So I was puzzling my ESLint + Prettier + Husky config together and then I found your video. Absolutely love your tutorial. It both confirmed that I was correct with my settings and explained a couple of things that I did not understand right away. Huge thanks!

  • @GoblinBlaster3000
    @GoblinBlaster3000 2 ปีที่แล้ว +1

    Thanks for the great walkthrough! The pace was perfect and the content was informative.

  • @BoazRymland
    @BoazRymland 2 ปีที่แล้ว +1

    Great video - Thanks! Straight to the point, sane defaults, good combination of tools and well explained

  • @georga.9236
    @georga.9236 2 ปีที่แล้ว +1

    Very thorough and on point approach. Keep on rocking!

  • @JakeeReacher
    @JakeeReacher ปีที่แล้ว

    That's the video I was looking for you. Thank you! That helps a lot to understand this topic.

  • @sofiabertomy5389
    @sofiabertomy5389 ปีที่แล้ว

    What a video bro! Can't thank you enough for this!

  • @matteolorenzoni9975
    @matteolorenzoni9975 ปีที่แล้ว

    Really very useful and interesting video. Thank you very much!

  • @RobertThomasrob_thomasa10
    @RobertThomasrob_thomasa10 2 ปีที่แล้ว +3

    Just what I needed!

  • @waili4028
    @waili4028 2 ปีที่แล้ว +1

    great video! this is exactly what i need!

  • @OscarMartinez-nt6zn
    @OscarMartinez-nt6zn ปีที่แล้ว

    Great I just didn't how to make eslint works with prettier altogether but in 21:20 you explained the overriding stuff that I was unaware of! thanks.

  • @erwindelacruz3946
    @erwindelacruz3946 2 ปีที่แล้ว +1

    Good tutorial .Thank you!

  • @leevitammelin1795
    @leevitammelin1795 ปีที่แล้ว

    Hi, I came from Brazil and this is perfect, I'm using after very easy, thanks!

  • @takumi_fuji86
    @takumi_fuji86 ปีที่แล้ว

    Thank you! It’s really helpful video!

  • @JustTrace17
    @JustTrace17 2 ปีที่แล้ว

    Thank you so much! Helped a lot

  • @camilloalexandrebovio9022
    @camilloalexandrebovio9022 ปีที่แล้ว

    This video has a great value!

  • @mylo1997
    @mylo1997 2 ปีที่แล้ว +2

    nice , it what i needed!

  • @madmat8825
    @madmat8825 2 ปีที่แล้ว +1

    Great tutorial!

  • @denisotimguitar
    @denisotimguitar 2 ปีที่แล้ว

    Awesome Work!🔥

  • @itskritz1996
    @itskritz1996 ปีที่แล้ว

    Really nice and helpful... Thanks!

  • @aamiramin6112
    @aamiramin6112 2 ปีที่แล้ว +1

    Amazing video thanks for sharing

  • @sandeeppokhrel
    @sandeeppokhrel 2 ปีที่แล้ว +8

    Yesterday I was struggling for setting up eslint and prettier and today saw this video. Awesome work 👏

  • @softblood1941
    @softblood1941 2 ปีที่แล้ว +1

    amazing video thanks !

  • @muhammadtouhiduzzaman7491
    @muhammadtouhiduzzaman7491 ปีที่แล้ว +10

    when I try to choose popular style guide form Which style guide do you want to follow?, airbnb is missing from list . what should I do now ?

  • @leraymond706
    @leraymond706 2 ปีที่แล้ว

    i really waiting for this video uploaded

  • @theyoussefnassar
    @theyoussefnassar 5 หลายเดือนก่อน

    very helpful, thanks a lot 😄

  • @Nosleepguy
    @Nosleepguy 2 ปีที่แล้ว +1

    so nice and usefull

  • @morale3056
    @morale3056 2 ปีที่แล้ว

    Thanks bloody so much!

  • @quamzgraphix9826
    @quamzgraphix9826 ปีที่แล้ว

    Best video on Eslint + prettier +husky config🥳🥳

  • @prajwalmore7554
    @prajwalmore7554 ปีที่แล้ว

    Thanks. it really helped...!

  • @AlejandroNavarroD
    @AlejandroNavarroD 2 ปีที่แล้ว +1

    Pretty good tutorial

  • @tula1308
    @tula1308 2 ปีที่แล้ว

    Thank a lot for a good video

  • @rahuldotel5983
    @rahuldotel5983 2 ปีที่แล้ว

    Thank you very much bro ..

  • @santiagogarciavazquez6569
    @santiagogarciavazquez6569 ปีที่แล้ว

    Nice, thx guys

  • @tanmayjain19
    @tanmayjain19 2 ปีที่แล้ว

    Great Video, on Point!! Just one thing which i believe you missed out is eslintignore file and it features. I implemented your code but was facing one error which I solved using eslintignore file.

  • @code-island
    @code-island 2 ปีที่แล้ว

    Nice, keep it up

  • @palach_666
    @palach_666 4 หลายเดือนก่อน

    Thanks you🎉

  • @Schweppese
    @Schweppese 2 ปีที่แล้ว +1

    Thanks for the tutorial. Do you mind also dropping the name of the VSCode theme you're using?

  • @longnhat6405
    @longnhat6405 ปีที่แล้ว

    fire!!!!

  • @27sosite73
    @27sosite73 ปีที่แล้ว

    ска топ!
    дякую, братуха

  • @rofin3631
    @rofin3631 ปีที่แล้ว

    thank you so much

  • @DuyTran-ss4lu
    @DuyTran-ss4lu 2 ปีที่แล้ว +1

    Awesome

  • @alihosseini6630
    @alihosseini6630 2 ปีที่แล้ว

    Thanks a lot

  • @donatobaonguis4315
    @donatobaonguis4315 2 ปีที่แล้ว +1

    Will the steps described here in this video work with react-native project as well?

  • @ashutoshbisoyi8074
    @ashutoshbisoyi8074 ปีที่แล้ว

    Pretty helpful. @CoderOne could you please tell me which version of node you were using at this time

  • @nabeelahmed5277
    @nabeelahmed5277 ปีที่แล้ว +3

    Hey I am not getting airbnb suggestion in guideline when i go with Typescript but it works with Javascript

  • @ericdecolsales3066
    @ericdecolsales3066 ปีที่แล้ว +3

    Airbnb it's just not available anymore for eslint with typescript projects since august 10, 2022

  • @noriller
    @noriller 2 ปีที่แล้ว +1

    Another one to add to that is the actual commit message linting.

  • @harishkumarforever515
    @harishkumarforever515 ปีที่แล้ว

    worth your course

  • @CheulongSear
    @CheulongSear 2 ปีที่แล้ว

    I wonder about your opinion on Storybook? When to use when not to?

  • @hbela1000
    @hbela1000 2 ปีที่แล้ว

    Good.thx.

  • @Gangbuster74
    @Gangbuster74 9 หลายเดือนก่อน +1

    can you please make a tutorial on setting up vite with eslint airbnb, typescript, prettier, husky, jest and react testing, with husky precommit lint staged and prePush test runner wit jest? that would be really awesome

  • @paceman
    @paceman 2 ปีที่แล้ว +2

    as far as I know CRA already has lint installed as depedency inside react-script package, and we can just extend/override it inside package.json, adding rules and plugins there and no need to install and configure it from scratch over again

  • @justcoder2868
    @justcoder2868 5 หลายเดือนก่อน

    Thanks for this video great job, 2 questions for you>
    1. Does Husky/linting just run checks on just the files changed i.e. being committed?
    2. do you know if there is an option to remove unused imports with the linting?
    Thanks

  • @sanisahani818
    @sanisahani818 ปีที่แล้ว +3

    I am not able to see the option for Airbnb style guide, it only shows standard and xo

  • @soumenj2
    @soumenj2 5 หลายเดือนก่อน

    Could you please tell me the place from where you are referring the values in "extends" property ?

  • @pradipspeaks9395
    @pradipspeaks9395 ปีที่แล้ว

    For nest ts project which project I have to choose (like in place of your react app).

  • @prathamdubey2363
    @prathamdubey2363 ปีที่แล้ว +1

    Hello, I can't find the Airbnb style guide. What to do?

  • @reikoleci4303
    @reikoleci4303 ปีที่แล้ว

    works

  • @regilearn2138
    @regilearn2138 2 ปีที่แล้ว +3

    Hi Coderone,wow greate video about the react from scratch setup ,I would like to request a react video from you,bcz i know you would definitely do this for youtube developrs,
    my request is please do a react video how to use* All the form components like radio btn, select box,Checkbox,input ,calendar etc* and practically what we use in industry to build apps **without any third part library please only use pure react with hooks***,bcz it will give the clear idea before moving in to formik or any other libruary,i would appreciate if u can use Mongodb for this.

  • @pireus21
    @pireus21 8 หลายเดือนก่อน

    Hello guys! I am a beginner on the field and what i do not understand is the following: Do i have to do these steps every time i start a project and open a file or just once and done with it? Also, where would be recommended to save the file?

  • @dueft4479
    @dueft4479 ปีที่แล้ว

    There are all these amazing tools for formatting or sth. else that makes your life easier. Meanwhile in school, we still have to write code on paper and the teacher is like "You have to know it without the pc" lmao.

  • @JohnnyDickson
    @JohnnyDickson ปีที่แล้ว +3

    Just now getting into linting, code formatting, etc. This video has helped explained a lot of the concepts, but I'm having an issue setting up @eslint/config. For some reason when I try to select a style guide, AirBnB's does not show up. Anyone else experiencing this during the @esling/config init process?

    • @charithagoonewardena3095
      @charithagoonewardena3095 ปีที่แล้ว

      They removed Airbnb from the options. You could go with standard ones

    • @noszczykmichal
      @noszczykmichal ปีที่แล้ว

      @@charithagoonewardena3095 don't agree. For me it's still available. Maybe some issue with versions of dependencies?

  • @naimurrahib5751
    @naimurrahib5751 ปีที่แล้ว

    What’s the theme his using ?

  • @adil88201
    @adil88201 ปีที่แล้ว

    you're as awesome as TraversyMedia

  • @bedirhan7029
    @bedirhan7029 ปีที่แล้ว

    All of my computers got the softwares here. I first install them on virtual environnt to make sure they're not malware. So I can assure

  • @vaishnavis2165
    @vaishnavis2165 7 หลายเดือนก่อน +1

    For me Airbnb is not showing after choosing the guide

  • @heathen838
    @heathen838 2 ปีที่แล้ว +1

    omg who's gonna remember all that

  • @whozsidhant
    @whozsidhant 2 ปีที่แล้ว

    ✖ 158 problems (158 errors, 0 warnings)
    husky - pre-commit hook exited with code 1 (error)
    any solution??

  • @dzhaniivanov5837
    @dzhaniivanov5837 2 ปีที่แล้ว

    lint:fix doesn't work for me ?only shows errors like npm run lint

  • @tranquiloteov
    @tranquiloteov 10 หลายเดือนก่อน

    Awsome video, thanks. But Wow!!! Too much dependencies just for linting. Looks like a nightmare for upgrading conflicts when stuffs get deprecated.

  • @call_me_rusker
    @call_me_rusker 2 ปีที่แล้ว +4

    I have a question, why you don't have to rewrite the "git add ." again when you fix the eslint problem? I mean you changed your file, but you didn't "git add ," but just commit, how did it work?

    • @Sam-yh8yi
      @Sam-yh8yi 2 ปีที่แล้ว

      I have the same question

    • @CoderOne
      @CoderOne  2 ปีที่แล้ว

      If you do "git add ." then make a change to file(s) before commit, only the first changes will be included in the commit. So you'll have to do "git add ." again to include all changes!

    • @Sam-yh8yi
      @Sam-yh8yi 2 ปีที่แล้ว +1

      ​@@CoderOne so this means that husky does not really prevent me from committing malformed code?

    • @julianflorez9972
      @julianflorez9972 2 ปีที่แล้ว +4

      @@CoderOne So when you fixed the problem with prettier and then committed, you actually pushed the 'bad' file ? Sorry it's just a bit confusing 😅

  • @MrMegaFirestarter
    @MrMegaFirestarter ปีที่แล้ว

    Excellent but .. in "extends" - "airbnb" have to be replaced to "airbnb-base" otherwise "ESLint couldn't find the config "airbnb" to extend from."

  • @dogukan5384
    @dogukan5384 ปีที่แล้ว

    SO link is given below!!!

  • @sidokouki670
    @sidokouki670 ปีที่แล้ว

    is it me or node apps doesnt have airbnb guide ?

  • @user-gf9of9lc7c
    @user-gf9of9lc7c 2 ปีที่แล้ว

    I downloaded it for free and get full version

  • @Keshish4
    @Keshish4 6 หลายเดือนก่อน

    while Airbnb style doesn't exist, I ran into several problems, also no repository for this video (at least i couldn't find one)

  • @nantipatsawanglak8084
    @nantipatsawanglak8084 ปีที่แล้ว

    problems and than volu automate the boi cuz I didn’t know how to sidechain. My one buddy produces riddim and he legit saw my daw

  • @necrotikS
    @necrotikS 2 ปีที่แล้ว

    What about the "eslintConfig" that create-react-app automatically inserts in the package.json file? Shouldn't it be removed from it?

    • @CesarDenis
      @CesarDenis 2 ปีที่แล้ว

      You can delete "eslintConfig", it will get the configuration from ".eslintrc.json"

  • @shofahabib3912
    @shofahabib3912 ปีที่แล้ว

    lot during covid.

  • @bibhushankarki9194
    @bibhushankarki9194 2 ปีที่แล้ว

    did he pronounce husky as hashkey? xD

  • @PewDiePie777
    @PewDiePie777 2 วันที่ผ่านมา

    I am sorry, but am I the only one not getting the same ESLint installation he got? I didn't have any style choice, and it also shows, that it is ESLint 1.20.00.
    How do I get what he got?

    • @CoderOne
      @CoderOne  2 วันที่ผ่านมา

      @@PewDiePie777 I was just going through ESLint setup a couple of days ago and it looks like they have changed the setup and installation, actually, they made it easier now using their new CLI, just run the ESLint CLI as per docs and follow the terminal instructions (e.g choosing Typescript or Javacript) and it will do the setup for you.

    • @PewDiePie777
      @PewDiePie777 2 วันที่ผ่านมา

      @@CoderOne Thank you, ima try it next time. Hopefully it helps.

    • @PewDiePie777
      @PewDiePie777 วันที่ผ่านมา

      @@CoderOne I've tried it according to docs as well, but I am still not getting the third option of using my lint to check syntax, find problems, AND enforce code style. Which I am trying to choose, but I am not getting offered this choice. I only have two to pick, from. Which are to check syntax only, or to check syntax, and find problems.
      And it doesn't offer me any options regarding style like Airbnb as well(

  • @kamgdy89
    @kamgdy89 2 ปีที่แล้ว

    No! No any!

  • @geosystems2106
    @geosystems2106 ปีที่แล้ว

    Lintel run command what ???? You guys take some stuff so much granted .. How the hell did you *run* this : > Lintel : ......Visualizer ?? So out of the blue :/

  • @bostonlow4789
    @bostonlow4789 ปีที่แล้ว

    what is the equivalent for npm init @eslint/config in yarn?

  • @natel8578
    @natel8578 ปีที่แล้ว +8

    Any idea why AirBnB style guide is missing from the options in @eslint/config? Google doesn't seem to know.

    • @claudecharles94
      @claudecharles94 ปีที่แล้ว +1

      Same issue here

    • @srdjancoralic2166
      @srdjancoralic2166 ปีที่แล้ว

      same

    • @senturkdev
      @senturkdev ปีที่แล้ว

      same :(

    • @21mighty86
      @21mighty86 ปีที่แล้ว

      Airbnb style doesn’t support typescript officially so when you select typescript option while doing ealint config it will not show airbnb later (sometimes, not sure why it works other times)
      Maybe select no when it asks you if you use typescript

    • @shivk2391
      @shivk2391 ปีที่แล้ว +1

      try running npx eslint --init , for those who don't see airbnb listed during the select style type

  • @BotanicalWonders60
    @BotanicalWonders60 2 ปีที่แล้ว

    thank so much