« Back to Index

How to extract JSHint details into its own config file

View original Gist on GitHub

1. Extract JSHint from Gruntfile.js

jshint: {
    files: ['**/*.js'],
    options: {
        jshintrc: '.jshintrc'
    }
}

2. Extract JSHint from Gruntfile - jshintrc.json

{
    "curly":      true,
    "eqeqeq":     true,
    "immed":      true,
    "latedef":    true,
    "noarg":      true,
    "sub":        true,
    "undef":      true,
    "boss":       true,
    "eqnull":     true,
    "browser":    true,
    "multistr":   true,
    "newcap":     false,
    "globals": {

"": "AMD",

            "module":       true,
            "require":      true,
            "requirejs":    true,
            "define":       true,

"": "Environments",

            "console":      true,

"": "General Purpose Libraries",

            "$":            true,
            "jQuery":       true,
            "EventEmitter": true,

"": "Testing",

            "sinon":        true,
            "describe":     true,
            "it":           true,
            "expect":       true,
            "beforeEach":   true,
            "waitsFor":     true,
            "runs":         true,
            "afterEach":    true

    }
}