Anonymous Coward
Anonymous Coward

Reputation: 21

JSLint, when using JS frameworks

I use the Dojo framework, which I load from an url.

How should I deal with the 'dojo' was used before it was defined errors, and the alike?

Yes, my feeling really get hurt, when running code through JSlint.

Upvotes: 2

Views: 1159

Answers (3)

anthony sottile
anthony sottile

Reputation: 70127

If you scroll all the way down to the bottom there is a "predefined" textbox. Simply put in any of the variables you need into there (comma separated).

Upvotes: 0

hugomg
hugomg

Reputation: 69964

Perhaps you can put something like

/* globals dojo */

in the beggining of your file to tell JSLint that dojo exists?

I personaly use JSHint (a fork of JSLint that is less nitpicky) instead and one of the preconfigured options is support for Dojo.

Upvotes: 2

duffymo
duffymo

Reputation: 308958

Sounds like you need to put Dojo first in your JavaScript. The message suggests that you have an ordering problem.

Don't take it personally. You are not your code. Just make it better, learn something, and don't do it again.

Upvotes: 0

Related Questions