Skip to content

Commit 319e7c1

Browse files
committed
Add eslint.configFile property processing
eslint.configFile must be relative path of project.
1 parent e9fdc02 commit 319e7c1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/react-scripts/utils/getWebpackConfig.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ function customizer(objValue, srcValue) {
88
}
99
}
1010

11+
function firstLevelCustomizer(objValue, srcValue, paramName) {
12+
var array = customizer(objValue, srcValue, paramName);
13+
14+
if (array) return array;
15+
16+
if (paramName === 'eslint' && srcValue.configFile) {
17+
srcValue.configFile = resolveApp(srcValue.configFile);
18+
}
19+
20+
if (typeof srcValue === 'object') {
21+
return mergeWith(objValue, srcValue, customizer);
22+
}
23+
}
24+
1125
function getWebpackConfig(defaultPath) {
1226
var configPath = resolveApp(process.env.WEBPACK_REPLACE, defaultPath);
1327

@@ -17,7 +31,7 @@ function getWebpackConfig(defaultPath) {
1731
var resultConfig = extendConfig ? mergeWith(
1832
initialConfig,
1933
require(extendConfig),
20-
customizer
34+
firstLevelCustomizer
2135
) : initialConfig;
2236

2337
var babelConfigPath = resolveApp(process.env.BABEL_REPLACE);

0 commit comments

Comments
 (0)