File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,15 @@ export default class Linter {
73
73
const proc = spawn ( executablePath , [ ...args , '-' ] , { cwd : this . cwd } )
74
74
proc . on ( 'error' , reject )
75
75
proc . on ( 'close' , resolve )
76
- proc . on ( 'spawn' , ( ) => {
77
- proc . stdin . write ( document . getText ( ) )
78
- proc . stdin . end ( )
79
- } )
80
76
proc . stdout . on ( 'data' , data => ( out += data ) )
81
77
proc . stderr . on ( 'data' , data => ( err += data ) )
78
+ proc . stdin . on ( 'error' , ( ) => {
79
+ // XXX: Ignore STDIN errors in case the process ends too quickly, before we try to
80
+ // write. If we write after the process ends without this, we get an uncatchable EPIPE.
81
+ // This is solved in Node >= 15.1 by the "on('spawn', ...)" event, but we need to
82
+ // support earlier versions.
83
+ } )
84
+ proc . stdin . end ( document . getText ( ) )
82
85
} )
83
86
84
87
// XXX: do we care about exit code? 0 means "ok", 1 possibly means "errors",
You can’t perform that action at this time.
0 commit comments