I have been thinking about extending John's debug plugin to do something
similar to lint to catch things like these:
- Use of deprecated methods
- Clearing all event handlers rather than just your own
- Using DOM methods/properties on jQuery objects
- Strict argument checking
- Inefficient selectors like $(":input") or $("div#id")
- Selectors that don't return any elements
- Selectors with bad syntax or obsolete functions
Not all of them are outright errors but the goal is to point out potential
problems or cleaner/safer/faster ways to do things, especially for novices.
Like John's original plugin, it would wrap around the existing api and not
require any code to be inserted into the jQuery source.