From the course: JavaScript: Best Practices for Code Formatting
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Solution: Create JavaScript comments - JavaScript Tutorial
From the course: JavaScript: Best Practices for Code Formatting
Solution: Create JavaScript comments
(upbeat music) - [Instructor] The challenge consists of enforcing appropriate single line and multiline syntax for comments, enforcing leading spaces and also Strict Mode. So the first thing I want to do is start by building out some rules, because building out the rules first will help me then see in my editor what needs to be changed. So, my ESLintrc File has no rules right now. I know I want to enforce Strict Mode, so I'm going to start by adding Strict, and that value is an array which starts with Error and then Global. Then I want to specify what my multiline comment style should look like. So that's Multiline-Comment-Style and an array which is Error and we want to use Starred-Block to make this multiline comments really easy to read. And finally, I want to enforce leading spaces in my comments. So that's the Spaced-Comment rule with a value of an array which is Error and Always. So save my ESLintrc,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.