55import { resolve } from "path" ;
66import { existsSync , writeFileSync } from "fs" ;
77import { exec } from "child_process" ;
8- // @ts -ignore: yargs has no default export
98import yargs from "yargs/yargs" ;
10- // @ts -ignore: yargs/helpers has no default export
119import { hideBin } from "yargs/helpers" ;
12- // Use require for boilerplate generators (CommonJS)
13- // @ts -ignore
14- const ruleBoilerplateGenerator = require ( "./boilerplate/rule" ) ;
15- // @ts -ignore
16- const testBoilerplateGenerator = require ( "./boilerplate/test" ) ;
17- // @ts -ignore
18- const docBoilerplateGenerator = require ( "./boilerplate/doc" ) ;
10+ import { ruleBoilerplateGenerator } from "./boilerplate/rule" ;
11+ import { testBoilerplateGenerator } from "./boilerplate/test" ;
12+ import { docBoilerplateGenerator } from "./boilerplate/doc" ;
1913
2014// Define the yargs configuration
2115const argv = yargs ( hideBin ( process . argv ) )
@@ -24,13 +18,13 @@ const argv = yargs(hideBin(process.argv))
2418 alias : "a" ,
2519 type : "string" ,
2620 describe : "Author of the rule" ,
27- default : "$AUTHOR"
21+ default : "$AUTHOR" // Provide default value
2822 } ,
2923 description : {
3024 alias : "d" ,
3125 type : "string" ,
3226 describe : "Description of the rule" ,
33- default : "$DESCRIPTION"
27+ default : "$DESCRIPTION" // Provide default value
3428 }
3529 } )
3630 . demandCommand ( 1 , "You must provide the rule name." ) . argv as any ; // Type assertion for yargs
0 commit comments