cfjedimaster / brackets-jshint

Adds JSHint support to Brackets
MIT License
130 stars 41 forks source link

Extend global jshint.globals config, merge arrays #84

Open appfeel opened 9 years ago

appfeel commented 9 years ago

When defined "extends": "jshint.globals" in .jshintrc, it will extend global configuration, not just override it. Also it will merge array properties. Consider this situation:

brackets.son:

    "jshint.options": {
        "bitwise": true,
        "browser": true,
        "curly": true,
        "debug": true,
        "devel": true,
        "evil": true,
        "forin": true,
        "latedef": "nofunc",
        "node": true,
        "nomen": true,
        "nonbsp": true,
        "nonew": true,
        "undef": true,
        "unused": true,
        "predef": [ "angular", "ionic" ]
    },

.jshintrc:

{
    "extends": "jshint.globals",
    "predef": ["analytics", "admob"]
}

The result configuration will be:

{
    "bitwise": true,
    "browser": true,
    "curly": true,
    "debug": true,
    "devel": true,
    "evil": true,
    "forin": true,
    "latedef": "nofunc",
    "node": true,
    "nomen": true,
    "nonbsp": true,
    "nonew": true,
    "undef": true,
    "unused": true,
    "predef": [ "angular", "ionic", "analytics", "admob" ]
}