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

W005 wrongly assumes $ is jQuery #399

@deltab

Description

@deltab

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions