VSCode ESLint, Prettier & Airbnb Style Guide Setup

  Рет қаралды 297,491

Traversy Media

Traversy Media

5 жыл бұрын

In this video we will setup linting with the Airbnb style guide for clean and consitent JavaScript code in VSCode
Commands & Config:
gist.github.com/bradtraversy/...
Sponsor: Freelancer Bundle (Use "brad25" for 25% off)
studywebdevelopment.com/freel...
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Courses
www.traversymedia.com
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia

Пікірлер: 184
@shahab1
@shahab1 Жыл бұрын
WHO would have taught these things to an isolated self-taught programmer like me , in this subtly and thoroughly way, except you Brad? owe you a lot, thank you my man 🙏🙏🙏🙏🙏
@SimPwear84
@SimPwear84 3 жыл бұрын
A very talented teacher! Everytime I get lost or stuck, I always watch your videos. A lot of people make it harder than in needs to be. Thanx Brad
@NoorMuhammad-dt7kf
@NoorMuhammad-dt7kf 4 жыл бұрын
My supervisor asked me to learn ESlint for a project we are working on and you publish the tutorial. Thanks alot
@sydrawat
@sydrawat 5 жыл бұрын
This was explained so beautifully, I'm losing my mind!
@rosst8300
@rosst8300 5 жыл бұрын
Brad, you're the man! I've been searching for this guide and couldn't find anything with good quality.
@foxjonesofficial
@foxjonesofficial Жыл бұрын
same
@busyrand
@busyrand 4 жыл бұрын
This is Exactly what I need right now. Looking to switch to a new Development Machine and will be reconfiguring my entire setup. Thanks a million for this!
@sobi1003
@sobi1003 4 жыл бұрын
instead of installing eslint globally to run `eslint --init` you one can just run `npx eslint --init` (assuming using npm version >= 5.20) which does the same using the project's locally installed eslint bin
@welcometomycrucifixion9881
@welcometomycrucifixion9881 4 жыл бұрын
before this video, i couldn't understand eslint at all, now it's clear, thanks for good explanation.
@josephspinelli239
@josephspinelli239 2 жыл бұрын
Thanks a million for this video. I needed to set up the "prefer-arrow-callback" rule, but couldn't find the syntax for the rules section of the .eslintrc file. Simply outstanding!
@MistaT44
@MistaT44 4 жыл бұрын
last year I thought this tutorial is not for me. Now when I'm exploring and need these things and look up for them, Brad has got a video for every thing u will need.
@spacelover3536
@spacelover3536 2 жыл бұрын
Hey brother I'm new with vs code and I'm struggling to set up it I'm still not comfortable with vs code plz suggest me vs code full tutorial vdeo
@rachidgharib6661
@rachidgharib6661 Жыл бұрын
Man....I love the way you write code.... Very clean and logical
@Mo-Osman
@Mo-Osman 4 жыл бұрын
Brad YOU ARE THE BEST MAN ^^, Best wishes, all the way from Sudan ^^
@roman_mf
@roman_mf Жыл бұрын
Superb, just what I needed! Thank you for awesome content as always.
@alecprologg
@alecprologg 2 жыл бұрын
Feeling so relieved each time I hit your « T » logo on the search engine! Thanks Brad!
@fespamo
@fespamo Жыл бұрын
Brad's tutoarial are really exceptionnal
@UstadJi
@UstadJi 5 жыл бұрын
Brad Is Awesome, Everything With You Looks Easy I Mean Very Easy :)
@Hacking-NASSA-with-HTML
@Hacking-NASSA-with-HTML 4 жыл бұрын
Thanks, Brad! You are fire, as always! 👍
@MistaT44
@MistaT44 5 жыл бұрын
Just what I was looking for. You’re a mind reader Brad! Awesome video as always
@BrendanMetcalfe
@BrendanMetcalfe 4 жыл бұрын
Excellent vid! How do you guys put out so much good stuff :P
@khalidelgazzar
@khalidelgazzar Жыл бұрын
Great video & very informative demo. Thank you
@2one2one2one
@2one2one2one 4 жыл бұрын
if youre lazy (like you should): npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node npx install-peerdeps --dev eslint-config-airbnb
@Lucas-md8gg
@Lucas-md8gg 4 жыл бұрын
Will these commands install the Airbnb Guide locally of globally?
@kyusungpark8346
@kyusungpark8346 4 жыл бұрын
@@Lucas-md8gg I would like to know as well
@mohamedelidrissi2839
@mohamedelidrissi2839 4 жыл бұрын
@@kyusungpark8346 they will install locally
@maplestoryinchinese
@maplestoryinchinese 3 жыл бұрын
ty
@mohammdkarimi875
@mohammdkarimi875 7 ай бұрын
Thanks brad for this amazing video, you significantly help me ♥
@ViewtifulNAMinates
@ViewtifulNAMinates 4 жыл бұрын
Years I waited for this
@oussamasethoum2755
@oussamasethoum2755 4 жыл бұрын
Thank you very much brad ❤❤❤.
@dazecm
@dazecm 3 жыл бұрын
Hey Brad. Thanks for this. It helped me get my dev environment set up with fewer pain points. At 12:44 you explain the 'newline-after-import' rule that you like. I can see that I get the linting to show up but is there a way to have either ESlint or Prettier auto-format the document to take care of this like it can with inserting semi-colons and other good formatting help on save? I suspect getting Prettier to do this is problematic considering it's so 'opinionated' and does not allow custom rules, so is there a way to tell Eslint to handle it using its formatting capabilities?
@MisterNorthernCanuck
@MisterNorthernCanuck 5 жыл бұрын
I have no idea if you've done anything similar before, and if so I'd love a link :) If not then would you consider a tutorial on how to setup different environments for prod, dev, accept, etc. in an easy to follow way? Thank you sir!
@koodauskanava9096
@koodauskanava9096 4 жыл бұрын
This is very good video. Thank you.
@sarahmattar
@sarahmattar 4 жыл бұрын
YES YES YES!!! Prettier config and setup for VS Code and Sublime Text and ... well, any code editor is one of the most underexplained topics out there. There's literally one blog article I found on how to do it, and that was it. I had no idea AirBNB had become a thought leader on code formatting, the only thing I'd used in the past is the Enzyme library for writing user tests.
@modupeadebayo755
@modupeadebayo755 5 жыл бұрын
Hey brad!! Two videos in a week 😎😎😎
@pythonolog8550
@pythonolog8550 4 жыл бұрын
Thank you so much Brad..
@rsrini7
@rsrini7 5 жыл бұрын
Thanks Brad. Would like to see React using CRA without ejected + eslint + prettier + airbnb
@thiagozanluca686
@thiagozanluca686 4 жыл бұрын
Thanks guy. You are just great.
@GauravSingh-st5sd
@GauravSingh-st5sd 4 жыл бұрын
1 million subs coming soon!!
@bored833
@bored833 4 жыл бұрын
thank you SO MUCH!!!
@AsToNlele
@AsToNlele 5 жыл бұрын
Thanks Brad!
@JoeWong81
@JoeWong81 4 жыл бұрын
Thanks a lot Brad
@exactzero
@exactzero 3 жыл бұрын
The no console rule is very useful if you're on the browser environment. The many times I've left some console logs in production.
@basakulcay9866
@basakulcay9866 4 жыл бұрын
This was. very helpful, thank you so much! One question though - do I need to follow these steps for every project individually or is there a way to run the same settings for every project I am working on once I run VSCode?
@user-yd7db3wd7w
@user-yd7db3wd7w 4 жыл бұрын
You can inherit node modules and just copy the json file with configuration
@perc-ai
@perc-ai 5 жыл бұрын
We need a SSR (NextJS) with React Hooks Course!!!
@alokranjan476
@alokranjan476 Жыл бұрын
Thanks a lot again.
@akshayawate7239
@akshayawate7239 4 жыл бұрын
BRAD you are GREAT!
@RonWaller
@RonWaller 4 жыл бұрын
Thanks Brad, Curious the errors for empty line after a require statement and a space with comments. Those seem like styling errors that Prettier could/should fix. Can you set it up to fix those on save?
@senthilkumar76
@senthilkumar76 5 жыл бұрын
Thanks for the great video..! Does this config works for typescript as well? If not can you please guide on the Airbnb config for typescript Thanks a lot
@jaysonverana8839
@jaysonverana8839 4 жыл бұрын
subbed! thanks!
@rahalmehdiabdelaziz8121
@rahalmehdiabdelaziz8121 Жыл бұрын
And another great video 👍
@arseneeich5635
@arseneeich5635 2 жыл бұрын
just brilliant
@kacem3167
@kacem3167 5 жыл бұрын
thank you like a lot!!
@DennyTim403
@DennyTim403 5 жыл бұрын
Bred, when will you release the video about algorithms and data structure?
@jmmacatangay154
@jmmacatangay154 4 жыл бұрын
do you need it to install inside a folder in which the project you are creating? or if you do this it will apply in all projects that you'll be doing?
@RonWaller
@RonWaller 4 жыл бұрын
Is it possible to have VS Code handle the linting and formatting instead of using config files?
@dharmang
@dharmang 3 жыл бұрын
I like double quotes. Should i be using the airbnb style you mentioned? 🤔 Dunno if i can disable one thing
@drewbird87
@drewbird87 5 жыл бұрын
Do all of the settings remain globally or do they need to be copied for each project.
@novailoveyou
@novailoveyou 4 жыл бұрын
Thanks!
@steviegillen82
@steviegillen82 Жыл бұрын
Hi Brad. I am currently learning React with your Udemy course. I have seen Vite being used in place of CRA. Can this setup be applied to a project that has been created using Vite?
@Tesla-kt5lo
@Tesla-kt5lo 4 жыл бұрын
Thanks for the Awesome Tutorial! Beginner question: Should I config this one time for all my projects or I need to repeat the entire process for each project i am working on?
@renovatiovr
@renovatiovr 4 жыл бұрын
did you manage to configure and get everything working?
@aliasalias510
@aliasalias510 5 жыл бұрын
Wow just a week ago I had some problems, setting up exactly this kind of thing in VSCode and now there is a video of my favourite online tutor about it. Maybe I will start believing in god now.
@roei133
@roei133 4 жыл бұрын
BEST OF THE BEST !!
@danvilela
@danvilela 4 жыл бұрын
Is it important to let the rule that must use comma? (;) how do you feel about this?
@MikeyFEonline
@MikeyFEonline 4 жыл бұрын
I'm getting an error when i'm adding the Airbnb, Eslint & Prettier setup to my Gatsby project. And it begins at the 1st line of my project; 'import React from "react"'. The error shows: 'import and export may appear only with 'sourcetype: module'. Can you help me out Brad or someone else?
@DrazV2
@DrazV2 4 жыл бұрын
Recap, I still recommend you watch the video, it contains valuable information! 1. Install ESLint and Prettier VS Code extensions 2. npm init -y 3. npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node 4. npx install-peerdeps --dev eslint-config-airbnb 5. Create .prettierrc config file 6. node_modules/.bin/eslint --init, to create eslint config file 7. esit eslint config file, { "extends": ["airbnb, "prettier", "plugin:node/recommended"], "plugins": ["prettier"], "rules": { "prettier/prettier": "error", }, }
@sergeytarasevich2285
@sergeytarasevich2285 3 жыл бұрын
good job!
@tamasmolnar4157
@tamasmolnar4157 2 ай бұрын
Hi Brad, ESLint 9.0.0 is out (breaking changes). If you have time/will, please make a video on ESLint and Prettier in a node.js typescript project (e.g. Nest.js). It would be really appreciated. Thanks in advance.
@TrueJournal
@TrueJournal 3 жыл бұрын
I had a question... Do I have to do this manually every time for another project, or can I change all these settings globally?
@gorgin_dev
@gorgin_dev 2 жыл бұрын
i think it's good way to keep configurations locally for every project. but to prevent waste of time you can copy .eslintrc.{json, js , ...} and paste to your new project. as well as there are many ready to use configuration available exits on then internet (for example airbnb has one of them)
@willyhorizont8672
@willyhorizont8672 2 жыл бұрын
thank you
@designer6219
@designer6219 4 жыл бұрын
Do we need to both eslint and prettier installed on VS code or just config file is enough?
@terry.chootiyaa
@terry.chootiyaa 5 жыл бұрын
*HI Brad can you make more videos on advance parallax websites..thanks*
@tony-k
@tony-k 4 жыл бұрын
Thanks for the guide but why did you install ESLint for the second time (globally)? Just to be able to run 'eslint --init' and generate config file? You can generate it when you have local installation as well. Just run './node_modules/.bin/eslint --init'
@ricardocnn
@ricardocnn 2 жыл бұрын
Do I have to install all npm packages in every project or just type eslint --init?
@allemeshov
@allemeshov 4 жыл бұрын
Hello, what should I do to use Eslint in any .js files in vs code?
@sohaibali7678
@sohaibali7678 4 жыл бұрын
awesome man
@Oswee
@Oswee 5 жыл бұрын
What about making some CI/CD videos? OpenShift setup and management? Libvirt. Networking. Basically how to deploy all this fancy-shmancy prettified stuff we are learning there all the time.
@alexmachin1785
@alexmachin1785 4 жыл бұрын
The video was great, Im just annoyed I needed to install a11y, react and react hooks plugins even though Im using the prettier config in a node enviroment grrr.
@dan-carlton
@dan-carlton 8 ай бұрын
so do you have to follow these steps on each project? or is there a way to have these be the global settings?
@squeezeb58
@squeezeb58 4 жыл бұрын
How did you do that auto fill for app.listen When I enter ctrl + space, nothing comes up. no autofill. I even have the setting turned on for suggestions.
@AnnaKobayasi
@AnnaKobayasi 4 жыл бұрын
I’m working on your Full Stack React series. I get all my HTML tags in different lines, even if it is in print width like 50words. It’s really hard to read. I did research for whole day but can’t find why. Anyone know?
@TomGrubbe
@TomGrubbe 2 жыл бұрын
Using a .prettierrc is a must if you're working with a team in order to coordinate your settings.
@TheNamesJT
@TheNamesJT 3 жыл бұрын
I'm getting an error. I did this 10:56 and nothing is showing up inside problems console and when i click eslint icon at the buttom right it says "Failed to load config "airbnb" to extend from location folder". Update: I figured it out it was because I installed the airbnb base and it has to extend airbnb-base inside the eslintrc. I'm also surprized you didn't mention eslintignore to ignore node and json paths. Anyways those were the only issues aside from this solid video.
@Cmxmxmmx7
@Cmxmxmmx7 4 жыл бұрын
Which key you use for single quotes on mac?
@TutoDS2014
@TutoDS2014 4 жыл бұрын
Hi. Can help me to set a eslint to a NodeJS project with TypeScript and Koa please?
@048593246
@048593246 3 жыл бұрын
Do we always have to run and install all these npm packages manually?
@gcasanas1
@gcasanas1 4 жыл бұрын
Since eslint got installed locally one can do node_modules/.bin/eslint --init instead.
@toofanicoder
@toofanicoder 5 жыл бұрын
Brad 😎♥️🤗😍🤗🤗🤗 Love 🇮🇳🇮🇳🇮🇳
@infiltretor287
@infiltretor287 3 жыл бұрын
Can you help when Prettier isn’t working on save? I’ve checked it and made it my default formatter.
@xXDani6540Xx
@xXDani6540Xx 2 жыл бұрын
can you remove "plugin:" from "plugin:node/recommended" in "extends" and move it to plugins or is that not the same?
@JobaerArman
@JobaerArman 4 жыл бұрын
Thank you for your tutorial. But I'm still struggling to setup properly. Global eslint doesn't seem to work. Every project needs local eslint. I'm also trying to setup airbnb base config with prettier for my node-express project. Now prettier is linting the .eslintrc file and showing double quote warnings. Created an ignore file to solve that. Would you please confirm if this guide still works with the latest package versions? Thank you.
@user-yd7db3wd7w
@user-yd7db3wd7w 4 жыл бұрын
I've spotted the same problem lmao. I set eslint globally with js modules and now it conflicts with my webpack configuration, eslint-disable doesn't help. Idk how I'm supposed to backup ahahhaha
@spacelover3536
@spacelover3536 2 жыл бұрын
Hey brother I'm new with vs code and I'm struggling to set up it I'm still not comfortable with vs code plz suggest me vs code full tutorial vdeo
@pireus21
@pireus21 7 ай бұрын
I am a beginner on the field and what i cannot understand is if i have to do these steps all the time before starting a project or just once?
@ESMugilan
@ESMugilan 4 жыл бұрын
do we have to do this each time for new projects ?
@robertoaleydon3044
@robertoaleydon3044 3 жыл бұрын
Yeah
@kamranjaved5583
@kamranjaved5583 4 жыл бұрын
Brad i like your courses very much ..... I m from india and i watch your video and fall love with your style.... Please brad can you make a course in udemy which contain react redux and admin dashboard..please or you may have a future plan to make such ..please tell me...no course is available like this.....i love to buy if you will make it
@KeepItFresh02
@KeepItFresh02 5 жыл бұрын
nice
@PC-tk7uv
@PC-tk7uv 4 жыл бұрын
how about in atom setup brad?
@KleberJS
@KleberJS 4 жыл бұрын
Does anyone know how to disabled on Prettier the action about lines break in array and object? I want to keep this const: array = [1 ,2, 3]; but when I save I have: const array = [ 1, 2, 3 ];
@bestchoice7431
@bestchoice7431 Жыл бұрын
Can you please set up ESLint, Airbnb, and prettier in the MERN app? Because when I set up these on the backend, it doesn't work on the client site(react). How could I solve this issue?
@newtontavengwa291
@newtontavengwa291 3 жыл бұрын
hie Brad, i have this error in my code "Parsing error: Unexpected token =>eslint" how can i get rid of it
@asc_near
@asc_near 5 жыл бұрын
It's saying npm: command not found. I'm on a windows computer and i've installed node.js Any other video's i need to watch first or anything you can suggest? I went to the npm documentation but its still confusing me.
@fringebravosky4426
@fringebravosky4426 5 жыл бұрын
Add nodejs folder to PATH will solve this problem
@josephelgazar4229
@josephelgazar4229 5 жыл бұрын
1 view. 12 likes. Souds about right 😂
@TraversyMedia
@TraversyMedia 5 жыл бұрын
Haha
@iamvishu591
@iamvishu591 5 жыл бұрын
Make a video on the lodsh?
@epickelok
@epickelok 5 жыл бұрын
Can everyone please explain to me what's the difference between extends and plugins in eslint?
@modupeadebayo755
@modupeadebayo755 5 жыл бұрын
I was asked to use airbnb style in a project didn't know what they were talking of with this video 👌👌😢🇳🇬🇳🇬
@skipmonday6467
@skipmonday6467 5 жыл бұрын
Brother mi, you sabi ooo.
@therustguy10
@therustguy10 5 жыл бұрын
See my people!!!😂😂😂
@MultiSammy1010
@MultiSammy1010 5 жыл бұрын
Una deh here. Think say no only me Waka come.
@skipmonday6467
@skipmonday6467 5 жыл бұрын
We dey here kanpe
@modupeadebayo755
@modupeadebayo755 5 жыл бұрын
My people 🇳🇬🇳🇬🇳🇬❤
@jaykumarpatel9854
@jaykumarpatel9854 3 жыл бұрын
I am trying to create custom plugin and rules in eslint but its not giving any warning or error, .js rule file is correct but i thing i have some issues with package.json and .eslintrc file can some one suggest me what to do? Thanks
@roei133
@roei133 3 жыл бұрын
Hi , my vscode not fix the code after save .. what can be the problem ?
Best VSCode Extensions I'm in Love with
8:36
Lama Dev
Рет қаралды 374 М.
Don’t learn web dev this way
1:00
Kevin Powell
Рет қаралды 1,2 МЛН
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 3,3 МЛН
TRY NOT TO LAUGH 😂
00:56
Feinxy
Рет қаралды 19 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 187 МЛН
Improve Your Code With ESLint + VsCode + Airbnb Styleguide
13:19
Colt Steele
Рет қаралды 51 М.
Setup Prettier and ESLint for a Node.js project
9:24
Ravi - Perfect Base
Рет қаралды 2,9 М.
Google Chrome Developer Tools Crash Course
51:20
Traversy Media
Рет қаралды 674 М.
ESLint + Prettier + VS Code - The Perfect Setup
12:32
Wes Bos
Рет қаралды 154 М.
Async JS Crash Course - Callbacks, Promises, Async Await
24:31
Traversy Media
Рет қаралды 1,4 МЛН
How To Setup Prettier
12:11
Web Dev Simplified
Рет қаралды 134 М.
Vite Crash Course | Faster Alternative To CRA
16:24
Traversy Media
Рет қаралды 187 М.
ESLint Quickstart - find errors automatically
8:52
freeCodeCamp.org
Рет қаралды 141 М.
Телефон в воде 🤯
0:28
FATA MORGANA
Рет қаралды 1 МЛН
💅🏻Айфон vs Андроид🤮
0:20
Бутылочка
Рет қаралды 490 М.
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 2,8 МЛН
Нашел еще 70+ нововведений в iOS 18!
11:04
После ввода кода - протирайте панель
0:18
AI от Apple - ОБЪЯСНЯЕМ
24:19
Droider
Рет қаралды 131 М.