File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ if (options.nodeVersion) {
173173}
174174
175175( async ( ) => {
176- if ( options . printConfig ) {
177- if ( input . length > 0 ) {
176+ if ( typeof options . printConfig === 'string' ) {
177+ if ( input . length > 0 || options . printConfig === '' ) {
178178 console . error ( 'The `--print-config` flag must be used with exactly one filename' ) ;
179179 process . exit ( 1 ) ;
180180 }
Original file line number Diff line number Diff line change @@ -190,3 +190,10 @@ test('print-config flag requires a single filename', async t => {
190190 ) ;
191191 t . is ( error . stderr . trim ( ) , 'The `--print-config` flag must be used with exactly one filename' ) ;
192192} ) ;
193+
194+ test ( 'print-config flag without filename' , async t => {
195+ const error = await t . throwsAsync ( ( ) =>
196+ main ( [ '--print-config' ] ) ,
197+ ) ;
198+ t . is ( error . stderr . trim ( ) , 'The `--print-config` flag must be used with exactly one filename' ) ;
199+ } ) ;
You can’t perform that action at this time.
0 commit comments