File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ async function main(args: MainArgs): Promise<void> {
316
316
messages . map ( ( message ) => lint ( message , loaded . rules , opts ) )
317
317
) ;
318
318
319
+ let isRulesEmpty = false ;
319
320
if ( Object . keys ( loaded . rules ) . length === 0 ) {
320
321
let input = '' ;
321
322
@@ -340,6 +341,8 @@ async function main(args: MainArgs): Promise<void> {
340
341
warnings : [ ] ,
341
342
input,
342
343
} ) ;
344
+
345
+ isRulesEmpty = true ;
343
346
}
344
347
345
348
const report = results . reduce < {
@@ -387,6 +390,9 @@ async function main(args: MainArgs): Promise<void> {
387
390
if ( ! report . valid ) {
388
391
throw new CliError ( output , pkg . name ) ;
389
392
}
393
+ if ( ! report . valid && isRulesEmpty ) {
394
+ throw new CliError ( output , pkg . name , 6 ) ;
395
+ }
390
396
}
391
397
392
398
function checkFromStdin ( input : ( string | number ) [ ] , flags : CliFlags ) : boolean {
You can’t perform that action at this time.
0 commit comments