This repository has been archived by the owner on Feb 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecconf.js
67 lines (62 loc) · 2.09 KB
/
ecconf.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module.exports = {
addons: (config) => ({
...config.addons,
eslint: {
extends: (prevExtends) => ([
...prevExtends,
require.resolve('eslint-config-airbnb'),
]),
rules: {
'import/no-unresolved': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'react/jsx-indent': ['warn', 4],
'react/jsx-indent-props': ['warn', 4],
'react/prop-types': 'warn',
'react/prefer-stateless-function': 'warn',
'react/jsx-filename-extension': 'off',
'react/sort-comp': 'off',
'react/no-array-index-key': 'off',
'react/require-default-props': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off'
},
},
babel: {
presets: (presets = []) => ([
...presets,
require.resolve('@babel/preset-react'),
]),
plugins: (plugins = []) => ([
...plugins,
require.resolve('react-hot-loader/babel'),
]),
},
}),
runners: (config) => ({
...config.runners,
webpack: {
'$module.rules[**].use[**][loader=css-loader].options': (loaderOptions = {}) => ({
...loaderOptions,
modules: true,
}),
'$module.rules': (rules = []) => [
{
test: /\.svg$/,
issuer: { test: /\.jsx?$/ },
use: ['@svgr/webpack', 'file-loader'],
},
...rules,
],
},
jest: {
setupFiles: (files = []) => ([
...files,
require.resolve('./config/jest/setupEnv'),
]),
moduleNameMapper: {
'\\.svg': require.resolve('./config/jest/svgrMock'),
},
},
}),
};