Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore '$' is not defined JsLint Error. (Visual Studio 2010 JsLint Extentsion)

I am trying to get my error count down. Lots of the things that JsLint complains about I don't find are really errors but more personal preference in my option(like braces on their own line).

It comes up with

JS Lint: '$' is not defined.

In all my files that use the short hand document rdy in jquery. I really don't think I should be defining it. Is there away to skip this check?

like image 888
chobo2 Avatar asked Feb 24 '11 17:02

chobo2


People also ask

How do I bypass ESLint error?

disable warnings eslint Use /* eslint-disable */ to ignore all warnings in a file. You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.

How do I ignore an ESLint folder?

To ignore some folder from eslint rules we could create the file . eslintignore in root directory and add there the path to the folder we want omit (the same way as for . gitignore ). Excerpt from the ESLint documentation "In addition to any patterns in a .


2 Answers

On the JSLint website, there's a textbox towards the bottom right called "predefined." Add $ and the errors should go away.

Update:

With the VS2010 plugin, there's a similarly-named "Predefined Vars" textbox in the options dialog (look to the right of "Strict white space indendation":

enter image description here

like image 197
Andrew Whitaker Avatar answered Sep 20 '22 06:09

Andrew Whitaker


Add

/*global $ */

at the top as per How to fix "foo is not defined" error reported by JSlint?

You can fill it up with your own declarations like

/*global language, console, whatever, cool, lib, $ */

I wish it would read

/// <reference path="Jquery/jquery-1.7.1.js" />

though, as Visualstudio itself does.

like image 30
LosManos Avatar answered Sep 21 '22 06:09

LosManos