Skip to main content

Extending .jshintrc configurations

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer
Head of IT Business Operations

Since version 2.5.1 of jshint it is possible to extend your own .jshintrc configuration from another .jshintrc config file. This allows you to extend a common configuration and add project specific options (e.g. custom global variable names) to a local configuration file. This way you do not end up with the pain of keeping multiple configurations in sync. It's fairly trivial to use. In your .jshintrc configuration file add an extends field which points to the configuration you are extending from:

{
"extends": "config/cs-standard.json",
"globals": {
"$": true,
"Modernizr": true
}
}

This will instruct jshint to load the settings in config/cs-standard.json first and overwrite them with the settings defined in the local file.