File tree 5 files changed +42
-6
lines changed
5 files changed +42
-6
lines changed Original file line number Diff line number Diff line change 7
7
"es6": true
8
8
},
9
9
"parserOptions": {
10
- "ecmaVersion": 6
10
+ "ecmaVersion": 9
11
11
},
12
12
"rules": {
13
13
"no-console": "off",
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ module.exports = {
89
89
customWebpackProdConfig : resolveApp ( 'config/webpack.config.prod.js' ) ,
90
90
// rewired webpack devServer config
91
91
customWebpackDevServerConfig : resolveApp ( 'config/webpackDevServer.config.js' ) ,
92
+ // eslintrc
93
+ eslintrcPath : resolveApp ( '.' ) ,
92
94
} ;
93
95
94
96
const ownPackageJson = require ( '../package.json' ) ;
129
131
customWebpackDevServerConfig : resolveOwn (
130
132
'template/config/webpackDevServer.config.js'
131
133
) ,
134
+ // eslintrc
135
+ eslintrcPath : resolveOwn ( 'template' ) ,
132
136
} ;
133
137
}
134
138
// @remove -on-eject-end
Original file line number Diff line number Diff line change
1
+ // @remove -file-on-eject
2
+ 'use strict' ;
3
+ const fs = require ( 'fs' ) ;
4
+ const path = require ( 'path' ) ;
5
+ const paths = require ( '../paths' ) ;
6
+
7
+ const CONFIG_FILES = [
8
+ '.eslintrc.js' ,
9
+ '.eslintrc.yaml' ,
10
+ '.eslintrc.yml' ,
11
+ '.eslintrc.json' ,
12
+ '.eslintrc' ,
13
+ ] ;
14
+
15
+ function existsConfigFile ( ) {
16
+ return CONFIG_FILES . some ( configFile => {
17
+ const filename = path . resolve ( paths . eslintrcPath , configFile ) ;
18
+
19
+ return fs . existsSync ( filename ) && fs . statSync ( filename ) . isFile ( ) ;
20
+ } ) ;
21
+ }
22
+
23
+ module . exports = ! ! (
24
+ existsConfigFile ( ) || require ( paths . appPackageJson ) . eslintConfig
25
+ ) ;
Original file line number Diff line number Diff line change @@ -132,11 +132,15 @@ module.exports = {
132
132
formatter : eslintFormatter ,
133
133
eslintPath : require . resolve ( 'eslint' ) ,
134
134
// @remove -on-eject-begin
135
- baseConfig : {
136
- extends : [ require . resolve ( 'eslint-config-react-app' ) ] ,
137
- } ,
138
- ignore : false ,
139
- useEslintrc : false ,
135
+ ...( require ( './utils/useEslintrc' )
136
+ ? undefined
137
+ : {
138
+ baseConfig : {
139
+ extends : [ require . resolve ( 'eslint-config-react-app' ) ] ,
140
+ } ,
141
+ ignore : false ,
142
+ useEslintrc : false ,
143
+ } ) ,
140
144
// @remove -on-eject-end
141
145
} ,
142
146
loader : require . resolve ( 'eslint-loader' ) ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends": "react-app"
3
+ }
You can’t perform that action at this time.
0 commit comments