@@ -8,7 +8,7 @@ import chalk from 'chalk';
88import { DtsCreator } from './DtsCreator' ;
99import { DtsContent } from "./DtsContent" ;
1010
11- let yarg = yargs . usage ( 'Create .css.d.ts from CSS modules *.css files.\nUsage: $0 [options] <input directory>' )
11+ const yarg = yargs . usage ( 'Create .css.d.ts from CSS modules *.css files.\nUsage: $0 [options] <input directory>' )
1212 . example ( '$0 src/styles' , '' )
1313 . example ( '$0 src -o dist' , '' )
1414 . example ( '$0 -p styles/**/*.icss -w' , '' )
@@ -22,7 +22,7 @@ let yarg = yargs.usage('Create .css.d.ts from CSS modules *.css files.\nUsage: $
2222 . alias ( 's' , 'silent' ) . describe ( 's' , 'Silent output. Do not show "files written" messages' ) . boolean ( 's' )
2323 . alias ( 'h' , 'help' ) . help ( 'h' )
2424 . version ( ( ) => require ( '../package.json' ) . version ) ;
25- let argv = yarg . argv ;
25+ const argv = yarg . argv ;
2626let creator : DtsCreator ;
2727
2828async function writeFile ( f : string ) : Promise < void > {
@@ -39,8 +39,9 @@ async function writeFile(f: string): Promise<void> {
3939 }
4040} ;
4141
42- let main = ( ) => {
43- let rootDir , searchDir ;
42+ function main ( ) {
43+ let rootDir : string ;
44+ let searchDir : string ;
4445 if ( argv . h ) {
4546 yarg . showHelp ( ) ;
4647 return ;
@@ -54,7 +55,7 @@ let main = () => {
5455 yarg . showHelp ( ) ;
5556 return ;
5657 }
57- let filesPattern = path . join ( searchDir , argv . p || '**/*.css' ) ;
58+ const filesPattern = path . join ( searchDir , argv . p || '**/*.css' ) ;
5859 rootDir = process . cwd ( ) ;
5960 creator = new DtsCreator ( {
6061 rootDir,
@@ -76,7 +77,7 @@ let main = () => {
7677 } else {
7778 console . log ( 'Watch ' + filesPattern + '...' ) ;
7879
79- var watcher = chokidar . watch ( [ filesPattern . replace ( / \\ / g, "/" ) ] ) ;
80+ const watcher = chokidar . watch ( [ filesPattern . replace ( / \\ / g, "/" ) ] ) ;
8081 watcher . on ( 'add' , writeFile ) ;
8182 watcher . on ( 'change' , writeFile ) ;
8283 }
0 commit comments