@@ -12,7 +12,7 @@ import Known from "./known.js";
1212import Logger from "./logger.js" ;
1313import { makePrettier } from "./prettier.js" ;
1414import { castArray , getExpandedFoldersPaths , getFoldersChildrenPaths , getPluginsVersions , getProjectPath , getStdin , getTargetsPaths } from "./utils.js" ;
15- import { fastRelativePath , isNull , isString , isUndefined , negate , pluralize , trimFinalNewline , uniq , without } from "./utils.js" ;
15+ import { fastRelativePath , isNull , isString , isUndefined , negate , pluralize , trimFinalNewline , uniq , without , normalizeToPosix } from "./utils.js" ;
1616import type { FormatOptions , Options , PluginsOptions } from "./types.js" ;
1717
1818async function run ( options : Options , pluginsDefaultOptions : PluginsOptions , pluginsCustomOptions : PluginsOptions ) : Promise < void > {
@@ -162,11 +162,11 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
162162 } else {
163163 totalUnformatted += 1 ;
164164 const filePath = filesPathsTargets [ i ] ;
165- const fileRelativePath = fastRelativePath ( rootPath , filePath ) ;
165+ const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
166166 if ( options . check ) {
167- stderr . prefixed . warn ( fileRelativePath ) ;
167+ stderr . prefixed . warn ( fileNameToDisplay ) ;
168168 } else if ( options . list || options . write ) {
169- stdout . warn ( fileRelativePath ) ;
169+ stdout . warn ( fileNameToDisplay ) ;
170170 }
171171 }
172172 }
@@ -180,12 +180,12 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
180180 totalErrored += 1 ;
181181 pathsErrored . push ( filesPathsTargets [ i ] ) ;
182182 const filePath = filesPathsTargets [ i ] ;
183- const fileRelativePath = fastRelativePath ( rootPath , filePath ) ;
183+ const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
184184 //TODO: Make sure the error is syntax-highlighted when possible
185185 if ( options . check || options . write ) {
186- stderr . prefixed . error ( `${ fileRelativePath } : ${ error } ` ) ;
186+ stderr . prefixed . error ( `${ fileNameToDisplay } : ${ error } ` ) ;
187187 } else if ( options . list ) {
188- stderr . error ( fileRelativePath ) ;
188+ stderr . error ( fileNameToDisplay ) ;
189189 }
190190 }
191191 }
@@ -197,9 +197,9 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
197197 stdout . prefixed . debug ( `Files formatted: ${ totalFormatted } ` ) ;
198198 stdout . prefixed . debug ( `Files unformatted: ${ totalUnformatted } ` ) ;
199199 stdout . prefixed . debug ( `Files unknown: ${ totalUnknown } ` ) ;
200- stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => fastRelativePath ( rootPath , filePath ) ) . join ( "\n" ) ) ;
200+ stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
201201 stdout . prefixed . debug ( `Files errored: ${ totalErrored } ` ) ;
202- stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => fastRelativePath ( rootPath , filePath ) ) . join ( "\n" ) ) ;
202+ stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
203203
204204 if ( ! totalMatched && ! totalIgnored ) {
205205 if ( options . errorOnUnmatchedPattern ) {
0 commit comments