From the course: JavaScript: Best Practices for Code Formatting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Optimize punctuation

Solution: Optimize punctuation - JavaScript Tutorial

From the course: JavaScript: Best Practices for Code Formatting

Start my 1-month free trial

Solution: Optimize punctuation

(upbeat music0 - [Instructor] This challenge was to enforce best practices around punctuation and line length in this java script code. So the way I like to approach these is to start with my eslintrc file. Get the rules in place that will highlight issues with my existing code and then I can work on it from there. So I have several eslint rules that will help me identify issues with this code and enforce those best practices. First off is just requiring semi-colons, and that's the semi rule. Don't even need quotes on that. And that is an error, and I want it always. And then I also want to make sure that I don't have a space before my semi-colons So that's semi-spacing and that value is simply error. And I want to disallow extra unneeded semi-colons, so that's no-extra-semi and error. Then in terms of my lines, I want to make sure that I don't have unexpected multilines, so that's the no unexpected…

Contents