@@ -333,6 +333,12 @@ export type ESLintTemplateName =
333333 | 'svelte-js'
334334 | 'svelte-ts' ;
335335
336+ export type RslintTemplateName =
337+ | 'vanilla-js'
338+ | 'vanilla-ts'
339+ | 'react-js'
340+ | 'react-ts' ;
341+
336342const readJSON = async ( path : string ) =>
337343 JSON . parse ( await fs . promises . readFile ( path , 'utf-8' ) ) ;
338344
@@ -533,6 +539,7 @@ export async function create({
533539 skipFiles,
534540 getTemplateName,
535541 mapESLintTemplate,
542+ mapRslintTemplate,
536543 version,
537544 noteInformation,
538545 extraTools,
@@ -552,6 +559,14 @@ export async function create({
552559 templateName : string ,
553560 context : { distFolder : string } ,
554561 ) => ESLintTemplateName | null ;
562+ /**
563+ * Map the template name to the Rslint template name.
564+ * If not provided, reuses mapESLintTemplate and falls back to 'vanilla-ts'.
565+ */
566+ mapRslintTemplate ?: (
567+ templateName : string ,
568+ context : { distFolder : string } ,
569+ ) => RslintTemplateName | null ;
555570 version ?: Record < string , string > | string ;
556571 noteInformation ?: string [ ] ;
557572 /**
@@ -771,6 +786,30 @@ export async function create({
771786 continue ;
772787 }
773788
789+ if ( tool === 'rslint' ) {
790+ const rslintTemplateName = mapRslintTemplate
791+ ? mapRslintTemplate ( templateName , { distFolder } )
792+ : 'vanilla-ts' ;
793+
794+ if ( ! rslintTemplateName ) {
795+ continue ;
796+ }
797+
798+ const subFolder = path . join ( toolFolder , rslintTemplateName ) ;
799+ copyFolder ( {
800+ from : subFolder ,
801+ to : distFolder ,
802+ version,
803+ skipFiles,
804+ templateParameters,
805+ isMergePackageJson : true ,
806+ } ) ;
807+
808+ agentsMdSearchDirs . push ( toolFolder ) ;
809+ agentsMdSearchDirs . push ( subFolder ) ;
810+ continue ;
811+ }
812+
774813 copyFolder ( {
775814 from : toolFolder ,
776815 to : distFolder ,
0 commit comments