@@ -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 > {
@@ -194,11 +194,11 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
194194 } else {
195195 totalUnformatted += 1 ;
196196 const filePath = filesPathsTargets [ i ] ;
197- const fileRelativePath = fastRelativePath ( rootPath , filePath ) ;
197+ const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
198198 if ( options . check ) {
199- stderr . prefixed . warn ( fileRelativePath ) ;
199+ stderr . prefixed . warn ( fileNameToDisplay ) ;
200200 } else if ( options . list || options . write ) {
201- stdout . warn ( fileRelativePath ) ;
201+ stdout . warn ( fileNameToDisplay ) ;
202202 }
203203 }
204204 }
@@ -212,12 +212,12 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
212212 totalErrored += 1 ;
213213 pathsErrored . push ( filesPathsTargets [ i ] ) ;
214214 const filePath = filesPathsTargets [ i ] ;
215- const fileRelativePath = fastRelativePath ( rootPath , filePath ) ;
215+ const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
216216 //TODO: Make sure the error is syntax-highlighted when possible
217217 if ( options . check || options . write ) {
218- stderr . prefixed . error ( `${ fileRelativePath } : ${ error } ` ) ;
218+ stderr . prefixed . error ( `${ fileNameToDisplay } : ${ error } ` ) ;
219219 } else if ( options . list ) {
220- stderr . error ( fileRelativePath ) ;
220+ stderr . error ( fileNameToDisplay ) ;
221221 }
222222 }
223223 }
@@ -229,9 +229,9 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
229229 stdout . prefixed . debug ( `Files formatted: ${ totalFormatted } ` ) ;
230230 stdout . prefixed . debug ( `Files unformatted: ${ totalUnformatted } ` ) ;
231231 stdout . prefixed . debug ( `Files unknown: ${ totalUnknown } ` ) ;
232- stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => fastRelativePath ( rootPath , filePath ) ) . join ( "\n" ) ) ;
232+ stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
233233 stdout . prefixed . debug ( `Files errored: ${ totalErrored } ` ) ;
234- stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => fastRelativePath ( rootPath , filePath ) ) . join ( "\n" ) ) ;
234+ stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
235235
236236 if ( ! totalMatched && ! totalIgnored ) {
237237 if ( options . errorOnUnmatchedPattern ) {
0 commit comments