From the course: ESLint: Checking for Syntax and Logic Errors
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution
(upbeat electronic music) - [Instructor] In my index.js file, I have some code at the beginning that just sets up some constants, and then I start in on the comments that describe what kind of errors my browser should be flagging. So first off is flagging duplicate arguments in a function. I can see already I have multiple arguments with the same name, and here I have that parsing error that's automatic because my code is being interpreted in strict mode. But the idea here is that I want to write a rule that flags this as well. So over in eslintrc, I'm going to go into rules, and this, recall, is the no-dupe-args rule. And that takes a simple string, so I'm just going to make that an error. Now it's still not going to show up back in index.js, I'm still going to get that parser issue instead. But it looks like I don't even need, oh no I've got a singular session down here. So I'm going to change the second…
Contents
-
-
-
Understanding ESLint error rule types1m 39s
-
(Locked)
Flagging issues in functions3m 4s
-
(Locked)
Identifying problems in loops and conditionals3m 12s
-
(Locked)
Eliminating unfinished code4m 44s
-
(Locked)
Ensuring accurate values3m 39s
-
(Locked)
Calling out general logic errors4m 28s
-
(Locked)
Challenge55s
-
(Locked)
Solution6m 33s
-
-