@@ -20,6 +20,48 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
20
20
const getClientEnvironment = require ( './env' ) ;
21
21
const paths = require ( './paths' ) ;
22
22
23
+ // AUTOMATA
24
+ // Our customized eslint options
25
+ const eslintOptions = {
26
+ formatter : eslintFormatter ,
27
+ eslintPath : require . resolve ( 'eslint' ) ,
28
+ baseConfig : {
29
+ extends : [ require . resolve ( 'eslint-config-airbnb' ) ] ,
30
+ env : {
31
+ browser : true
32
+ } ,
33
+ } ,
34
+ rules : {
35
+ complexity : [
36
+ 'warn' ,
37
+ 11
38
+ ] ,
39
+ 'no-case-declarations' : 'warn' ,
40
+ 'no-console' : 'warn' ,
41
+ 'react/jsx-filename-extension' : [
42
+ 'error' ,
43
+ {
44
+ 'extensions' : [
45
+ '.js' ,
46
+ '.jsx'
47
+ ]
48
+ }
49
+ ] ,
50
+ 'react/jsx-no-bind' : 'warn' ,
51
+ 'react/no-array-index-key' : 'warn' ,
52
+ 'react/prefer-stateless-function' : 'warn' ,
53
+ 'react/prop-types' : [
54
+ 'error' ,
55
+ {
56
+ 'skipUndeclared' : true
57
+ }
58
+ ]
59
+ } ,
60
+ ignore : false ,
61
+ useEslintrc : true ,
62
+ } ;
63
+
64
+
23
65
// Webpack uses `publicPath` to determine where the app is being served from.
24
66
// In development, we always serve from the root. This makes config easier.
25
67
const publicPath = '/' ;
@@ -128,17 +170,7 @@ module.exports = {
128
170
enforce : 'pre' ,
129
171
use : [
130
172
{
131
- options : {
132
- formatter : eslintFormatter ,
133
- eslintPath : require . resolve ( 'eslint' ) ,
134
- // @remove -on-eject-begin
135
- baseConfig : {
136
- extends : [ require . resolve ( 'eslint-config-airbnb' ) ] ,
137
- } ,
138
- ignore : false ,
139
- // useEslintrc: false,
140
- // @remove -on-eject-end
141
- } ,
173
+ options : eslintOptions ,
142
174
loader : require . resolve ( 'eslint-loader' ) ,
143
175
} ,
144
176
] ,
0 commit comments