jshint/jshint

JSON always a known global, can not exclude a global in the jshintrc file

Open

#1603 opened on Apr 3, 2014

View on GitHub
 (11 comments) (0 reactions) (0 assignees)JavaScript (8,937 stars) (1,757 forks)batch import
P3good first issue

Description

how can i tell jshint that it should create an error when i use JSON like JSON.stringify or JSON.parse without defining it? JSON is not a valid global on old IEs. I am using json2 but because i have an amd style application that should never write in the window object, i have to require json2 in each file where i use JSON.

i tried ec3, browser: false and a lot other stuff. the only thing that worked was adding /* global -JSON */ on the top of each js file. but i would like to add a configuration for that in the .jshintrc

is there an option for the jshintrc file for disallowing a special global? if not: that would be a nice feature.

Contributor guide