Add ESLint 6 support (#7415)

This commit is contained in:
Brody McKee
2019-07-28 15:05:54 +03:00
committed by GitHub
parent cbad256a4a
commit 404af90d9a
7 changed files with 29 additions and 26 deletions

View File

@@ -84,15 +84,15 @@ module.exports = (resolve, rootDir, isEjecting) => {
];
if (overrides) {
supportedKeys.forEach(key => {
if (overrides.hasOwnProperty(key)) {
if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
if (Object.prototype.hasOwnProperty.call(overrides, key)) {
if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
// for arrays or primitive types, directly override the config key
config[key] = overrides[key];
config[key] = overrides[key];
} else {
// for object types, extend gracefully
config[key] = Object.assign({}, config[key], overrides[key]);
}
config[key] = Object.assign({}, config[key], overrides[key]);
}
delete overrides[key];
}
});