Тёмный

ESLint Quickstart - find errors automatically 

freeCodeCamp.org
Подписаться 10 млн
Просмотров 141 тыс.
50% 1

ESLint is the standard solution for linting your JavaScript projects. It's never been easier to add ESLint to your project.
In this short guide you'll learn how to get up and running with ESLint in under 5 minutes.
Video by Harry Wolff.
Harry has a RU-vid channel about JavaScript: / @hswolff
---
Learn to code for free and get a developer job: www.freecodecamp.com
Read hundreds of articles on programming: medium.freecodecamp.com

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

 

16 апр 2018

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@Dxydrm
@Dxydrm 6 лет назад
Ironic that I actually learned more about git commit workflow than ESLint on this tutorial. Thank you regardless!
@AndyNotSoSmart
@AndyNotSoSmart 6 лет назад
git commit -am ... priceless... My favorite part of this video is the amen break intro music! For ESLint I use Atom and a linter package.
@erenay40
@erenay40 3 года назад
@@AndyNotSoSmart git commit -am didn't work here, he needed to execute git add . before that, you know why?
@AndyNotSoSmart
@AndyNotSoSmart 3 года назад
@@erenay40 maybe try caps -AM different consoles handle casing a little differently i have found.
@erenay40
@erenay40 3 года назад
@@AndyNotSoSmart many thanks for the reply mate.. I just check and the spec says "Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected." so it seems for new files, git add is a must.. I agree you, this tut was as good for git as eslint..
@sebastianmosneagu2635
@sebastianmosneagu2635 2 года назад
@@erenay40 first commit?
@TravelsCode
@TravelsCode 4 года назад
Also, ESLint can automatically fix a huge number of errors for '--fix' command. Example: npm run lint --fix. In this case, you do not need to change code by yourself.
@wilmarmunoz6212
@wilmarmunoz6212 3 года назад
great tutorial, quick and just to the point
@djgrin17
@djgrin17 3 года назад
Great explanation! Thank you for help with eslint basics!
@MunshiWahid
@MunshiWahid 6 лет назад
One of the best videos about eslint
@SuperGUERO17
@SuperGUERO17 6 лет назад
I got a nice satisfying *that just clicked in my brain moment*, thanks!
@fer-torres
@fer-torres 5 лет назад
The integrated terminal is looking great. What configuration did you use to have those colors??
@phanCAbe
@phanCAbe 6 лет назад
Nice, clean, and to the point! Excellent intro tutorial!
@philipibbotsont.delling7255
@philipibbotsont.delling7255 5 лет назад
Thanks for that, helped me to a lot! ^^
@matexxo4004
@matexxo4004 6 лет назад
It would be interesting to know about your typing flow! Not only speed but shortcuts, layout, etc.
@PedroCastro-fb4ho
@PedroCastro-fb4ho 4 года назад
very clear demonstration, thanks
@codewithpdev3177
@codewithpdev3177 2 года назад
Thanks for the good quick introduction of eslint 🥂
@sadulloburiev843
@sadulloburiev843 2 года назад
Short, clear, super!!!😀
@cr00l83
@cr00l83 5 лет назад
Good video, little hint here: you can just write down npm init -y and it will generate for you default package.json without answering questions
@amlivinginhell
@amlivinginhell 3 года назад
vscode doesnot highlight any lint related warnings for me. why is that?
@unicodefox
@unicodefox 4 года назад
The URL ends with 'es' nice'
@opay1234
@opay1234 3 года назад
Nice explanation! Thank you
@TwstedTV
@TwstedTV 5 лет назад
Love the video, thanks : What frustrates me more as each day passes on is that every single time, I start a project, even if its just doodling (if you know what I mean) I have to go through this same motion every single time. Buy the time I init everything for git, npm, eslint etc etc etc and everything in between that falls after. I dont want to code anymore, because I get so frustrated with having to do these same steps over and over just to code and play around with ideas that hour or day.... Im really starting to contemplate on setting a bunch of stuff as global.
@kodosaru
@kodosaru 2 месяца назад
If you divide your coding environments into dev, staging and production, you can apply different standards to each and make security, convenience, speed of development tradeoffs in each.
@EfeBuyuran
@EfeBuyuran 2 года назад
super clean info, thanks!
@pamelar.2684
@pamelar.2684 6 лет назад
Very good! thanks
@thecoderstore5223
@thecoderstore5223 5 лет назад
Very useful video!
@ikramz
@ikramz 2 года назад
Hi Harry, what is the theme that you are using for your vscode?
@SpencerDavis2000
@SpencerDavis2000 4 года назад
Great tutorial thanks
@bhatnagarcapital
@bhatnagarcapital 3 года назад
voice of a real developer 7:51
@sabirkhan-tv6xr
@sabirkhan-tv6xr 4 года назад
Amazing,very useful, thank you.Kindly make video for redux js.
@erenay40
@erenay40 3 года назад
vscode eslint extension is already installed here, right?
@kolyn669
@kolyn669 Год назад
yeah.. do we still need to install it ? i want to known too.
@genrum4803
@genrum4803 Год назад
@@kolyn669 I believe it might be, I've been following along but after creating config file, my VSCode didn't highlight any errors I specified in rules.
@hola88chao
@hola88chao 5 лет назад
manso aporte hermano mio!
@robinhunter3127
@robinhunter3127 3 года назад
love the bangin' intro music
@milan9398
@milan9398 Год назад
Gotta love the Amen ;)
@alessandroalmeida7866
@alessandroalmeida7866 5 лет назад
Thank's a lot!!
@n.aminr.7175
@n.aminr.7175 2 года назад
I'm new in js, node.js and vscode. For intellisense Currently starting with free tabnine. Which intellisense are you using in this tutorial?
@Yash-qe3bv
@Yash-qe3bv 2 года назад
hi, how do people have the branch name they are on shown in the terminal like you do "git:(master)" is it a mac only thing or some external package?
@ponyatnoeit169
@ponyatnoeit169 3 года назад
Thanks man 👍
@liketocode
@liketocode Год назад
Nice. Just a point on presentation, would be helpful if your editor was full screen in order to better see the code. Probably for the visually impaired. Thanks.
@ankk98
@ankk98 6 лет назад
thats fast typing :)
@bryanurizar
@bryanurizar 3 года назад
How do you get your terminal to look that way?
@yutamori6113
@yutamori6113 3 года назад
What's the command for eslint to automatically fix the errors in your js file? So instead of having to manually fix the errors, run that eslint command that fixes those errors for you. That should be possible right?
@rizwanshaik2116
@rizwanshaik2116 2 года назад
In this case, it is npm run lint --fix
@yehiashouman
@yehiashouman 2 года назад
thanks for the video but i guess its better to have vscode in fullscreen and minimize your camera stream
@yogxoth1959
@yogxoth1959 3 года назад
Do I need eslint if I'm already using tsserver (CoC)?
@aryanzies
@aryanzies 2 года назад
why there isn't an extension for this already?
@ryanclemons1
@ryanclemons1 3 года назад
I wish I could become a good coder but I have trash memory and all then commands are so hard to remember. But so far I have been working on editing some json files to add spells to CDDA.
@regular5571
@regular5571 6 лет назад
I love it. Tho I'd like to know if is there a way to config it as a built-in functionality on vscode? I wanna use it on all my projects but I don't actually like the idea of having it as a dev dependency.
@claudeb.3473
@claudeb.3473 6 лет назад
You can install eslint globally on your machine, but you will still need to specify linting rules at the project level. So while that may work for you, it will fail for someone else who clones your project repo since they don't know eslint is a dependency. So in a collaborative environment, you are better off adding it as a dev dependency.
@regular5571
@regular5571 6 лет назад
Thats where I am atm, I just installed it globally but I still have to point to it in a project level as you said. While I understand that its better to have as a dev dependency in a common project, theres a lot of projects I only do for practice and they are pretty damn small, most of the times I don't even have repos for them. But still, I wanted to have eslinting on these cases as well. I thought it would be possible to have a global .eslintrc file and as I had a more specific .eslintrc on the project tree it would just simply override the global one. But oh well, I think thats just not possible then. Thanks anyway!
@lens07
@lens07 6 лет назад
Similar question here: is there any advantage to use the eslint plugin in vscode rather than a node package, if 1) you always use vscdoe as the ide 2) for personal project only?
@regular5571
@regular5571 6 лет назад
Kai Xu I imagine it might be but not as much, unless you're creating repos for your personal projects. Then I'd rather use it on the package.json just so you can insure that anyone else that wants to debug or check your code would have the same enviropment you got. It also helps with code consistency. As using it on vscode though, keep in mind that (as far as I know) you'll still need a .eslintrc file on a project level, so it isn't that much of a deal anyway.
@yadusolparterre
@yadusolparterre 6 лет назад
How did the for loop pop up so fast? What is the name of that sorcery ?
@TheAiluropodaMelanol
@TheAiluropodaMelanol 6 лет назад
It is just shortcut in editor that you can set up your way.
@filcondrat
@filcondrat 4 года назад
cool breakbeat intro
@alokranjan476
@alokranjan476 Год назад
Very nice
@kirankumarsukumar
@kirankumarsukumar Год назад
very useful
@discharger61
@discharger61 2 года назад
How did he make that for loop right away at 2:00?
@filipmoniuszko309
@filipmoniuszko309 3 года назад
I am wondering why all tutorials I watch don't work on my pc. I get always errors and I cannot proceed...
@YgoMello
@YgoMello 6 лет назад
Hi, can you help me with a problem in ESLINT? When I activate 'formatOnSave' in VSCode and save my modifications, every time the editor removes the space before a parentheses in a function definition (or, precisely, at 'methods' and 'computeds' objects in VueJs) and I need this space to work with my Lint (Standard). Although I activate this feature in the EsLint configuration (User Configuration in VSCode) and on .eslint file, the result is the same. However if I use and arrow function like below, the doesn't complain: methods: { KissMe: () => { ... } } Do you know how to fix this issue?
@rabindrajoshi9258
@rabindrajoshi9258 6 лет назад
You've got a conflicting setting... There may be syntax errors on the user setting or there might be workspace setting that are superior to user. You may also be using other extensions such as Prettier and it's linting on save... Nobody can say!
@tarunjyotkaur6941
@tarunjyotkaur6941 2 года назад
Hey, I am getting TypeError: Failed to load plugin 'jest' declared in '.eslintrc': Class extends value undefined is not a constructor or null. Please help.
@_darkbrian
@_darkbrian 5 лет назад
please can anybody suggest me how to install, initialize and use ESLint only, I am new to coding and this video just frustrates with things that I don't know but I must learn
@franciscorenteria5427
@franciscorenteria5427 4 года назад
You must to put on terminal npm install eslint -g or npm install eslint --save-dev. :) Sorry for my english.
@chandrashekharneupane2464
@chandrashekharneupane2464 3 года назад
thanks
@sameedali6264
@sameedali6264 4 года назад
Why did we add lint to scripts in package.json? How does it help?
@Zayelion
@Zayelion 4 года назад
It makes sure eslint is installed when it gets pulled down onto a new computer or build server, otherwise it would need to be installed separately. That could lead to problems.
@rayahmed2202
@rayahmed2202 3 года назад
You da man
@lutif1415
@lutif1415 4 года назад
that colors in the terminal. how can i get it?
@umarrauf9331
@umarrauf9331 3 года назад
Those color are from GitBash. You will need to connect Git Bash with vs Code terminal.
@fallout__boy1130
@fallout__boy1130 4 года назад
1:14 npm init -y instead
@ziggys.9768
@ziggys.9768 3 года назад
How can I use gst for git status? What I have to do? its not working in my pc
@genrum4803
@genrum4803 Год назад
I believe you can create aliases (or "shortcuts" )for CLI and then when you type gst (or whatever you created) it runs as git status.
@mayyuhan8691
@mayyuhan8691 4 года назад
i dont know what that last part was meant for, starting at around 8:00.
@shaikhfaiz6203
@shaikhfaiz6203 4 года назад
2:20 that's how computer respond to my code😣.
@eh-lo2do
@eh-lo2do 4 года назад
it's not working on sublime text, i's not highlighting anything
@flexairz
@flexairz 4 года назад
Use VSCode
@nitkarshchourasia2406
@nitkarshchourasia2406 5 месяцев назад
🎯 Key Takeaways for quick navigation: 00:31 🚧 *ESLint is like guardrails for your JavaScript code, ensuring it's healthy and error-free.* 01:13 🛠️ *Start a new project with `npm init` and make an initial commit to track progress.* 03:10 📦 *Install ESLint as a dev dependency with `npm install --save-dev eslint`.* 03:37 🔄 *Initialize ESLint with `eslint --init` and answer configuration questions.* 04:48 🔍 *Review ESLint's built-in recommended rules and customize based on project needs.* 06:13 🚫 *Use comments to disable specific ESLint rules, but consider explicit rule references for clarity.* 07:22 ⚙️ *Add a lint script to `package.json` for command-line linting using `npm run lint`.* 08:19 🌐 *Explore richer ESLint configurations online, like Airbnb's, but start with basic recommended files for a solid foundation.*
@Burak-ls5yd
@Burak-ls5yd 3 года назад
Thank you for ending with a semicolon.
@DeViLTh0rn
@DeViLTh0rn 3 года назад
haha
@ofjdaz
@ofjdaz 3 года назад
What women say about me 1:04: yes yes good great perfect love it! yes! SwEet!
@AkshatRamanathan
@AkshatRamanathan 2 года назад
Jesus thank you 🙏
@tejkumarkempaiah4906
@tejkumarkempaiah4906 3 года назад
Please find the ts code which is resulting in 24 problems and unable to solve it. ------------------------------------------------- async onmousemove(textToDisplay: string, elementToMouseHover: ElementFinder) { it('mouse hover on ' + textToDisplay, async () => { await browser.wait(ExpectedConditions.elementToBeClickable(elementToMouseHover)); await browser.driver.actions().mouseMove(elementToMouseHover).perform(); return; }); } ------------------------------------------------- ',' expected. Cannot find name 'async'. Expected 1-3 arguments, but got 6. Cannot find name 'textToDisplay'. 'string' only refers to a type, but is being used as a value here. Cannot find name 'elementToMouseHover'. Parameter '(Missing)' implicitly has an 'any' type. ------------------------------------------------- ------------------------------------------------- Please share your comments to resolve the errors.
@szumeczek
@szumeczek 6 лет назад
It's ok if you just watch it but if you want to follow along with coding that is waaaay too fast. Constant pausing and rewinding is so distracting and frustrating that it actually makes the whole video pointless. IMHO, if you're supposed to teach someone something you shouldn't act as if it was some kind of race. There's no prize for whoever finishes their lesson first. After 3 min I decided to just watch it and watching without doing is not very helpful in learning.
@charvillatxmx
@charvillatxmx 9 месяцев назад
ew spaces... JK!
@m4cdemos
@m4cdemos 5 лет назад
Would prefer to see the windows full screen, rather than waste half the view with you waving your hands about in that annoying, distracting manner... You could learn a lot from Traversy Media in terms of presentation.
@hikolanikola8775
@hikolanikola8775 7 месяцев назад
Thanks, but no thanks.
Далее
Async + Await in JavaScript, talk from Wes Bos
15:52
Просмотров 117 тыс.
ШАР СКВОЗЬ БУТЫЛКУ (СКЕРЕТ)
00:46
He turned a baseball into a stylish shoe😱
00:59
Просмотров 939 тыс.
Programming Is NOT Enough | Add these 7 skills…
13:19
Linting with ESLint
28:29
Просмотров 32 тыс.
VSCode ESLint, Prettier & Airbnb Style Guide Setup
22:40
Logging in JavaScript Best Practices
19:58
Просмотров 33 тыс.
ШАР СКВОЗЬ БУТЫЛКУ (СКЕРЕТ)
00:46