Configure grunt-contrib-jshint options with multiple targets
When linting, different JSHint options are needed for front-end and back-end
JavaScript. We can specify different targets in grunt-contrib-jshint. But
there is something to be careful:
|
|
I thought the target level options will merge with the task level, but it does
not happen. Need to dig deeper to figure out why jshintrc
option is not merged
with JSHint options. A quick fix is to load the JSHint JSON file directly:
|
|
In this case, if jshint:node
target was run, the merged options will be parsed
to JSHint.