File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -266,14 +266,12 @@ const customRules = loadCustomRules(options.rules);
266
266
const diff = files . filter ( file => ! ignores . some ( ignore => ignore . absolute === file . absolute ) ) . map ( paths => paths . original ) ;
267
267
268
268
function lintAndPrint ( stdin , files ) {
269
- files = files || [ ] ;
269
+ files ||= [ ] ;
270
270
const config = readConfiguration ( options . config ) ;
271
271
272
272
for ( const rule of options . enable || [ ] ) {
273
273
// Leave default values in place if rule is an object
274
- if ( ! config [ rule ] ) {
275
- config [ rule ] = true ;
276
- }
274
+ config [ rule ] ||= true ;
277
275
}
278
276
279
277
for ( const rule of options . disable || [ ] ) {
@@ -324,9 +322,7 @@ try {
324
322
if ( files . length > 0 && ! options . stdin ) {
325
323
lintAndPrint ( null , diff ) ;
326
324
} else if ( files . length === 0 && options . stdin && ! options . fix ) {
327
- import ( 'get-stdin' )
328
- . then ( module => module . default ( ) )
329
- . then ( lintAndPrint ) ;
325
+ import ( 'get-stdin' ) . then ( module => module . default ( ) ) . then ( lintAndPrint ) ;
330
326
} else {
331
327
program . help ( ) ;
332
328
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const os = require('node:os');
6
6
const process = require ( 'node:process' ) ;
7
7
const test = require ( 'ava' ) ;
8
8
9
- const execa = ( ...args ) => import ( 'execa' ) . then ( module => module . execa ( ...args ) ) ;
9
+ const execa = ( ...arguments_ ) => import ( 'execa' ) . then ( module => module . execa ( ...arguments_ ) ) ;
10
10
11
11
const errorPattern = / ( \. m d | \. m a r k d o w n | \. m d f | s t d i n ) : \d + ( : \d + ) ? M D \d { 3 } / gm;
12
12
You can’t perform that action at this time.
0 commit comments