in jshint-server/src/server.ts [179:218]
function readJSHintFile(file: string, extendedFrom?: string): any {
that.connection.console.info(extendedFrom ? `Reading jshint configuration from ${file}, which was extended from ${extendedFrom}` : `Reading jshint configuration from ${file}`);
let content = readJsonFile(file, extendedFrom);
if (content.extends) {
let baseFile = path.resolve(path.dirname(file), content.extends);
if (fs.existsSync(baseFile)) {
content = _.mergeWith(readJSHintFile(baseFile, file), content, (baseValue, contentValue) => {
if (_.isArray(baseValue)) {
return baseValue.concat(contentValue);
}
});
} else {
that.connection.window.showErrorMessage(`Can't find JSHint file ${baseFile} extended from ${file}`);
}
delete content.extends;
}
if (content.overrides) {
Object.keys(content.overrides).forEach(pathPattern => {
if (minimatch(fsPath, pathPattern)) {
const optionsToOverride = content.overrides[pathPattern];
if (optionsToOverride.globals) {
content.globals = _.extend(content.globals || {}, optionsToOverride.globals);
delete optionsToOverride.globals;
}
Object.keys(optionsToOverride).forEach(optionKey => {
content[optionKey] = optionsToOverride[optionKey];
});
}
});
delete content.overrides;
}
return content;
}