Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

W005 wrongly assumes $ is jQuery #399

Open
deltab opened this issue Jun 20, 2017 · 0 comments
Open

W005 wrongly assumes $ is jQuery #399

deltab opened this issue Jun 20, 2017 · 0 comments
Labels

Comments

@deltab
Copy link

deltab commented Jun 20, 2017

Bootlint looks at window.$ when checking for window.jQuery:

var globaljQuery = theWindow.$ || theWindow.jQuery;

but it should not do so as they can be different (e.g. Prototype and jQuery on the same page using $.noConflict). As jQuery's documentation states,

Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If you need to use another JavaScript library alongside jQuery, return control of $ back to the other library with a call to $.noConflict().

I think there's no actual reason to look at $, as jQuery should always be defined when it's loaded.

var globaljQuery = theWindow.jQuery;
@cvrebert cvrebert added the bug label Jun 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants