@@ -28,10 +28,10 @@ const cliConfig = {
2828 map : argv . map !== undefined ? argv . map : { inline : true } ,
2929 parser : argv . parser ? require ( argv . parser ) : undefined ,
3030 syntax : argv . syntax ? require ( argv . syntax ) : undefined ,
31- stringifier : argv . stringifier ? require ( argv . stringifier ) : undefined
31+ stringifier : argv . stringifier ? require ( argv . stringifier ) : undefined ,
3232 } ,
3333 plugins : argv . use
34- ? argv . use . map ( plugin => {
34+ ? argv . use . map ( ( plugin ) => {
3535 try {
3636 return require ( plugin ) ( )
3737 } catch ( e ) {
@@ -41,7 +41,7 @@ const cliConfig = {
4141 return error ( `Plugin Error${ prefix } : ${ msg } '` )
4242 }
4343 } )
44- : [ ]
44+ : [ ] ,
4545}
4646
4747let configFile
@@ -71,7 +71,7 @@ Promise.resolve()
7171
7272 return [ 'stdin' ]
7373 } )
74- . then ( i => {
74+ . then ( ( i ) => {
7575 if ( ! i || ! i . length ) {
7676 error ( 'Input Error: You must pass a valid list of files to parse' )
7777 }
@@ -82,13 +82,13 @@ Promise.resolve()
8282 )
8383 }
8484
85- if ( i [ 0 ] !== 'stdin' ) i = i . map ( i => path . resolve ( i ) )
85+ if ( i [ 0 ] !== 'stdin' ) i = i . map ( ( i ) => path . resolve ( i ) )
8686
8787 input = i
8888
8989 return files ( input )
9090 } )
91- . then ( results => {
91+ . then ( ( results ) => {
9292 if ( argv . watch ) {
9393 const printMessage = ( ) =>
9494 printVerbose ( chalk . dim ( '\nWaiting for file changes...' ) )
@@ -97,31 +97,31 @@ Promise.resolve()
9797 interval : argv . poll && typeof argv . poll === 'number' ? argv . poll : 100 ,
9898 awaitWriteFinish : {
9999 stabilityThreshold : 50 ,
100- pollInterval : 10
101- }
100+ pollInterval : 10 ,
101+ } ,
102102 } )
103103
104104 if ( configFile ) watcher . add ( configFile )
105105
106- watcher . on ( 'ready' , printMessage ) . on ( 'change' , file => {
106+ watcher . on ( 'ready' , printMessage ) . on ( 'change' , ( file ) => {
107107 let recompile = [ ]
108108
109109 if ( input . includes ( file ) ) recompile . push ( file )
110110
111111 recompile = recompile . concat (
112- depGraph . dependantsOf ( file ) . filter ( file => input . includes ( file ) )
112+ depGraph . dependantsOf ( file ) . filter ( ( file ) => input . includes ( file ) )
113113 )
114114
115115 if ( ! recompile . length ) recompile = input
116116
117117 return files ( recompile )
118- . then ( results => watcher . add ( dependencies ( results ) ) )
118+ . then ( ( results ) => watcher . add ( dependencies ( results ) ) )
119119 . then ( printMessage )
120120 . catch ( error )
121121 } )
122122 }
123123 } )
124- . catch ( err => {
124+ . catch ( ( err ) => {
125125 error ( err )
126126
127127 process . exit ( 1 )
@@ -131,7 +131,7 @@ function rc(ctx, path) {
131131 if ( argv . use ) return Promise . resolve ( cliConfig )
132132
133133 return postcssrc ( ctx , path )
134- . then ( rc => {
134+ . then ( ( rc ) => {
135135 if ( rc . options . from || rc . options . to ) {
136136 error (
137137 'Config Error: Can not set from or to options in config file, use CLI arguments instead'
@@ -140,7 +140,7 @@ function rc(ctx, path) {
140140 configFile = rc . file
141141 return rc
142142 } )
143- . catch ( err => {
143+ . catch ( ( err ) => {
144144 if ( ! err . message . includes ( 'No PostCSS Config found' ) ) throw err
145145 } )
146146}
@@ -149,15 +149,15 @@ function files(files) {
149149 if ( typeof files === 'string' ) files = [ files ]
150150
151151 return Promise . all (
152- files . map ( file => {
152+ files . map ( ( file ) => {
153153 if ( file === 'stdin' ) {
154- return stdin ( ) . then ( content => {
154+ return stdin ( ) . then ( ( content ) => {
155155 if ( ! content ) return error ( 'Input Error: Did not receive any STDIN' )
156156 return css ( content , 'stdin' )
157157 } )
158158 }
159159
160- return read ( file ) . then ( content => css ( content , file ) )
160+ return read ( file ) . then ( ( content ) => css ( content , file ) )
161161 } )
162162 )
163163}
@@ -169,7 +169,7 @@ function css(css, file) {
169169 ctx . file = {
170170 dirname : path . dirname ( file ) ,
171171 basename : path . basename ( file ) ,
172- extname : path . extname ( file )
172+ extname : path . extname ( file ) ,
173173 }
174174
175175 if ( ! argv . config ) argv . config = path . dirname ( file )
@@ -185,7 +185,7 @@ function css(css, file) {
185185 printVerbose ( chalk `{cyan Processing {bold ${ relativePath } }...}` )
186186
187187 return rc ( ctx , argv . config )
188- . then ( config => {
188+ . then ( ( config ) => {
189189 config = config || cliConfig
190190 const options = { ...config . options }
191191
@@ -215,7 +215,7 @@ function css(css, file) {
215215
216216 return postcss ( config . plugins )
217217 . process ( css , options )
218- . then ( result => {
218+ . then ( ( result ) => {
219219 const tasks = [ ]
220220
221221 if ( options . to ) {
@@ -242,7 +242,7 @@ function css(css, file) {
242242 } )
243243 } )
244244 } )
245- . catch ( err => {
245+ . catch ( ( err ) => {
246246 throw err
247247 } )
248248}
@@ -252,13 +252,13 @@ function dependencies(results) {
252252
253253 const messages = [ ]
254254
255- results . forEach ( result => {
255+ results . forEach ( ( result ) => {
256256 if ( result . messages <= 0 ) return
257257
258258 result . messages
259- . filter ( msg => ( msg . type === 'dependency' ? msg : '' ) )
259+ . filter ( ( msg ) => ( msg . type === 'dependency' ? msg : '' ) )
260260 . map ( depGraph . add )
261- . forEach ( dependency => messages . push ( dependency . file ) )
261+ . forEach ( ( dependency ) => messages . push ( dependency . file ) )
262262 } )
263263
264264 return messages
0 commit comments