@@ -12,7 +12,18 @@ 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 , normalizeToPosix } from "./utils.js" ;
15+ import {
16+ fastRelativePath ,
17+ isNull ,
18+ isString ,
19+ isUndefined ,
20+ negate ,
21+ normalizePathSeparatorsToPosix ,
22+ pluralize ,
23+ trimFinalNewline ,
24+ uniq ,
25+ without ,
26+ } from "./utils.js" ;
1627import type { FormatOptions , Options , PluginsOptions } from "./types.js" ;
1728
1829async function run ( options : Options , pluginsDefaultOptions : PluginsOptions , pluginsCustomOptions : PluginsOptions ) : Promise < void > {
@@ -162,7 +173,7 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
162173 } else {
163174 totalUnformatted += 1 ;
164175 const filePath = filesPathsTargets [ i ] ;
165- const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
176+ const fileNameToDisplay = normalizePathSeparatorsToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
166177 if ( options . check ) {
167178 stderr . prefixed . warn ( fileNameToDisplay ) ;
168179 } else if ( options . list || options . write ) {
@@ -180,7 +191,7 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
180191 totalErrored += 1 ;
181192 pathsErrored . push ( filesPathsTargets [ i ] ) ;
182193 const filePath = filesPathsTargets [ i ] ;
183- const fileNameToDisplay = normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
194+ const fileNameToDisplay = normalizePathSeparatorsToPosix ( fastRelativePath ( rootPath , filePath ) ) ;
184195 //TODO: Make sure the error is syntax-highlighted when possible
185196 if ( options . check || options . write || options . dump ) {
186197 stderr . prefixed . error ( `${ fileNameToDisplay } : ${ error } ` ) ;
@@ -197,9 +208,9 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
197208 stdout . prefixed . debug ( `Files formatted: ${ totalFormatted } ` ) ;
198209 stdout . prefixed . debug ( `Files unformatted: ${ totalUnformatted } ` ) ;
199210 stdout . prefixed . debug ( `Files unknown: ${ totalUnknown } ` ) ;
200- stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
211+ stdout . prefixed . debug ( ( ) => pathsUnknown . map ( ( filePath ) => normalizePathSeparatorsToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
201212 stdout . prefixed . debug ( `Files errored: ${ totalErrored } ` ) ;
202- stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => normalizeToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
213+ stdout . prefixed . debug ( ( ) => pathsErrored . map ( ( filePath ) => normalizePathSeparatorsToPosix ( fastRelativePath ( rootPath , filePath ) ) ) . join ( "\n" ) ) ;
203214
204215 if ( ! totalMatched && ! totalIgnored ) {
205216 if ( options . errorOnUnmatchedPattern ) {
0 commit comments