typeof error it is). However, it never hurts to have ways to validate your code for you and help prevent those errors.
By the way: In terms of programming, “lint” is invalid, unused, or ugly code (when checked against a baseline style guide). A “linter” is a program or website service (and sometimes both) that checks code for lint, known as “linting”.
- HTMLHint: Simply paste your raw HTML code in the line-numbered, syntax-highlighted, responsive editor on the home page to check for any errors. You can also fix the errors straight in the box and have it checked in real time.
- W3C Markup Validation Service: This is the official W3C HTML validator. W3C is the committee who standardizes the HTML and CSS specifications. You should most definitely validate your code here.
- W3C CSS Validation Service: As the name suggests, this is the official W3C CSS validator. Yet again, most definitely validate your CSS here. Even if you are not using any of the new features, you have no reason to not validate at the CSS3 level.
- CSSLint: When configured correctly, this can be a great tool for CSS linting. Some of the default settings, such as disallowing the use of ID selectors completely (which goes directly against the fundamental aspect of CSS), is quite silly and will need to be changed. After that, however, it works quite well. I recommend reading “Should You Start Using CSSLint?” to get a better idea of why some default settings need changing.
- JSHint: A spinoff of JSLint, JSHint is actively updated and supports more linting directives and tolerances than its older siblings. Most JSLint directives are supported by JSHint, so inline directives will work in either one. The online version also automatically checks each function’s complexity and averages out the scores, handy for knowing if you may need to break up your code a bit.
- JSONLint: With a website and input field similar to but not exactly like HTMLHint, you should be able to use JSONLint. As all these names imply, this one checks your JSON files. If you don’t know what the format syntax is like, it is basically an object (that requires no
varstatement!) used to store related information for parsing with Ruby, jQuery, PHP and other languages, mainly with the goal of displaying that content on a website. The Brackets IDE site stores the newest sprint’s highlights with JSON, allowing for dynamic and multilingual displaying.
.min in the file name to distinguish it from the development version. An example would be
mysite.min.css. I usually do it a bit differently by naming the full stylesheet
style.css and the full one after the project, such as
- Feed The Bot Minify CSS tool: This quick little online tool simply takes the CSS you paste in and out comes the minified code in a box below. Good for quick on-the-fly checking. I have not used this myself, but a quick look over reveals valid code except for a unicode character I used in that particular stylesheet.