File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
3
var CLIEngine = require ( "eslint" ) . CLIEngine ;
4
+ var fs = require ( "fs" ) ;
4
5
5
6
function buildIssueJson ( message , path ) {
6
7
// ESLint doesn't emit a ruleId in the
@@ -37,18 +38,23 @@ var options = {
37
38
extensions : [ ".js" ] , ignore : true , reset : false , useEslintrc : true
38
39
} ;
39
40
var ignores = [ ] ;
40
- if ( process . env . ENGINE_CONFIG ) {
41
- var engineConfig = JSON . parse ( process . env . ENGINE_CONFIG ) ;
41
+
42
+ if ( fs . existsSync ( "/config.json" ) ) {
43
+ var engineConfig = JSON . parse ( fs . readFileSync ( "/config.json" ) ) ;
44
+
42
45
if ( engineConfig . config ) {
43
46
options . configFile = "/code/" + engineConfig . config ;
44
47
}
48
+
45
49
if ( engineConfig . exclude_paths ) {
46
50
ignores = engineConfig . exclude_paths ;
47
51
}
52
+
48
53
if ( engineConfig . extensions ) {
49
54
options . extensions = engineConfig . extensions ;
50
55
}
51
56
}
57
+
52
58
var cli = new CLIEngine ( options ) ;
53
59
var report = cli . executeOnFiles ( [ "/code" ] ) ;
54
60
report . results . forEach ( function ( result ) {
You can’t perform that action at this time.
0 commit comments