@@ -8,7 +8,6 @@ import { importFromString } from 'module-from-string'
88
99const args = process . argv . slice ( 2 )
1010const pattern = args [ 0 ]
11- const { error, table } = console
1211
1312type Locales = Record < string , string >
1413type ErrorICU = {
@@ -65,7 +64,7 @@ const readFiles = async (files: string[]): Promise<ErrorsICU> => {
6564 const ICUErrors = findICUErrors ( locales , file )
6665 errors . push ( ...ICUErrors )
6766 } catch ( err ) {
68- error ( { file, err } )
67+ console . error ( { file, err } )
6968 }
7069 }
7170
@@ -85,13 +84,13 @@ const readFiles = async (files: string[]): Promise<ErrorsICU> => {
8584 const ICUErrors = findICUErrors ( locales , file )
8685 errors . push ( ...ICUErrors )
8786 } else {
88- error ( 'export default from: ' , file, ' is not an object' )
87+ console . error ( 'export default from: ' , file, ' is not an object' )
8988 }
9089 } else {
91- error ( file , ' is not an object' )
90+ console . error ( file , ' is not an object' )
9291 }
9392 } catch ( err ) {
94- error ( { err, file } )
93+ console . error ( { err , file } )
9594 }
9695 }
9796 }
@@ -100,23 +99,23 @@ const readFiles = async (files: string[]): Promise<ErrorsICU> => {
10099}
101100
102101if ( ! pattern ) {
103- error ( 'Missing pattern: validate-icu-locales [PATTERN]' )
102+ console . error ( 'Missing pattern: validate-icu-locales [PATTERN]' )
104103 process . exit ( 1 )
105104}
106105
107106const files = await globby ( pattern )
108107
109108if ( files . length === 0 ) {
110- error ( 'There is no files matching this pattern' , pattern )
109+ console . error ( 'There is no files matching this pattern' , pattern )
111110 process . exit ( 1 )
112111}
113112
114- table ( files )
113+ console . table ( files )
115114
116115const errors = await readFiles ( files )
117116
118117if ( errors . length > 0 ) {
119- error ( {
118+ console . error ( {
120119 errors,
121120 } )
122121 process . exit ( 1 )
0 commit comments