@@ -53,14 +53,17 @@ export async function lint(options?: Partial<DefaultOptions>) {
5353
5454 let lintFiles : string [ ] = [ ] ;
5555 let prettierFiles : string [ ] = [ ] ;
56+ let lintFilesPattern : string = '' ;
5657
5758 if ( mergedOptions . lintAll ) {
5859 if ( globalState . selectedSourceType === 'root' ) {
5960 lintFiles = glob . sync ( `${ globalState . projectRootPath } /{${ srcPath . dir } ,${ packagesPath . dir } }/**/*.{ts,tsx}` ) ;
61+ lintFilesPattern = `${ globalState . projectRootPath } /{${ srcPath . dir } ,${ packagesPath . dir } }/**/*.{ts,tsx}` ;
6062 } else {
6163 lintFiles = glob . sync (
6264 `${ globalState . projectRootPath } /${ packagesPath . dir } /${ globalState . selectedSourceType } /**/*.{ts,tsx}` ,
6365 ) ;
66+ lintFilesPattern = `${ globalState . projectRootPath } /${ packagesPath . dir } /${ globalState . selectedSourceType } /**/*.{ts,tsx}` ;
6467 }
6568 } else {
6669 lintFiles = _ . compact (
@@ -74,14 +77,15 @@ export async function lint(options?: Partial<DefaultOptions>) {
7477 . map ( file => {
7578 return path . join ( globalState . projectRootPath , file ) ;
7679 } ) ;
80+ lintFilesPattern = lintFiles . filter ( file => ! cli . isPathIgnored ( file ) ) . join ( ' ' ) ;
7781 }
7882
7983 lintFiles = lintFiles . filter ( file => ! cli . isPathIgnored ( file ) ) ;
8084
8185 const lintResult = await spinner (
8286 `Lint ${ mergedOptions . lintAll ? 'all' : '' } ${ lintFiles . length } files.` ,
8387 async ( ) => {
84- const files = execSync ( `npx prettier --list-different --write ${ lintFiles . join ( ' ' ) } ` ) ;
88+ const files = execSync ( `npx prettier --ignore-path ${ eslintIgnorePath } -- list-different --write ${ lintFilesPattern } ` ) ;
8589 prettierFiles = _ . compact ( files . toString ( ) . split ( '\n' ) ) ;
8690 return cli . executeOnFiles ( lintFiles ) ;
8791 } ,
0 commit comments