jokeyrhyme / jqlint

JSLint but for jQuery!
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

detect mixing native CSS selectors with non-native jQuery selectors #3

Open jokeyrhyme opened 10 years ago

jokeyrhyme commented 10 years ago

E.g. $('.class:checkbox'); is much better expressed as $('.class').filter(':checkbox'); as this allows as much of the query as possible to be executed by browser-native functionality.

jokeyrhyme commented 10 years ago

http://api.jquery.com/category/selectors/jquery-selector-extensions/

To achieve the best performance when using these selectors, first select some elements using a pure CSS selector, then use .filter().

It would make sense to throw a "PERFORMANCE" reason in this and related errors.

jokeyrhyme commented 10 years ago

https://github.com/jquery/sizzle/issues/242

jokeyrhyme commented 10 years ago

https://github.com/tonyganch/gonzales-pe