11import { existsSync , promises as fs } from 'node:fs'
22import process from 'node:process'
3+ import c from 'ansis'
34import fg from 'fast-glob'
45import isText from 'is-text-path'
56import minimist from 'minimist'
67import pLimit from 'p-limit'
7- import c from 'picocolors'
88// @ts -expect-error missing types
99import parseIgnore from 'parse-gitignore'
1010import { version } from '../package.json'
@@ -68,9 +68,9 @@ async function run() {
6868
6969 const limit = pLimit ( 5 )
7070 console . log ( )
71- console . log ( c . inverse ( c . red ( ' Case ' ) ) + c . inverse ( c . blue ( ' Police ' ) ) + c . dim ( ` v${ version } ` ) )
71+ console . log ( c . inverse . red ( ' Case ' ) + c . inverse . blue ( ' Police ' ) + c . dim ` v${ version } ` )
7272 console . log ( )
73- console . log ( c . blue ( files . length ) + c . dim ( ' files found for checking, ' ) + c . cyan ( Object . keys ( dict ) . length ) + c . dim ( ' words loaded\n' ) )
73+ console . log ( c . blue ( files . length ) + c . dim ` files found for checking, ${ c . cyan ( Object . keys ( dict ) . length ) } words loaded\n` )
7474 const wrote : string [ ] = [ ]
7575 await Promise . all ( files . map ( file => limit ( async ( ) => {
7676 const code = await fs . readFile ( file , 'utf-8' )
@@ -90,8 +90,8 @@ async function run() {
9090 console . log ( c . green ( '\nfiles fixed' ) )
9191 }
9292 else {
93- console . log ( c . dim ( `\n${ wrote . length } files contain case errors` ) )
94- console . log ( c . dim ( ' run ' ) + c . magenta ( c . bold ( ' npx case-police --fix' ) ) + c . dim ( ' to fix\n' ) )
93+ console . log ( c . dim `\n${ wrote . length } files contain case errors` )
94+ console . log ( c . dim ` run ${ c . magenta . bold ` npx case-police --fix` } to fix\n` )
9595 process . exitCode = 1
9696 }
9797 }
0 commit comments