Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Variable Scope

Timothy Huxley
PLUS
Timothy Huxley
Courses Plus Student 4,781 Points

Are there any tools to give us warnings and help us avoid risky code?

(e.g. if I forget to declare a var in a function or use == instead of ===)

2 Answers

Steven Parker
Steven Parker
231,236 Points

There are several code-checking tools for JavaScript.

Any search engine will easily turn up several. But these two are by far the most popular:

Timothy Huxley
Timothy Huxley
Courses Plus Student 4,781 Points

Thanks! I appreciate a recommendation over a search.

ESLint is another popular linter that has a pretty complete set of rules created and maintained by Air BnB.

Here you can learn about what rules they use and why: https://github.com/airbnb/javascript Here you can learn about how to set up different versions: https://www.npmjs.com/package/eslint-config-airbnb