Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON is not defined - ignoring global configuration #203

Open
benmarten opened this issue May 2, 2015 · 6 comments
Open

JSON is not defined - ignoring global configuration #203

benmarten opened this issue May 2, 2015 · 6 comments

Comments

@benmarten
Copy link

Using version 0.11
I have no .jshintrc, only this in my Gruntfile.js

    jshint: {
        options: {
            jshintrc: true,
            JSON: true
        },
        files: ['index.js', 'Gruntfile.js', 'lib/*.js', 'test/*.js']
    }

Error:

 29 |   test = new Test(JSON.stringify(text), function(done) {
                        ^ 'JSON' is not defined.

When downgrading to 0.10 it works. What's the issue?

@benmarten
Copy link
Author

any thoughts?

@OmerHerera
Copy link

When upgrading to version: 0.11.2 its working.
But I'm wandering why this should be in the global configuration , in my opinion this should be always true.

@benmarten
Copy link
Author

yep, works with latest version. even without JSON: true. so i think it works by default again, doesn't it?

@OmerHerera
Copy link

No, its not working I need to set: JSON: true

@furzeface
Copy link

Should it be:

jshint: {
        options: {
                global: {
                    JSON: true
                }
        },
        files: ['index.js', 'Gruntfile.js', 'lib/*.js', 'test/*.js']
    }

@brianjmiller
Copy link

Appears that with newer jshint it will depend on what setting you have for es3 which is why it starts to show up around 0.11.0 because that is when jshint 2.6.0 started to land which includes jshint/jshint@da52aa0 which i think causes this. Either way @furzeface is correct, moving JSON: true into options.global should fix it, as does switching es3 to false. (JSON wasn't in es3 in various IE versions.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants