-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
27 lines (26 loc) · 999 Bytes
/
config-overrides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const rewireEslint = require('react-app-rewire-eslint');
const rewireStylelint = require('react-app-rewire-stylelint');
const rewireReactHotLoader = require('react-app-rewire-hot-loader');
const rewireStyledComponents = require('react-app-rewire-styled-components');
module.exports = (config, env) => {
let overrodeConfig = Object.assign({}, config);
overrodeConfig = rewireEslint(overrodeConfig, env, opts => {
// eslint-disable-next-line no-param-reassign
opts.fix = true;
return opts;
});
overrodeConfig = rewireStylelint.withLoaderOptions({
files: ['public/**/*.{s?(a|c)ss,html}'],
emitErrors: false,
fix: true,
})(overrodeConfig, env);
overrodeConfig = rewireStylelint.withLoaderOptions({
files: ['src/**/*.{js,jsx}'],
emitErrors: false,
})(overrodeConfig, env);
overrodeConfig = rewireReactHotLoader(overrodeConfig, env);
overrodeConfig = rewireStyledComponents(overrodeConfig, env, {
displayName: true,
});
return overrodeConfig;
};