Commit c964275 1 parent f95ef60 commit c964275 Copy full SHA for c964275
File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,20 @@ function _getConfigFile(specifiedFile) {
19
19
}
20
20
21
21
function _getConfigs ( configFile , files ) {
22
- const cliEngine = new eslint . CLIEngine ( {
23
- // Ignore any config applicable depending on the location on the filesystem
24
- useEslintrc : false ,
25
- // Point to the particular config
26
- configFile
27
- } ) ;
22
+ const cliEngine = eslint . ESLint
23
+ ? new eslint . ESLint ( {
24
+ // Ignore any config applicable depending on the location on the filesystem
25
+ useEslintrc : false ,
26
+ // Point to the particular config
27
+ overrideConfigFile : configFile
28
+ } )
29
+ : new eslint . CLIEngine ( {
30
+ // Ignore any config applicable depending on the location on the filesystem
31
+ useEslintrc : false ,
32
+ // Point to the particular config
33
+ configFile
34
+ } ) ;
35
+
28
36
return new Set ( files
29
37
. map ( filePath => cliEngine . isPathIgnored ( filePath ) ? false : cliEngine . getConfigForFile ( filePath ) )
30
38
. filter ( Boolean ) ) ;
@@ -67,7 +75,7 @@ function _getPluginRules(config) {
67
75
}
68
76
69
77
function _getCoreRules ( ) {
70
- return eslint . linter . getRules ( ) ;
78
+ return ( eslint . Linter ? new eslint . Linter ( ) : eslint . linter ) . getRules ( ) ;
71
79
}
72
80
73
81
function _filterRuleNames ( ruleNames , rules , predicate ) {
You can’t perform that action at this time.
0 commit comments