5
5
'use strict' ;
6
6
7
7
const resolve = require ( 'resolve' ) ;
8
- const log = require ( './log ' ) ;
8
+ const error = require ( './error ' ) ;
9
9
10
10
let warnedForMissingVersion = false ;
11
11
@@ -16,7 +16,7 @@ function detectReactVersion() {
16
16
return react . version ;
17
17
} catch ( e ) {
18
18
if ( e . code === 'MODULE_NOT_FOUND' ) {
19
- log ( 'Warning: React version was set to "detect" in eslint-plugin-react settings, ' +
19
+ error ( 'Warning: React version was set to "detect" in eslint-plugin-react settings, ' +
20
20
'but the "react" package is not installed. Assuming latest React version for linting.' ) ;
21
21
return '999.999.999' ;
22
22
}
@@ -33,12 +33,12 @@ function getReactVersionFromContext(context) {
33
33
settingsVersion = detectReactVersion ( ) ;
34
34
}
35
35
if ( typeof settingsVersion !== 'string' ) {
36
- log ( 'Warning: React version specified in eslint-plugin-react-settings must be a string; ' +
36
+ error ( 'Warning: React version specified in eslint-plugin-react-settings must be a string; ' +
37
37
`got “${ typeof settingsVersion } ”` ) ;
38
38
}
39
39
confVer = String ( settingsVersion ) ;
40
40
} else if ( ! warnedForMissingVersion ) {
41
- log ( 'Warning: React version not specified in eslint-plugin-react settings. ' +
41
+ error ( 'Warning: React version not specified in eslint-plugin-react settings. ' +
42
42
'See https://github.com/yannickcr/eslint-plugin-react#configuration.' ) ;
43
43
warnedForMissingVersion = true ;
44
44
}
@@ -52,7 +52,7 @@ function getFlowVersionFromContext(context) {
52
52
if ( context . settings . react && context . settings . react . flowVersion ) {
53
53
const flowVersion = context . settings . react . flowVersion ;
54
54
if ( typeof flowVersion !== 'string' ) {
55
- log ( 'Warning: Flow version specified in eslint-plugin-react-settings must be a string; ' +
55
+ error ( 'Warning: Flow version specified in eslint-plugin-react-settings must be a string; ' +
56
56
`got “${ typeof flowVersion } ”` ) ;
57
57
}
58
58
confVer = String ( flowVersion ) ;
0 commit comments