File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 66const childProcess = require ( 'child_process' )
77const fs = require ( 'fs' )
88const path = require ( 'path' )
9+ const supportsColors = require ( 'supports-color' )
10+
11+ const hasBasicColorSupport = supportsColors . stdout . hasBasic && supportsColors . stderr . hasBasic
912
1013function execFile ( command , args ) {
1114 return new Promise ( resolve => {
@@ -24,6 +27,10 @@ function execFile(command, args) {
2427
2528 let eslintOptions = [ '--color' , '--report-unused-disable-directives' , '.' ]
2629
30+ if ( hasBasicColorSupport ) {
31+ eslintOptions = eslintOptions . concat ( [ '--color' ] )
32+ }
33+
2734 const isTypeScriptProject = fs . existsSync ( 'tsconfig.json' )
2835
2936 if ( isTypeScriptProject ) {
Original file line number Diff line number Diff line change 5050 "inquirer" : " >=6.0.0" ,
5151 "prettier" : " >=1.12.0" ,
5252 "read-pkg-up" : " >=6.0.0" ,
53+ "supports-color" : " ^7.1.0" ,
5354 "svg-element-attributes" : " >=1.2.1"
5455 },
5556 "peerDependencies" : {
You can’t perform that action at this time.
0 commit comments