Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!

Unexpected TODO comment

When do I get this error?

JSLint will throw the "Unexpected TODO comment" error when it encounters a comment in which the first word is "TODO". Here's an example:

Why do I get this error?

This error is raised to highlight a lack of convention. Comments that start with the word "TODO" are commonly used to mark unfinished parts of code. JSLint takes the safe approach and assumes that your code is not production-ready if it contains such comments.

If you are happy with "TODO" comments being in your code, you can pass the todo option to JSLint to tell it to ignore them:

James Allardice

This article was written by James Allardice, an enthusiastic young JavaScript developer at Global Personals (we're looking for developers so please apply). He is passionate about writing clean, maintainable JavaScript and uses JSHint every day to help achieve this.

You can follow him on Twitter, fork him on GitHub and find him on Google+.

Proceeds generated by this site are donated to help advance other open source projects

comments powered by Disqus